aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert@linux-m68k.org>2014-05-27 03:54:12 -0400
committerMichal Marek <mmarek@suse.cz>2014-06-09 17:28:07 -0400
commita1c48bb160f8368ea9668a1ff98513631fa0d87a (patch)
treecbfd5f69b03cd1cec418f5d90e4124a422f8688e /Makefile
parentc43cecadb0bf0ccd6e9c96a920c753ae47dce567 (diff)
Makefile: Fix unrecognized cross-compiler command line options
On architectures that setup CROSS_COMPILE in their arch/*/Makefile (arc, blackfin, m68k, mips, parisc, score, sh, tile, unicore32, xtensa), cc-option and cc-disable-warning may check against the wrong compiler, causing errors like cc1: error: unrecognized command line option "-Wno-maybe-uninitialized" if the host gcc supports a compiler option, while the cross compiler doesn't support that option. Move all logic using cc-option or cc-disable-warning below the inclusion of the arch's Makefile to fix this. Introduced by - commit e74fc973b6e531fef1fce8b101ffff05ecfb774c ("Turn off -Wmaybe-uninitialized when building with -Os"), - commit 61163efae02040f66a95c8ed17f4407951ba58fa ("kbuild: LLVMLinux: Add Kbuild support for building kernel with Clang"). As -Wno-maybe-uninitialized requires a quite recent gcc (gcc 4.6.3 on Ubuntu 12.04 LTS doesn't support it), this only showed up recently (gcc 4.8.2 on Ubuntu 14.04 LTS does support it). Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 6 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index f4702c10b2b8..8a0de808bafc 100644
--- a/Makefile
+++ b/Makefile
@@ -400,8 +400,8 @@ KBUILD_CPPFLAGS := -D__KERNEL__
400KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ 400KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
401 -fno-strict-aliasing -fno-common \ 401 -fno-strict-aliasing -fno-common \
402 -Werror-implicit-function-declaration \ 402 -Werror-implicit-function-declaration \
403 -Wno-format-security \ 403 -Wno-format-security
404 $(call cc-option,-fno-delete-null-pointer-checks,) 404
405KBUILD_AFLAGS_KERNEL := 405KBUILD_AFLAGS_KERNEL :=
406KBUILD_CFLAGS_KERNEL := 406KBUILD_CFLAGS_KERNEL :=
407KBUILD_AFLAGS := -D__ASSEMBLY__ 407KBUILD_AFLAGS := -D__ASSEMBLY__
@@ -607,14 +607,16 @@ endif # $(dot-config)
607# Defaults to vmlinux, but the arch makefile usually adds further targets 607# Defaults to vmlinux, but the arch makefile usually adds further targets
608all: vmlinux 608all: vmlinux
609 609
610include $(srctree)/arch/$(SRCARCH)/Makefile
611
612KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,)
613
610ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE 614ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
611KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,) 615KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,)
612else 616else
613KBUILD_CFLAGS += -O2 617KBUILD_CFLAGS += -O2
614endif 618endif
615 619
616include $(srctree)/arch/$(SRCARCH)/Makefile
617
618ifdef CONFIG_READABLE_ASM 620ifdef CONFIG_READABLE_ASM
619# Disable optimizations that make assembler listings hard to read. 621# Disable optimizations that make assembler listings hard to read.
620# reorder blocks reorders the control in the function 622# reorder blocks reorders the control in the function