summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Menzel <paulepanter@users.sourceforge.net>2015-04-08 10:53:39 +0200
committerAaron Durbin <adurbin@google.com>2015-04-08 15:42:37 +0200
commit23b4e4c4e80c0acd17c088c6bdde8c3bfccce898 (patch)
tree475d896966d714f70609e5c0d9c00602e463c294
parentdbe5756bb3530e14e95a86cabbaa9e7a77144fec (diff)
downloadcoreboot-23b4e4c4e80c0acd17c088c6bdde8c3bfccce898.tar.xz
Makefile.inc: Only add `-Wno-unused-but-set-variable` for GCC
Clang (3.5) does not know that option. error: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Werror,-Wunknown-warning-option] Fix up commit f69a99db (coreboot: x86: enable gc-sections) to only add that option, when GCC is used. Change-Id: I65b41133a806df1803ccc445e27184c579a718a0 Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-on: http://review.coreboot.org/9377 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@google.com>
-rw-r--r--Makefile.inc8
1 files changed, 7 insertions, 1 deletions
diff --git a/Makefile.inc b/Makefile.inc
index 2d3ae2bc51..10759f569d 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -237,7 +237,13 @@ CPPFLAGS_common += -include $(src)/include/kconfig.h
CFLAGS_common += -pipe -g -nostdinc
CFLAGS_common += -nostdlib -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes
CFLAGS_common += -Wwrite-strings -Wredundant-decls -Wno-trigraphs
-CFLAGS_common += -Wstrict-aliasing -Wshadow -Wno-unused-but-set-variable
+CFLAGS_common += -Wstrict-aliasing -Wshadow
+
+ifeq ($(CONFIG_COMPILER_GCC),y)
+# cf. commit f69a99db (coreboot: x86: enable gc-sections)
+CFLAGS_common += -Wno-unused-but-set-variable
+endif
+
ifeq ($(CONFIG_WARNINGS_ARE_ERRORS),y)
CFLAGS_common += -Werror
endif