summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2019-02-20 23:13:38 -0500
committerMasahiro Yamada <yamada.masahiro@socionext.com>2019-02-27 07:43:20 -0500
commitb303c6df80c9f8f13785aa83a0471fca7e38b24d (patch)
treee5115e2524486b8633a4d024e9a1d2761f3c181f /Makefile
parentbd55f96fa9fc29702ec30d75a4290bdadb00209d (diff)
kbuild: compute false-positive -Wmaybe-uninitialized cases in Kconfig
Since -Wmaybe-uninitialized was introduced by GCC 4.7, we have patched various false positives: - commit e74fc973b6e5 ("Turn off -Wmaybe-uninitialized when building with -Os") turned off this option for -Os. - commit 815eb71e7149 ("Kbuild: disable 'maybe-uninitialized' warning for CONFIG_PROFILE_ALL_BRANCHES") turned off this option for CONFIG_PROFILE_ALL_BRANCHES - commit a76bcf557ef4 ("Kbuild: enable -Wmaybe-uninitialized warning for "make W=1"") turned off this option for GCC < 4.9 Arnd provided more explanation in https://lkml.org/lkml/2017/3/14/903 I think this looks better by shifting the logic from Makefile to Kconfig. Link: https://github.com/ClangBuiltLinux/linux/issues/350 Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Nathan Chancellor <natechancellor@gmail.com> Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 3 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 7d9032bf47c5..9f52fda4ad0e 100644
--- a/Makefile
+++ b/Makefile
@@ -660,17 +660,13 @@ KBUILD_CFLAGS += $(call cc-disable-warning, int-in-bool-context)
660 660
661ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE 661ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
662KBUILD_CFLAGS += $(call cc-option,-Oz,-Os) 662KBUILD_CFLAGS += $(call cc-option,-Oz,-Os)
663KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,)
664else
665ifdef CONFIG_PROFILE_ALL_BRANCHES
666KBUILD_CFLAGS += -O2 $(call cc-disable-warning,maybe-uninitialized,)
667else 663else
668KBUILD_CFLAGS += -O2 664KBUILD_CFLAGS += -O2
669endif 665endif
670endif
671 666
672KBUILD_CFLAGS += $(call cc-ifversion, -lt, 0409, \ 667ifdef CONFIG_CC_DISABLE_WARN_MAYBE_UNINITIALIZED
673 $(call cc-disable-warning,maybe-uninitialized,)) 668KBUILD_CFLAGS += -Wno-maybe-uninitialized
669endif
674 670
675# Tell gcc to never replace conditional load with a non-conditional one 671# Tell gcc to never replace conditional load with a non-conditional one
676KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0) 672KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0)