lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170314213410.3762842-1-arnd@arndb.de>
Date:   Tue, 14 Mar 2017 22:33:27 +0100
From:   Arnd Bergmann <arnd@...db.de>
To:     Masahiro Yamada <yamada.masahiro@...ionext.com>,
        Michal Marek <mmarek@...e.com>
Cc:     Arnd Bergmann <arnd@...db.de>,
        Namhyung Kim <namhyung.with.foss@...il.com>,
        linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] [v2] kbuild: disable -ffunction-sections on gcc-4.7 with ftrace

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@...db.de>
Cc: Namhyung Kim <namhyung.with.foss@...il.com>
---
Fixed version number in check as pointed out by Namhyung Kim
---
 Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Makefile b/Makefile
index 6e7e644a0b84..608727d3e47f 100644
--- a/Makefile
+++ b/Makefile
@@ -662,7 +662,11 @@ KBUILD_CFLAGS	+= -Wextra
 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ