diff options
| author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2017-04-14 02:17:26 -0400 |
|---|---|---|
| committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2017-04-18 10:38:53 -0400 |
| commit | 90ad4052e85cece1bbae064ff4b14088de35df29 (patch) | |
| tree | d31f3811206fc4f51d1677cceb74f58f5e6a557d /Makefile | |
| parent | ebf003f0cfb3705e60d40dedc3ec949176c741af (diff) | |
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>
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 10 |
1 files changed, 5 insertions, 5 deletions
| @@ -632,11 +632,6 @@ include arch/$(SRCARCH)/Makefile | |||
| 632 | KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,) | 632 | KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,) |
| 633 | KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,) | 633 | KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,) |
| 634 | 634 | ||
| 635 | ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION | ||
| 636 | KBUILD_CFLAGS += $(call cc-option,-ffunction-sections,) | ||
| 637 | KBUILD_CFLAGS += $(call cc-option,-fdata-sections,) | ||
| 638 | endif | ||
| 639 | |||
| 640 | ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE | 635 | ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE |
| 641 | KBUILD_CFLAGS += $(call cc-option,-Oz,-Os) | 636 | KBUILD_CFLAGS += $(call cc-option,-Oz,-Os) |
| 642 | KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,) | 637 | KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,) |
| @@ -768,6 +763,11 @@ ifdef CONFIG_DEBUG_SECTION_MISMATCH | |||
| 768 | KBUILD_CFLAGS += $(call cc-option, -fno-inline-functions-called-once) | 763 | KBUILD_CFLAGS += $(call cc-option, -fno-inline-functions-called-once) |
| 769 | endif | 764 | endif |
| 770 | 765 | ||
| 766 | ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION | ||
| 767 | KBUILD_CFLAGS += $(call cc-option,-ffunction-sections,) | ||
| 768 | KBUILD_CFLAGS += $(call cc-option,-fdata-sections,) | ||
| 769 | endif | ||
| 770 | |||
| 771 | # arch Makefile may override CC so keep this after arch Makefile is included | 771 | # arch Makefile may override CC so keep this after arch Makefile is included |
| 772 | NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include) | 772 | NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include) |
| 773 | CHECKFLAGS += $(NOSTDINC_FLAGS) | 773 | CHECKFLAGS += $(NOSTDINC_FLAGS) |
