galileo: Override Ubuntu's default GCC flags to avoid link errors
Ubuntu enables GCC's stack protector by default (see https://wiki.ubuntu.com/Security/Features). This causes link errors like the following: ...undefined reference to `__stack_chk_fail' To avoid these errors, this patch adds the "-fno-stack-protector" flag to both the CFLAGS used by the Contiki build process and the CFLAGS used by the newlib build process.
This commit is contained in:
parent
13bbe8a5b5
commit
b79fcaa7d8
|
@ -8,7 +8,7 @@ CONTIKI_SOURCEFILES += contiki-main.c newlib-syscalls.c clock.c rtimer-arch.c
|
|||
CONTIKI_CPU=$(CONTIKI)/cpu/x86
|
||||
include $(CONTIKI)/cpu/x86/Makefile.x86_quarkX1000
|
||||
|
||||
CFLAGS += -m32 -march=i586 -nostdinc -isystem $(LIBC)/include -isystem $(LIBGCC_PATH)/include -isystem $(LIBGCC_PATH)/include-fixed
|
||||
CFLAGS += -m32 -march=i586 -fno-stack-protector -nostdinc -isystem $(LIBC)/include -isystem $(LIBGCC_PATH)/include -isystem $(LIBGCC_PATH)/include-fixed
|
||||
LDFLAGS += -m32 -nostdlib -T $(LINKERSCRIPT)
|
||||
ASFLAGS += --32 -march=i586 -mtune=i586
|
||||
|
||||
|
|
|
@ -57,8 +57,8 @@ build() {
|
|||
export COMPILER_AS_FOR_TARGET=as
|
||||
export COMPILER_LD_FOR_TARGET=ld
|
||||
export COMPILER_NM_FOR_TARGET=nm
|
||||
export CFLAGS_FOR_TARGET="-Os -m32 -march=i586 -mtune=i586 -DPREFER_SIZE_OVER_SPEED"
|
||||
export CXXFLAGS_FOR_TARGET="-Os -m32 -march=i586 -mtune=i586 -DPREFER_SIZE_OVER_SPEED"
|
||||
export CFLAGS_FOR_TARGET="-Os -m32 -march=i586 -mtune=i586 -fno-stack-protector -DPREFER_SIZE_OVER_SPEED"
|
||||
export CXXFLAGS_FOR_TARGET="-Os -m32 -march=i586 -mtune=i586 -fno-stack-protector -DPREFER_SIZE_OVER_SPEED"
|
||||
|
||||
mkdir -p install
|
||||
./configure --target=${TARGET} \
|
||||
|
|
Loading…
Reference in a new issue