diff options
Diffstat (limited to 'arch/um')
-rw-r--r-- | arch/um/Makefile | 6 | ||||
-rw-r--r-- | arch/um/kernel/skas/Makefile | 9 | ||||
-rw-r--r-- | arch/um/sys-i386/Makefile | 2 | ||||
-rw-r--r-- | arch/um/sys-x86_64/Makefile | 2 |
4 files changed, 17 insertions, 2 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 | |||
118 | LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static | 118 | LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static |
119 | LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib | 119 | LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib |
120 | 120 | ||
121 | CFLAGS_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 | |||
121 | CPP_MODE-$(CONFIG_MODE_TT) := -DMODE_TT | 125 | CPP_MODE-$(CONFIG_MODE_TT) := -DMODE_TT |
122 | CONFIG_KERNEL_STACK_ORDER ?= 2 | 126 | CONFIG_KERNEL_STACK_ORDER ?= 2 |
123 | STACK_SIZE := $(shell echo $$[ 4096 * (1 << $(CONFIG_KERNEL_STACK_ORDER)) ] ) | 127 | STACK_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 | ||
230 | export SUBARCH USER_CFLAGS OS | 234 | export SUBARCH USER_CFLAGS CFLAGS_NO_HARDENING OS |
diff --git a/arch/um/kernel/skas/Makefile b/arch/um/kernel/skas/Makefile index 57181a920d48..ad842964707a 100644 --- a/arch/um/kernel/skas/Makefile +++ b/arch/um/kernel/skas/Makefile | |||
@@ -11,4 +11,11 @@ USER_OBJS := clone.o | |||
11 | include arch/um/scripts/Makefile.rules | 11 | include arch/um/scripts/Makefile.rules |
12 | 12 | ||
13 | # clone.o is in the stub, so it can't be built with profiling | 13 | # clone.o is in the stub, so it can't be built with profiling |
14 | $(obj)/clone.o : c_flags = -Wp,-MD,$(depfile) $(call unprofile,$(USER_CFLAGS)) | 14 | # GCC hardened also auto-enables -fpic, but we need %ebx so it can't work -> |
15 | # disable it | ||
16 | |||
17 | CFLAGS_clone.o := $(CFLAGS_NO_HARDENING) | ||
18 | |||
19 | # since we're setting c_flags we _must_ add $(CFLAGS_$(*F).o). | ||
20 | |||
21 | $(obj)/clone.o : c_flags = -Wp,-MD,$(depfile) $(call unprofile,$(USER_CFLAGS)) $(CFLAGS_$(*F).o) | ||
diff --git a/arch/um/sys-i386/Makefile b/arch/um/sys-i386/Makefile index 82121ab03bb0..3734c3eb15a4 100644 --- a/arch/um/sys-i386/Makefile +++ b/arch/um/sys-i386/Makefile | |||
@@ -13,6 +13,8 @@ USER_OBJS := bugs.o ptrace_user.o sigcontext.o fault.o stub_segv.o | |||
13 | USER_OBJS += user-offsets.s | 13 | USER_OBJS += user-offsets.s |
14 | extra-y += user-offsets.s | 14 | extra-y += user-offsets.s |
15 | 15 | ||
16 | CFLAGS_stub_segv.o := $(CFLAGS_NO_HARDENING) | ||
17 | |||
16 | extra-$(CONFIG_MODE_TT) += unmap.o | 18 | extra-$(CONFIG_MODE_TT) += unmap.o |
17 | 19 | ||
18 | include arch/um/scripts/Makefile.rules | 20 | include arch/um/scripts/Makefile.rules |
diff --git a/arch/um/sys-x86_64/Makefile b/arch/um/sys-x86_64/Makefile index f739bea35195..6d3b29c74533 100644 --- a/arch/um/sys-x86_64/Makefile +++ b/arch/um/sys-x86_64/Makefile | |||
@@ -21,6 +21,8 @@ USER_OBJS := ptrace_user.o sigcontext.o stub_segv.o | |||
21 | USER_OBJS += user-offsets.s | 21 | USER_OBJS += user-offsets.s |
22 | extra-y += user-offsets.s | 22 | extra-y += user-offsets.s |
23 | 23 | ||
24 | CFLAGS_stub_segv.o := $(CFLAGS_NO_HARDENING) | ||
25 | |||
24 | extra-$(CONFIG_MODE_TT) += unmap.o | 26 | extra-$(CONFIG_MODE_TT) += unmap.o |
25 | 27 | ||
26 | include arch/um/scripts/Makefile.rules | 28 | include arch/um/scripts/Makefile.rules |