Re: MIPS toolchain

From: Ralf Baechle
Date: Wed Jul 16 2008 - 08:03:18 EST

Crosscompiling on a Fedora 9 machine running gcc 4.3.0 as its host compiler
and gcc 3.4.6 for the mips-linux target results in the following build

$ make malta_defconfig
$ make
cc1: error: unrecognized command line option "-fno-stack-protector"
scripts/kconfig/conf -s arch/mips/Kconfig
cc1: error: unrecognized command line option "-fno-stack-protector"

The arch Makefile is included too late so the host compiler is feature
tested, not the crosscompiler as intended and thus the Makefile applies
adds -fno-stack-protector to crosscompiler's flags which fails for gcc
3.4.6. The bug was introduced by e06b8b98da071f7dd78fb7822991694288047df0
in 2.6.25; 35bb5b1e0e84cfa1a8906f7e6a77f391ff315791 did add more flags
testing before the arch Makefile inclusion.

Signed-off-by: Ralf Baechle <ralf@xxxxxxxxxxxxxx>

diff --git a/Makefile b/Makefile
index bfde079..312fcaa 100644
--- a/Makefile
+++ b/Makefile
@@ -509,6 +509,8 @@ else

+include $(srctree)/arch/$(SRCARCH)/Makefile
KBUILD_CFLAGS += $(call cc-option,-Wframe-larger-than=${CONFIG_FRAME_WARN})
@@ -517,8 +519,6 @@ endif
# Arch Makefiles may override this setting
KBUILD_CFLAGS += $(call cc-option, -fno-stack-protector)

-include $(srctree)/arch/$(SRCARCH)/Makefile
KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at