]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
Conditionally add -fno-stack-protector to CFLAGS
authorHaavard Skinnemoen <hskinnemoen@atmel.com>
Mon, 19 May 2008 10:26:38 +0000 (12:26 +0200)
committerWolfgang Denk <wd@denx.de>
Thu, 26 Jun 2008 17:46:02 +0000 (19:46 +0200)
When compile-testing on powerpc, I get errors like this:

net/nfs.c:422: undefined reference to `__stack_chk_fail_local'

This seems to be because -fstack-protector is on by default, so
let's explicitly disable it on all architectures that support the
option.

The Ubuntu toolchain is affected by this problem, and according to
Mike Frysinger, Gentoo has been running with SSP enabled for years.
More and more distros are turning SSP on by default, so this problem
is likely to get worse in the future.

Also, powerpc just happens to be one of the arches I do
compile-testing on. There may be other arches affected by this too.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
config.mk

index b08b7a7593657a2e7f9f9f316924117df815934e..1dac29be57ba3f79d3eb94c126139c37d7b6679e 100644 (file)
--- a/config.mk
+++ b/config.mk
@@ -172,6 +172,8 @@ else
 CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes
 endif
 
+CFLAGS += $(call cc-option,-fno-stack-protector)
+
 # avoid trigraph warnings while parsing pci.h (produced by NIOS gcc-2.9)
 # this option have to be placed behind -Wall -- that's why it is here
 ifeq ($(ARCH),nios)