summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko2019-10-25 12:56:51 +0200
committerDenys Vlasenko2019-10-25 12:56:51 +0200
commitb4ef2e3467d8e980ccf13c9dd342459c013b455f (patch)
tree0cda70aa17a210c24810b0402e73a98c69dd732f
parentaf7169b4a70eb3f60555ced17a40780f70aaaa5c (diff)
downloadbusybox-b4ef2e3467d8e980ccf13c9dd342459c013b455f.zip
busybox-b4ef2e3467d8e980ccf13c9dd342459c013b455f.tar.gz
Makefile.flags: suppress some clang-9 warnings
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--Makefile.flags25
1 files changed, 22 insertions, 3 deletions
diff --git a/Makefile.flags b/Makefile.flags
index bea4647..e378fba 100644
--- a/Makefile.flags
+++ b/Makefile.flags
@@ -47,12 +47,28 @@ endif
# gcc 3.x emits bogus "old style proto" warning on find.c:alloc_action()
CFLAGS += $(call cc-ifversion, -ge, 0400, -Wold-style-definition)
-CFLAGS += $(call cc-option,-fno-builtin-strlen -finline-limit=0 -fomit-frame-pointer -ffunction-sections -fdata-sections,)
+ifneq ($(CC),clang)
+# "clang-9: warning: optimization flag '-finline-limit=0' is not supported
+CFLAGS += $(call cc-option,-finline-limit=0,)
+endif
+
+CFLAGS += $(call cc-option,-fno-builtin-strlen -fomit-frame-pointer -ffunction-sections -fdata-sections,)
# -fno-guess-branch-probability: prohibit pseudo-random guessing
# of branch probabilities (hopefully makes bloatcheck more stable):
CFLAGS += $(call cc-option,-fno-guess-branch-probability,)
-CFLAGS += $(call cc-option,-funsigned-char -static-libgcc,)
-CFLAGS += $(call cc-option,-falign-functions=1 -falign-jumps=1 -falign-labels=1 -falign-loops=1,)
+CFLAGS += $(call cc-option,-funsigned-char,)
+
+ifneq ($(CC),clang)
+# "clang-9: warning: argument unused during compilation: '-static-libgcc'"
+CFLAGS += $(call cc-option,-static-libgcc,)
+endif
+
+CFLAGS += $(call cc-option,-falign-functions=1,)
+ifneq ($(CC),clang)
+# "clang-9: warning: optimization flag '-falign-jumps=1' is not supported" (and same for other two)
+CFLAGS += $(call cc-option,-falign-jumps=1 -falign-labels=1 -falign-loops=1,)
+endif
+
# Defeat .eh_frame bloat (gcc 4.6.3 x86-32 defconfig: 20% smaller busybox binary):
CFLAGS += $(call cc-option,-fno-unwind-tables,)
CFLAGS += $(call cc-option,-fno-asynchronous-unwind-tables,)
@@ -60,6 +76,9 @@ CFLAGS += $(call cc-option,-fno-asynchronous-unwind-tables,)
# (try disabling this and comparing assembly, it's instructive)
CFLAGS += $(call cc-option,-fno-builtin-printf,)
+# clang-9 does not like "str" + N and "if (CONFIG_ITEM && cond)" constructs
+CFLAGS += $(call cc-option,-Wno-string-plus-int -Wno-constant-logical-operand)
+
# FIXME: These warnings are at least partially to be concerned about and should
# be fixed..
#CFLAGS += $(call cc-option,-Wconversion,)