linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kbuild: add most of Clang-specific flags unconditionally
@ 2019-05-09  6:44 Masahiro Yamada
  2019-05-09  7:06 ` Sedat Dilek
  2019-05-09 11:15 ` Nathan Chancellor
  0 siblings, 2 replies; 13+ messages in thread
From: Masahiro Yamada @ 2019-05-09  6:44 UTC (permalink / raw)
  To: linux-kbuild
  Cc: Nick Desaulniers, Nathan Chancellor, Arnd Bergmann,
	clang-built-linux, Masahiro Yamada, Michal Marek, linux-kernel

We do not support old Clang versions. Upgrade your clang version
if any of these flags is unsupported.

Let's add flags within ifdef CONFIG_CC_IS_CLANG unconditionally,
except -fcatch-undefined-behavior.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 Makefile                   | 10 +++++-----
 scripts/Makefile.extrawarn | 12 ++++++------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/Makefile b/Makefile
index bd7ae11947cb..c71ffb6f55b5 100644
--- a/Makefile
+++ b/Makefile
@@ -731,15 +731,15 @@ stackp-flags-$(CONFIG_STACKPROTECTOR_STRONG)      := -fstack-protector-strong
 KBUILD_CFLAGS += $(stackp-flags-y)
 
 ifdef CONFIG_CC_IS_CLANG
-KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
-KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier)
-KBUILD_CFLAGS += $(call cc-disable-warning, gnu)
+KBUILD_CPPFLAGS += -Qunused-arguments
+KBUILD_CFLAGS += -Wno-format-invalid-specifier
+KBUILD_CFLAGS += -Wno-gnu
 # Quiet clang warning: comparison of unsigned expression < 0 is always false
-KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare)
+KBUILD_CFLAGS += -Wno-tautological-compare
 # CLANG uses a _MergedGlobals as optimization, but this breaks modpost, as the
 # source of a reference will be _MergedGlobals and not on of the whitelisted names.
 # See modpost pattern 2
-KBUILD_CFLAGS += $(call cc-option, -mno-global-merge,)
+KBUILD_CFLAGS += -mno-global-merge
 KBUILD_CFLAGS += $(call cc-option, -fcatch-undefined-behavior)
 else
 
diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
index 768306add591..523c4cafe2dc 100644
--- a/scripts/Makefile.extrawarn
+++ b/scripts/Makefile.extrawarn
@@ -66,11 +66,11 @@ KBUILD_CFLAGS += $(warning)
 else
 
 ifdef CONFIG_CC_IS_CLANG
-KBUILD_CFLAGS += $(call cc-disable-warning, initializer-overrides)
-KBUILD_CFLAGS += $(call cc-disable-warning, unused-value)
-KBUILD_CFLAGS += $(call cc-disable-warning, format)
-KBUILD_CFLAGS += $(call cc-disable-warning, sign-compare)
-KBUILD_CFLAGS += $(call cc-disable-warning, format-zero-length)
-KBUILD_CFLAGS += $(call cc-disable-warning, uninitialized)
+KBUILD_CFLAGS += -Wno-initializer-overrides
+KBUILD_CFLAGS += -Wno-unused-value
+KBUILD_CFLAGS += -Wno-format
+KBUILD_CFLAGS += -Wno-sign-compare
+KBUILD_CFLAGS += -Wno-format-zero-length
+KBUILD_CFLAGS += -Wno-uninitialized
 endif
 endif
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2019-05-13  2:24 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-09  6:44 [PATCH] kbuild: add most of Clang-specific flags unconditionally Masahiro Yamada
2019-05-09  7:06 ` Sedat Dilek
2019-05-10 13:53   ` Masahiro Yamada
2019-05-10 17:57     ` Nick Desaulniers
2019-05-09 11:15 ` Nathan Chancellor
2019-05-09 11:35   ` Masahiro Yamada
2019-05-09 11:40     ` Nathan Chancellor
2019-05-09 11:48     ` [PATCH] Makefile: Don't try to add '-fcatch-undefined-behavior' flag Nathan Chancellor
2019-05-09 13:33       ` Masahiro Yamada
2019-05-09 13:49       ` Sedat Dilek
2019-05-09 17:01         ` Nick Desaulniers
2019-05-13  2:23       ` Masahiro Yamada
2019-05-09 17:17   ` [PATCH] kbuild: add most of Clang-specific flags unconditionally Nick Desaulniers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).