Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1543309 > unrolled thread

[PATCH] kbuild: disable -ffunction-sections on gcc-4.7 with ftrace

Started byArnd Bergmann <arnd@arndb.de>
First post2016-12-16 10:30 +0100
Last post2016-12-18 15:20 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] kbuild: disable -ffunction-sections on gcc-4.7 with ftrace Arnd Bergmann <arnd@arndb.de> - 2016-12-16 10:30 +0100
    Re: [PATCH] kbuild: disable -ffunction-sections on gcc-4.7 with ftrace Namhyung Kim <namhyung.with.foss@gmail.com> - 2016-12-18 15:20 +0100

#1543309 — [PATCH] kbuild: disable -ffunction-sections on gcc-4.7 with ftrace

FromArnd Bergmann <arnd@arndb.de>
Date2016-12-16 10:30 +0100
Subject[PATCH] kbuild: disable -ffunction-sections on gcc-4.7 with ftrace
Message-ID<sOWZY-1DO-39@gated-at.bofh.it>
When ftrace is enabled and we build with gcc-4.7 or older, we
get a warning for each file on architectures that select
CONFIG_LD_DEAD_CODE_DATA_ELIMINATION:

warning: -ffunction-sections disabled; it makes profiling impossible [enabled by default]

This turns off function sections in that specific case, leaving
it enabled for all other configurations.

Fixes: b67067f1176d ("kbuild: allow archs to select link dead code/data elimination")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Makefile b/Makefile
index 4fb4b889c862..7dfd0aa4f3f7 100644
--- a/Makefile
+++ b/Makefile
@@ -638,7 +638,11 @@ KBUILD_CFLAGS	+= $(call cc-option,-fno-delete-null-pointer-checks,)
 KBUILD_CFLAGS	+= $(call cc-disable-warning,frame-address,)
 
 ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
+ifdef CONFIG_FUNCTION_TRACER
+KBUILD_CFLAGS	+= $(call cc-ifversion, -ge,0409,$(call cc-option,-ffunction-sections,))
+else
 KBUILD_CFLAGS	+= $(call cc-option,-ffunction-sections,)
+endif
 KBUILD_CFLAGS	+= $(call cc-option,-fdata-sections,)
 endif
 
-- 
2.9.0

[toc] | [next] | [standalone]


#1544150

FromNamhyung Kim <namhyung.with.foss@gmail.com>
Date2016-12-18 15:20 +0100
Message-ID<sPKtI-s3-9@gated-at.bofh.it>
In reply to#1543309
Hi,

On Fri, Dec 16, 2016 at 6:24 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> When ftrace is enabled and we build with gcc-4.7 or older, we
> get a warning for each file on architectures that select
> CONFIG_LD_DEAD_CODE_DATA_ELIMINATION:
>
> warning: -ffunction-sections disabled; it makes profiling impossible [enabled by default]
>
> This turns off function sections in that specific case, leaving
> it enabled for all other configurations.
>
> Fixes: b67067f1176d ("kbuild: allow archs to select link dead code/data elimination")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  Makefile | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/Makefile b/Makefile
> index 4fb4b889c862..7dfd0aa4f3f7 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -638,7 +638,11 @@ KBUILD_CFLAGS      += $(call cc-option,-fno-delete-null-pointer-checks,)
>  KBUILD_CFLAGS  += $(call cc-disable-warning,frame-address,)
>
>  ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
> +ifdef CONFIG_FUNCTION_TRACER
> +KBUILD_CFLAGS  += $(call cc-ifversion, -ge,0409,$(call cc-option,-ffunction-sections,))

s/0409/0408/ ?

Thanks,
Namhyung


> +else
>  KBUILD_CFLAGS  += $(call cc-option,-ffunction-sections,)
> +endif
>  KBUILD_CFLAGS  += $(call cc-option,-fdata-sections,)
>  endif
>
> --
> 2.9.0
>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web