Skip to content
Snippets Groups Projects
Commit 28eab0d7 authored by Haavard Skinnemoen's avatar Haavard Skinnemoen Committed by Wolfgang Denk
Browse files

Conditionally add -fno-stack-protector to CFLAGS


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: default avatarHaavard Skinnemoen <hskinnemoen@atmel.com>
parent dfd3be88
No related branches found
No related tags found
No related merge requests found
...@@ -172,6 +172,8 @@ else ...@@ -172,6 +172,8 @@ else
CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes
endif endif
CFLAGS += $(call cc-option,-fno-stack-protector)
# avoid trigraph warnings while parsing pci.h (produced by NIOS gcc-2.9) # 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 # this option have to be placed behind -Wall -- that's why it is here
ifeq ($(ARCH),nios) ifeq ($(ARCH),nios)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment