[gs-commits] mupdf 1.16.1.29 java: Only use -z noexecstack on platform

[email protected] (Sebastian Rasmussen)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
commit fcdd515c83579c0d3cc0d2965d4bec9aa0de79b8
Author: Fred Ross-Perry <[email protected]>
Date:   Thu Sep 5 10:30:20 2019 -0700

    java: Only use -z noexecstack on platforms other than macOS.

diff --git a/platform/java/Makefile b/platform/java/Makefile
index 45e7b65..26d7c27 100644
--- a/platform/java/Makefile
+++ b/platform/java/Makefile
@@ -8,6 +8,8 @@ MUPDF_JAVA := libmupdf_java64.jnilib
 JAVA_CFLAGS := \
 	-I /Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/include \
 	-I /Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/include/darwin
+JAVA_LDFLAGS :=
+
 else
 
 BITS := $(shell getconf LONG_BIT)
@@ -24,6 +26,8 @@ JAVA_LIBS := \
 	$(shell pkg-config --libs freetype2) \
 	$(shell pkg-config --libs libcrypto) \
 	-lz
+JAVA_LDFLAGS := \
+	-z noexecstack
 endif
 
 default: $(MUPDF_JAVA) libmupdf.jar
@@ -65,7 +69,7 @@ mupdf_native.o : mupdf_native.c mupdf_native.h $(MUPDF_CORE)
 		$(JAVA_CFLAGS)
 
 $(MUPDF_JAVA) : mupdf_native.o $(MUPDF_CORE)
-	$(CC) -shared -z noexecstack -o $(MUPDF_JAVA) $^ $(JAVA_LIBS)
+	$(CC) -shared $(JAVA_LDFLAGS) -o $(MUPDF_JAVA) $^ $(JAVA_LIBS)
 
 run: $(MUPDF_JAVA) $(EXAMPLE_JAVA_OBJECTS)
 	LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:. $(JAVA) -classpath .:src example.Viewer

http://git.ghostscript.com/?p=mupdf.git;a=commit;h=fcdd515c83579c0d3cc0d2965d4bec9aa0de79b8

--
MuPDF library
Artifex Software, Inc.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.