Re: 2.6.17-mm5 -- Busted toolchain? -- usr/klibc/exec_l.c:59: undefined reference to `__stack_chk_fail'

H. Peter Anvin
2006-07-01T23:36:27Z

[-- Attachment #1: Type: text/plain, Size: 316 bytes --]

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

[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 967 bytes --]

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)