Re: 2.6.17-mm5 -- Busted toolchain? -- usr/klibc/exec_l.c:59: undefinedreference to `__stack_chk_fail'
From: H. Peter Anvin
Date: Sat Jul 01 2006 - 19:34:53 EST
Sam Ravnborg wrote:
For klibc you need to patch scripts/Kbuild.klibc
Appending it to KLIBCWARNFLAGS seems the right place.
Do you know from what gcc version we can start using -fno-stack-protector?
Here is a patch for klibc. Miles, could you try it out and see if it
does what you need?
-hpa
diff --git a/scripts/Kbuild.klibc b/scripts/Kbuild.klibc
index ac0439e..d30ada2 100644
--- a/scripts/Kbuild.klibc
+++ b/scripts/Kbuild.klibc
@@ -48,7 +48,7 @@ include $(srctree)/scripts/Kbuild.includ
# Defines used when compiling early userspace (klibc programs)
# ---------------------------------------------------------------------------
-KLIBCREQFLAGS :=
+KLIBCREQFLAGS := $(call cc_option, -fno-stack-protector, )
KLIBCARCHREQFLAGS :=
KLIBCOPTFLAGS :=
KLIBCWARNFLAGS := -W -Wall -Wno-sign-compare -Wno-unused-parameter
diff --git a/usr/klibc/arch/arm/MCONFIG b/usr/klibc/arch/arm/MCONFIG
index 0023eee..fa3ada2 100644
--- a/usr/klibc/arch/arm/MCONFIG
+++ b/usr/klibc/arch/arm/MCONFIG
@@ -12,7 +12,7 @@ CPU_TUNE := strongarm
KLIBCOPTFLAGS = -Os -march=$(CPU_ARCH) -mtune=$(CPU_TUNE)
KLIBCBITSIZE = 32
-KLIBCREQFLAGS = -fno-exceptions
+KLIBCREQFLAGS += -fno-exceptions
KLIBCSTRIPFLAGS += -R .ARM.exidx
ifeq ($(CONFIG_KLIBC_THUMB),y)