Makefile.flags: suppress clang warnings when cross-compiling
No binary (build failed)
—
(log yok)
| @@ -48,7 +48,7 @@ endif | |
| # gcc 3.x emits bogus "old style proto" warning on find.c:alloc_action() | |
| CFLAGS += $(call cc-ifversion, -ge, 0400, -Wold-style-definition) | |
| - | ifneq ($(CC),clang) |
| + | ifneq ($(lastword $(subst -, ,$(CC))),clang) |
| # "clang-9: warning: optimization flag '-finline-limit=0' is not supported | |
| CFLAGS += $(call cc-option,-finline-limit=0,) | |
| endif | |
| @@ -66,7 +66,7 @@ CFLAGS += $(call cc-option,-static-libgcc,) | |
| endif | |
| CFLAGS += $(call cc-option,-falign-functions=1,) | |
| - | ifneq ($(CC),clang) |
| + | ifneq ($(lastword $(subst -, ,$(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 | |
| @@ -79,7 +79,7 @@ CFLAGS += $(call cc-option,-fno-asynchronous-unwind-tables,) | |
| CFLAGS += $(call cc-option,-fno-builtin-printf,) | |
| # clang-9 does not like "str" + N and "if (CONFIG_ITEM && cond)" constructs | |
| - | ifeq ($(CC),clang) |
| + | ifeq ($(lastword $(subst -, ,$(CC))),clang) |
| CFLAGS += $(call cc-option,-Wno-string-plus-int -Wno-constant-logical-operand) | |
| endif | |