lkml.org 
[lkml]   [2015]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] perf: fix wrong DEBUG configuration

* Martin Liška <mliska@suse.cz> wrote:

> Currently, GCC optimizes -O6 same as -O3 level, thus change the value
> to -O6.

s/to -O6
to -O3

> Right optimize debugging experience is given by passing -Og to
> compiler. Assign default value for pointers that are identified by
> compiler as non-initialized.

s/Right optimize debugging experience is given/
Correct debugging experience is given/

s/identified by compiler
identified by the compiler

> ifeq ($(DEBUG),0)
> - CFLAGS += -O6
> + CFLAGS += -O3
> +else
> + CFLAGS += $(call cc-option,-Og,-O0)
> endif

> +# try-run
> +# Usage: option = $(call try-run, $(CC)...-o "$$TMP",option-ok,otherwise)
> +# Exit code chooses option. "$$TMP" is can be used as temporary file and
> +# is automatically cleaned up.
> +try-run = $(shell set -e; \
> + TMP="$(TMPOUT).$$$$.tmp"; \
> + TMPO="$(TMPOUT).$$$$.o"; \
> + if ($(1)) >/dev/null 2>&1; \
> + then echo "$(2)"; \
> + else echo "$(3)"; \
> + fi; \
> + rm -f "$$TMP" "$$TMPO")
> +
> +# cc-option
> +# Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586)
> +
> +cc-option = $(call try-run,\
> + $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2))

Looks good to me!

Acked-by: Ingo Molnar <mingo@kernel.org>

Thanks,

Ingo


\
 
 \ /
  Last update: 2015-05-25 13:21    [W:0.141 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site