OSDN Git Service

kbuild: avoid conflict between -ffunction-sections and -pg on gcc-4.7
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Fri, 14 Apr 2017 06:17:26 +0000 (15:17 +0900)
committer0ranko0P <ranko0p@outlook.com>
Sat, 7 Dec 2019 08:37:12 +0000 (16:37 +0800)
commit50d50a98f0ac6fb3038d2bc3eb925e0ab77b8ed5
tree30eda6801434f316892f605de9fef68418145e52
parentd3794b4cf4c5d561d35f206dca9f7fe46ff241e7
kbuild: avoid conflict between -ffunction-sections and -pg on gcc-4.7

Arnd Bergmann reported:
  "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]
  "

Since commit c3f0d0bc5b01 ("kbuild, LLVMLinux: Add -Werror to
cc-option to support clang"), warnings are treated as errors in
cc-option checks.  CC_FLAGS_FTRACE is blindly added to KBUILD_CFLAGS,
so $(call cc-option,-ffunction-sections,) should be moved below it
in order to detect the conflict between the two options.

Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Makefile