Skip to content

Commit a149430

Browse files
committed
kbuild: add all Clang-specific flags unconditionally
We do not support old Clang versions. Upgrade your clang version if any of these flags is unsupported. Let's add all flags inside ifdef CONFIG_CC_IS_CLANG unconditionally. Signed-off-by: Masahiro Yamada <[email protected]> Reviewed-by: Sedat Dilek <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nick Desaulniers <[email protected]>
1 parent 7eb8e5f commit a149430

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -731,15 +731,15 @@ stackp-flags-$(CONFIG_STACKPROTECTOR_STRONG) := -fstack-protector-strong
731731
KBUILD_CFLAGS += $(stackp-flags-y)
732732

733733
ifdef CONFIG_CC_IS_CLANG
734-
KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
735-
KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier)
736-
KBUILD_CFLAGS += $(call cc-disable-warning, gnu)
734+
KBUILD_CPPFLAGS += -Qunused-arguments
735+
KBUILD_CFLAGS += -Wno-format-invalid-specifier
736+
KBUILD_CFLAGS += -Wno-gnu
737737
# Quiet clang warning: comparison of unsigned expression < 0 is always false
738-
KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare)
738+
KBUILD_CFLAGS += -Wno-tautological-compare
739739
# CLANG uses a _MergedGlobals as optimization, but this breaks modpost, as the
740740
# source of a reference will be _MergedGlobals and not on of the whitelisted names.
741741
# See modpost pattern 2
742-
KBUILD_CFLAGS += $(call cc-option, -mno-global-merge,)
742+
KBUILD_CFLAGS += -mno-global-merge
743743
else
744744

745745
# These warnings generated too much noise in a regular build.

scripts/Makefile.extrawarn

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ KBUILD_CFLAGS += $(warning)
6767
else
6868

6969
ifdef CONFIG_CC_IS_CLANG
70-
KBUILD_CFLAGS += $(call cc-disable-warning, initializer-overrides)
71-
KBUILD_CFLAGS += $(call cc-disable-warning, unused-value)
72-
KBUILD_CFLAGS += $(call cc-disable-warning, format)
73-
KBUILD_CFLAGS += $(call cc-disable-warning, sign-compare)
74-
KBUILD_CFLAGS += $(call cc-disable-warning, format-zero-length)
75-
KBUILD_CFLAGS += $(call cc-disable-warning, uninitialized)
70+
KBUILD_CFLAGS += -Wno-initializer-overrides
71+
KBUILD_CFLAGS += -Wno-unused-value
72+
KBUILD_CFLAGS += -Wno-format
73+
KBUILD_CFLAGS += -Wno-sign-compare
74+
KBUILD_CFLAGS += -Wno-format-zero-length
75+
KBUILD_CFLAGS += -Wno-uninitialized
7676
endif
7777
endif

0 commit comments

Comments
 (0)