Skip to content

Commit 8eade68

Browse files
committed
fixup: set the install_name field of libmozjs dylib to use the RPATH instead of an absolute path
1 parent 9878b9f commit 8eade68

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

setup.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ sed -i'' -e 's/return JS::GetWeakRefsEnabled() == JS::WeakRefSpecifier::Disabled
6565
sed -i'' -e 's/return !IsIteratorHelpersEnabled()/return false/' ./js/src/vm/GlobalObject.cpp # forcibly enable iterator helpers
6666
sed -i'' -e '/MOZ_CRASH_UNSAFE_PRINTF/,/__PRETTY_FUNCTION__);/d' ./mfbt/LinkedList.h # would crash in Debug Build: in `~LinkedList()` it should have removed all this list's elements before the list's destruction
6767
sed -i'' -e '/MOZ_ASSERT(stackRootPtr == nullptr);/d' ./js/src/vm/JSContext.cpp # would assert false in Debug Build since we extensively use `new JS::Rooted`
68-
sed -i'' -e 's|-id $(abspath $(libdir)|-id $(abspath @rpath|' ./js/src/build/Makefile.in # Set the `install_name` field of libmozjs dylib to use the RPATH instead of an absolute path
6968
sed -i'' -e 's/"-fuse-ld=ld"/"-ld64" if c_compiler.version > "14.0.0" else "-fuse-ld=ld"/' ./build/moz.configure/toolchain.configure # XCode 15 changed the linker behaviour. See https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes#Linking
7069

7170
cd js/src
@@ -87,6 +86,12 @@ echo "Done building spidermonkey"
8786
echo "Installing spidermonkey"
8887
# install to ../../../../_spidermonkey_install/
8988
make install
89+
if [[ "$OSTYPE" == "darwin"* ]]; then # macOS
90+
cd ../../../../_spidermonkey_install/lib/
91+
# Set the `install_name` field to use RPATH instead of an absolute path
92+
# overrides https://hg.mozilla.org/releases/mozilla-esr102/file/89d799cb/js/src/build/Makefile.in#l83
93+
install_name_tool -id @rpath/$(basename ./libmozjs*) ./libmozjs* # making it work for whatever name the libmozjs dylib is called
94+
fi
9095
echo "Done installing spidermonkey"
9196

9297
# if this is being ran in the root directory of the PythonMonkey repo, then include dev configurations

0 commit comments

Comments
 (0)