@@ -733,6 +733,12 @@ else
DOMULTI:=n
endif
+ifeq ($(UCLIBC_BUILD_NOEXECSTACK),y)
+# Ensure that NX is applied to _all_ .so files generated
+# $(eval $(call check-ld-var,-z$(comma)noexecstack)) # <-- doesnt work: the part after -z gets stripped in check_ld
+LDFLAGS += -Wl,-z,noexecstack
+endif
+
ifneq ($(strip $(UCLIBC_EXTRA_LDFLAGS)),"")
LDFLAGS += $(call qstrip,$(UCLIBC_EXTRA_LDFLAGS))
endif
@@ -24,7 +24,11 @@ CFLAGS-libpthread/linuxthreads/sysdeps/pthread/ := $(CFLAGS-linuxthreads
ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
LDFLAGS-libpthread.so := $(LDFLAGS_NOSTRIP) -Wl,-z,defs
+ifeq ($(UCLIBC_BUILD_NOEXECSTACK),y)
+LDFLAGS-libpthread.so += -Wl,-z,noexecstack
+endif
else
+# This will already have noexecstack if required
LDFLAGS-libpthread.so := $(LDFLAGS)
endif
Signed-off-by: Andrew McDonnell <bugs@andrewmcdonnell.net> --- Rules.mak | 6 ++++++ libpthread/linuxthreads/Makefile.in | 4 ++++ 2 files changed, 10 insertions(+)