From ed2a9a9869da12974c8b02c782def5da65c554ab Mon Sep 17 00:00:00 2001 From: Joe Lauer Date: Fri, 27 Oct 2023 00:41:54 -0400 Subject: [PATCH] Makefile builds own CXX flags --- .blaze/blaze.java | 2 +- native/libhelloj/Makefile | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.blaze/blaze.java b/.blaze/blaze.java index 8ed0323..88b96d1 100644 --- a/.blaze/blaze.java +++ b/.blaze/blaze.java @@ -36,7 +36,7 @@ public void build_natives() throws Exception { exec("make").workingDir(targetJcatDir).run(); exec("make").workingDir(targetLibHelloJDir) - .env("CXXFLAGS", "-z noexecstack") + //.env("CXXFLAGS", "-z noexecstack") .run(); new Copy(Contexts.currentContext()) diff --git a/native/libhelloj/Makefile b/native/libhelloj/Makefile index 53a6dcf..22f0d72 100644 --- a/native/libhelloj/Makefile +++ b/native/libhelloj/Makefile @@ -9,12 +9,14 @@ JAVAC ?= javac JAVA ?= java SHAREDFILEEXT ?= so UNAME_S := $(shell uname -s) +EXTRA_CXXFLAGS := -z noexecstack ifeq ($(UNAME_S),Darwin) SHAREDFILEEXT = dylib + EXTRA_CXXFLAGS = endif all: - $(CXX) -shared -fPIC -Wall -pedantic -O3 $(CXXFLAGS) -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux -I${JAVA_HOME}/include/darwin -I${JAVA_HOME}/include/freebsd -I${JAVA_HOME}/include/openbsd -o libhelloj.$(SHAREDFILEEXT) -lc helloj_HelloLib.cpp + $(CXX) -shared -fPIC -Wall -pedantic -O3 $(CXXFLAGS) $(EXTRA_CXXFLAGS) -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux -I${JAVA_HOME}/include/darwin -I${JAVA_HOME}/include/freebsd -I${JAVA_HOME}/include/openbsd -o libhelloj.$(SHAREDFILEEXT) -lc helloj_HelloLib.cpp jniheaders: $(JAVAC) -h . helloj/HelloLib.java