Skip to content

Commit bef5b54

Browse files
ralfbaechletorvalds
authored andcommitted
Fix MIPS cross-compile problem
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 error: $ 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 e06b8b9 in 2.6.25; 35bb5b1 did add more flags testing before the arch Makefile inclusion. Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent d25dc7f commit bef5b54

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,8 @@ else
508508
KBUILD_CFLAGS += -O2
509509
endif
510510

511+
include $(srctree)/arch/$(SRCARCH)/Makefile
512+
511513
ifneq (CONFIG_FRAME_WARN,0)
512514
KBUILD_CFLAGS += $(call cc-option,-Wframe-larger-than=${CONFIG_FRAME_WARN})
513515
endif
@@ -516,8 +518,6 @@ endif
516518
# Arch Makefiles may override this setting
517519
KBUILD_CFLAGS += $(call cc-option, -fno-stack-protector)
518520

519-
include $(srctree)/arch/$(SRCARCH)/Makefile
520-
521521
ifdef CONFIG_FRAME_POINTER
522522
KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
523523
else

0 commit comments

Comments
 (0)