diff options
-rw-r--r-- | Makefile | 10 | ||||
-rw-r--r-- | arch/arc/Makefile | 4 | ||||
-rw-r--r-- | scripts/Makefile.extrawarn | 3 | ||||
-rw-r--r-- | scripts/Makefile.ubsan | 4 |
4 files changed, 16 insertions, 5 deletions
@@ -370,7 +370,7 @@ LDFLAGS_MODULE = | |||
370 | CFLAGS_KERNEL = | 370 | CFLAGS_KERNEL = |
371 | AFLAGS_KERNEL = | 371 | AFLAGS_KERNEL = |
372 | LDFLAGS_vmlinux = | 372 | LDFLAGS_vmlinux = |
373 | CFLAGS_GCOV = -fprofile-arcs -ftest-coverage -fno-tree-loop-im | 373 | CFLAGS_GCOV = -fprofile-arcs -ftest-coverage -fno-tree-loop-im -Wno-maybe-uninitialized |
374 | CFLAGS_KCOV := $(call cc-option,-fsanitize-coverage=trace-pc,) | 374 | CFLAGS_KCOV := $(call cc-option,-fsanitize-coverage=trace-pc,) |
375 | 375 | ||
376 | 376 | ||
@@ -620,7 +620,6 @@ ARCH_CFLAGS := | |||
620 | include arch/$(SRCARCH)/Makefile | 620 | include arch/$(SRCARCH)/Makefile |
621 | 621 | ||
622 | KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,) | 622 | KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,) |
623 | KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,) | ||
624 | KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,) | 623 | KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,) |
625 | 624 | ||
626 | ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION | 625 | ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION |
@@ -629,15 +628,18 @@ KBUILD_CFLAGS += $(call cc-option,-fdata-sections,) | |||
629 | endif | 628 | endif |
630 | 629 | ||
631 | ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE | 630 | ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE |
632 | KBUILD_CFLAGS += -Os | 631 | KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,) |
633 | else | 632 | else |
634 | ifdef CONFIG_PROFILE_ALL_BRANCHES | 633 | ifdef CONFIG_PROFILE_ALL_BRANCHES |
635 | KBUILD_CFLAGS += -O2 | 634 | KBUILD_CFLAGS += -O2 $(call cc-disable-warning,maybe-uninitialized,) |
636 | else | 635 | else |
637 | KBUILD_CFLAGS += -O2 | 636 | KBUILD_CFLAGS += -O2 |
638 | endif | 637 | endif |
639 | endif | 638 | endif |
640 | 639 | ||
640 | KBUILD_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 |
642 | KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0) | 644 | KBUILD_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) | |||
68 | ifndef CONFIG_CC_OPTIMIZE_FOR_SIZE | 68 | ifndef 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 |
71 | ARCH_CFLAGS += -O3 | 71 | # |
72 | # Disable the false maybe-uninitialized warings gcc spits out at -O3 | ||
73 | ARCH_CFLAGS += -O3 $(call cc-disable-warning,maybe-uninitialized,) | ||
72 | endif | 74 | endif |
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 | |||
36 | warning-2 += $(call cc-option, -Wlogical-op) | 36 | warning-2 += $(call cc-option, -Wlogical-op) |
37 | warning-2 += $(call cc-option, -Wmissing-field-initializers) | 37 | warning-2 += $(call cc-option, -Wmissing-field-initializers) |
38 | warning-2 += $(call cc-option, -Wsign-compare) | 38 | warning-2 += $(call cc-option, -Wsign-compare) |
39 | warning-2 += $(call cc-option, -Wmaybe-uninitialized) | ||
39 | 40 | ||
40 | warning-3 := -Wbad-function-cast | 41 | warning-3 := -Wbad-function-cast |
41 | warning-3 += -Wcast-qual | 42 | warning-3 += -Wcast-qual |
@@ -59,6 +60,8 @@ endif | |||
59 | KBUILD_CFLAGS += $(warning) | 60 | KBUILD_CFLAGS += $(warning) |
60 | else | 61 | else |
61 | 62 | ||
63 | KBUILD_CFLAGS += $(call cc-disable-warning, maybe-uninitialized) | ||
64 | |||
62 | ifeq ($(cc-name),clang) | 65 | ifeq ($(cc-name),clang) |
63 | KBUILD_CFLAGS += $(call cc-disable-warning, initializer-overrides) | 66 | KBUILD_CFLAGS += $(call cc-disable-warning, initializer-overrides) |
64 | KBUILD_CFLAGS += $(call cc-disable-warning, unused-value) | 67 | KBUILD_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 | |||
17 | ifdef CONFIG_UBSAN_NULL | 17 | ifdef CONFIG_UBSAN_NULL |
18 | CFLAGS_UBSAN += $(call cc-option, -fsanitize=null) | 18 | CFLAGS_UBSAN += $(call cc-option, -fsanitize=null) |
19 | endif | 19 | endif |
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) | ||
20 | endif | 24 | endif |