aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile10
-rw-r--r--arch/arc/Makefile4
-rw-r--r--scripts/Makefile.extrawarn3
-rw-r--r--scripts/Makefile.ubsan4
4 files changed, 16 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index f97f786de58d..06e2b73978e8 100644
--- a/Makefile
+++ b/Makefile
@@ -370,7 +370,7 @@ LDFLAGS_MODULE =
370CFLAGS_KERNEL = 370CFLAGS_KERNEL =
371AFLAGS_KERNEL = 371AFLAGS_KERNEL =
372LDFLAGS_vmlinux = 372LDFLAGS_vmlinux =
373CFLAGS_GCOV = -fprofile-arcs -ftest-coverage -fno-tree-loop-im 373CFLAGS_GCOV = -fprofile-arcs -ftest-coverage -fno-tree-loop-im -Wno-maybe-uninitialized
374CFLAGS_KCOV := $(call cc-option,-fsanitize-coverage=trace-pc,) 374CFLAGS_KCOV := $(call cc-option,-fsanitize-coverage=trace-pc,)
375 375
376 376
@@ -620,7 +620,6 @@ ARCH_CFLAGS :=
620include arch/$(SRCARCH)/Makefile 620include arch/$(SRCARCH)/Makefile
621 621
622KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,) 622KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,)
623KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,)
624KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,) 623KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,)
625 624
626ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION 625ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
@@ -629,15 +628,18 @@ KBUILD_CFLAGS += $(call cc-option,-fdata-sections,)
629endif 628endif
630 629
631ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE 630ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
632KBUILD_CFLAGS += -Os 631KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,)
633else 632else
634ifdef CONFIG_PROFILE_ALL_BRANCHES 633ifdef CONFIG_PROFILE_ALL_BRANCHES
635KBUILD_CFLAGS += -O2 634KBUILD_CFLAGS += -O2 $(call cc-disable-warning,maybe-uninitialized,)
636else 635else
637KBUILD_CFLAGS += -O2 636KBUILD_CFLAGS += -O2
638endif 637endif
639endif 638endif
640 639
640KBUILD_CFLAGS += $(call cc-ifversion, -lt, 0409, \
641 $(call cc-disable-warning,maybe-uninitialized,))
642
641# Tell gcc to never replace conditional load with a non-conditional one 643# Tell gcc to never replace conditional load with a non-conditional one
642KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0) 644KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0)
643 645
diff --git a/arch/arc/Makefile b/arch/arc/Makefile
index 864adad52280..25f81a1db9f9 100644
--- a/arch/arc/Makefile
+++ b/arch/arc/Makefile
@@ -68,7 +68,9 @@ cflags-$(CONFIG_ARC_DW2_UNWIND) += -fasynchronous-unwind-tables $(cfi)
68ifndef CONFIG_CC_OPTIMIZE_FOR_SIZE 68ifndef CONFIG_CC_OPTIMIZE_FOR_SIZE
69# Generic build system uses -O2, we want -O3 69# Generic build system uses -O2, we want -O3
70# Note: No need to add to cflags-y as that happens anyways 70# Note: No need to add to cflags-y as that happens anyways
71ARCH_CFLAGS += -O3 71#
72# Disable the false maybe-uninitialized warings gcc spits out at -O3
73ARCH_CFLAGS += -O3 $(call cc-disable-warning,maybe-uninitialized,)
72endif 74endif
73 75
74# small data is default for elf32 tool-chain. If not usable, disable it 76# small data is default for elf32 tool-chain. If not usable, disable it
diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
index 53449a6ff6aa..7fc2c5a3dbbe 100644
--- a/scripts/Makefile.extrawarn
+++ b/scripts/Makefile.extrawarn
@@ -36,6 +36,7 @@ warning-2 += -Wshadow
36warning-2 += $(call cc-option, -Wlogical-op) 36warning-2 += $(call cc-option, -Wlogical-op)
37warning-2 += $(call cc-option, -Wmissing-field-initializers) 37warning-2 += $(call cc-option, -Wmissing-field-initializers)
38warning-2 += $(call cc-option, -Wsign-compare) 38warning-2 += $(call cc-option, -Wsign-compare)
39warning-2 += $(call cc-option, -Wmaybe-uninitialized)
39 40
40warning-3 := -Wbad-function-cast 41warning-3 := -Wbad-function-cast
41warning-3 += -Wcast-qual 42warning-3 += -Wcast-qual
@@ -59,6 +60,8 @@ endif
59KBUILD_CFLAGS += $(warning) 60KBUILD_CFLAGS += $(warning)
60else 61else
61 62
63KBUILD_CFLAGS += $(call cc-disable-warning, maybe-uninitialized)
64
62ifeq ($(cc-name),clang) 65ifeq ($(cc-name),clang)
63KBUILD_CFLAGS += $(call cc-disable-warning, initializer-overrides) 66KBUILD_CFLAGS += $(call cc-disable-warning, initializer-overrides)
64KBUILD_CFLAGS += $(call cc-disable-warning, unused-value) 67KBUILD_CFLAGS += $(call cc-disable-warning, unused-value)
diff --git a/scripts/Makefile.ubsan b/scripts/Makefile.ubsan
index dd779c40c8e6..3b1b13818d59 100644
--- a/scripts/Makefile.ubsan
+++ b/scripts/Makefile.ubsan
@@ -17,4 +17,8 @@ endif
17ifdef CONFIG_UBSAN_NULL 17ifdef CONFIG_UBSAN_NULL
18 CFLAGS_UBSAN += $(call cc-option, -fsanitize=null) 18 CFLAGS_UBSAN += $(call cc-option, -fsanitize=null)
19endif 19endif
20
21 # -fsanitize=* options makes GCC less smart than usual and
22 # increase number of 'maybe-uninitialized false-positives
23 CFLAGS_UBSAN += $(call cc-option, -Wno-maybe-uninitialized)
20endif 24endif