diff --git a/arch/um/kernel/skas/Makefile b/arch/um/kernel/skas/Makefile index c098d087c3f2..2cf82eba52f8 100644 --- a/arch/um/kernel/skas/Makefile +++ b/arch/um/kernel/skas/Makefile @@ -44,8 +44,14 @@ targets += stub_exe.dbg stub_exe $(stub_exe_objs-y) CFLAGS_stub.o := $(CFLAGS_NO_HARDENING) CFLAGS_stub_exe.o := $(CFLAGS_NO_HARDENING) -# Clang will call memset() from __builtin_alloca() when stack variable -# initialization is enabled, which is used in stub_exe.c. +# stub_signal_restorer() must not touch stack pointer, clang doesn't +# always omit the frame pointer automatically +CFLAGS_stub.o += -fomit-frame-pointer +CFLAGS_stub_exe.o += -fomit-frame-pointer + +# Clang's stack var initialisation can use memset() or similar and that +# cannot be done for this code since we embed/move the stub +CFLAGS_stub.o += $(call cc-option, -ftrivial-auto-var-init=uninitialized) CFLAGS_stub_exe.o += $(call cc-option, -ftrivial-auto-var-init=uninitialized) UNPROFILE_OBJS := stub.o stub_exe.o diff --git a/arch/x86/um/Makefile b/arch/x86/um/Makefile index f9ea75bf43ac..100b68f601f9 100644 --- a/arch/x86/um/Makefile +++ b/arch/x86/um/Makefile @@ -47,4 +47,7 @@ include/generated/user_constants.h: $(obj)/user-offsets.s FORCE UNPROFILE_OBJS := stub_segv.o CFLAGS_stub_segv.o := $(CFLAGS_NO_HARDENING) +# see arch/um/kernel/skas/Makefile - this goes into the stub +CFLAGS_stub_segv.o += $(call cc-option, -ftrivial-auto-var-init=uninitialized) + include $(srctree)/arch/um/scripts/Makefile.rules