aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/Makefile
diff options
context:
space:
mode:
authorPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>2006-05-01 15:16:04 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-05-01 21:17:45 -0400
commit275e6e1ee2bafde77e9390b27e876fa83f24cb60 (patch)
treefca0c0a7e3bdabe82bc75a0dad5c765f3b6edaf0 /arch/um/Makefile
parentcb8aa3d29b562e4c16fdfa4ecc8170ddc55397f4 (diff)
[PATCH] uml: fix compilation and execution with hardened GCC
To make some half-assembly stubs compile, disable various "hardened" GCC features: *) we can't make it build PIC code as we need %ebx to do syscalls and GCC wants it free for PIC *) we can't leave stack protection as the stub is moved (not relocated!) in memory so the RIP-relative access to the canary tries reading from an unmapped address and causes a segfault, since we move the stub of various megabytes (the exact amount will be decided at runtime) away from the link-time address. Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Acked-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/Makefile')
-rw-r--r--arch/um/Makefile6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/um/Makefile b/arch/um/Makefile
index 930e00612a22..bed604af6c6f 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -118,6 +118,10 @@ prepare: $(ARCH_DIR)/include/kern_constants.h
118LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static 118LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static
119LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib 119LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib
120 120
121CFLAGS_NO_HARDENING := $(call cc-option, -fno-PIC,) $(call cc-option, -fno-pic,) \
122 $(call cc-option, -fno-stack-protector,) \
123 $(call cc-option, -fno-stack-protector-all,)
124
121CPP_MODE-$(CONFIG_MODE_TT) := -DMODE_TT 125CPP_MODE-$(CONFIG_MODE_TT) := -DMODE_TT
122CONFIG_KERNEL_STACK_ORDER ?= 2 126CONFIG_KERNEL_STACK_ORDER ?= 2
123STACK_SIZE := $(shell echo $$[ 4096 * (1 << $(CONFIG_KERNEL_STACK_ORDER)) ] ) 127STACK_SIZE := $(shell echo $$[ 4096 * (1 << $(CONFIG_KERNEL_STACK_ORDER)) ] )
@@ -227,4 +231,4 @@ $(ARCH_DIR)/include/kern_constants.h: $(objtree)/$(ARCH_DIR)/include
227 @echo ' SYMLINK $@' 231 @echo ' SYMLINK $@'
228 $(Q)ln -sf ../../../include/asm-um/asm-offsets.h $@ 232 $(Q)ln -sf ../../../include/asm-um/asm-offsets.h $@
229 233
230export SUBARCH USER_CFLAGS OS 234export SUBARCH USER_CFLAGS CFLAGS_NO_HARDENING OS