openblas/openblas-noexecstack.patch

29 lines
1.2 KiB
Diff

Index: OpenBLAS-0.2.13/exports/Makefile
===================================================================
--- OpenBLAS-0.2.13.orig/exports/Makefile
+++ OpenBLAS-0.2.13/exports/Makefile
@@ -118,6 +118,7 @@ else
endif
ifneq ($(C_COMPILER), LSB)
$(CC) $(CFLAGS) $(LDFLAGS) -shared -o ../$(LIBSONAME) \
+ -Wl,-z,noexecstack \
-Wl,--whole-archive $< -Wl,--no-whole-archive \
-Wl,-soname,$(LIBPREFIX).so.$(MAJOR_VERSION) $(EXTRALIB)
$(CC) $(CFLAGS) $(LDFLAGS) -w -o linktest linktest.c ../$(LIBSONAME) $(FEXTRALIB) && echo OK.
@@ -145,6 +146,7 @@ else
../$(LIBSONAME) : ../$(LIBNAME).renamed linktest.c
endif
$(CC) $(CFLAGS) $(LDFLAGS) -shared -o ../$(LIBSONAME) \
+ -Wl,-z,noexecstack \
-Wl,--whole-archive $< -Wl,--no-whole-archive \
$(FEXTRALIB) $(EXTRALIB)
$(CC) $(CFLAGS) $(LDFLAGS) -w -o linktest linktest.c ../$(LIBSONAME) $(FEXTRALIB) && echo OK.
@@ -164,6 +166,7 @@ ifeq ($(OSNAME), SunOS)
so : ../$(LIBSONAME)
$(CC) $(CFLAGS) $(LDFLAGS) -shared -o ../$(LIBSONAME) \
+ -Wl,-z,noexecstack \
-Wl,--whole-archive ../$(LIBNAME) -Wl,--no-whole-archive $(EXTRALIB)
$(CC) $(CFLAGS) $(LDFLAGS) -w -o linktest linktest.c ../$(LIBSONAME) $(FEXTRALIB) && echo OK.
rm -f linktest