From 27868701d84b08ac636a809090eaaa5c3d46cbad Mon Sep 17 00:00:00 2001 From: iain Date: Mon, 5 Aug 2019 17:07:20 +0100 Subject: [MacOS] Specify dlopen library paths (#8336) * [MacOS] Specify dlopen library paths With the hardened runtime, we now need to specify the paths of all libraries that are dlopened in the binary's rpath * Remove the spaces in the plist The plist parser doesn't appear to like , only --- main/build/MacOSX/Entitlements.plist | 6 +++--- main/build/MacOSX/Makefile.am | 8 ++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/main/build/MacOSX/Entitlements.plist b/main/build/MacOSX/Entitlements.plist index afa96be81f..1cc1a152c7 100644 --- a/main/build/MacOSX/Entitlements.plist +++ b/main/build/MacOSX/Entitlements.plist @@ -5,10 +5,10 @@ com.apple.security.cs.allow-jit com.apple.security.cs.allow-unsigned-executable-memory - + com.apple.security.cs.allow-dyld-environment-variables - + com.apple.security.cs.disable-library-validation - + diff --git a/main/build/MacOSX/Makefile.am b/main/build/MacOSX/Makefile.am index 681963df71..3c733b83b6 100644 --- a/main/build/MacOSX/Makefile.am +++ b/main/build/MacOSX/Makefile.am @@ -27,6 +27,10 @@ EXTRA_DIST = dmg-bg.png DS_Store Info.plist.in make-dmg-bundle.sh render.cs MONOSTUB_EXTRA_SOURCEFILES = monostub-utils.h export MACOSX_DEPLOYMENT_TARGET=10.12 +# With the hardened runtime, we need to specify the location of all libraries +# that we dlopen +MONOSTUB_RPATH=-Wl,-rpath,/Library/Frameworks/Mono.framework/Libraries/ -Wl,-rpath,@executable_path/../Resources/lib/monodevelop/bin/ + all: monostub monostub-nogui monostub-test render.exe: render.cs @@ -42,12 +46,12 @@ monostub-nogui.o: monostub.mm $(MONOSTUB_EXTRA_SOURCEFILES) g++ -g $(HYBRID_SUSPEND_ABORT) -DNOGUI -c -Wall -m$(MONOSTUB_ARCH) -o $@ monostub.mm monostub: monostub.o $(MONOSTUB_STATIC_LINK) - clang++ -g -Wall -m$(MONOSTUB_ARCH) -o $@ -Wl,-all_load $^ -framework AppKit -framework Quartz -undefined dynamic_lookup + clang++ -g -Wall -m$(MONOSTUB_ARCH) -o $@ -Wl,-all_load $^ -framework AppKit -framework Quartz -undefined dynamic_lookup $(MONOSTUB_RPATH) mkdir -p ../bin cp $@ ../bin/MonoDevelop monostub-nogui: monostub-nogui.o $(MONOSTUB_STATIC_LINK) - clang++ -g -Wall -m$(MONOSTUB_ARCH) -o $@ -Wl,-all_load $^ -framework AppKit -framework Quartz -undefined dynamic_lookup + clang++ -g -Wall -m$(MONOSTUB_ARCH) -o $@ -Wl,-all_load $^ -framework AppKit -framework Quartz -undefined dynamic_lookup $(MONOSTUB_RPATH) mkdir -p ../bin cp $@ ../bin/mdtool -- cgit v1.2.3