Skip to content

Commit 0ad6682

Browse files
committed
fix(CI): always use ld64 for the linker on macOS because lld is not available in the CI machine
See also: https://searchfox.org/mozilla-central/rev/e741c34/build/moz.configure/toolchain.configure#1889
1 parent 8d6f9d1 commit 0ad6682

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

setup.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ echo "Done downloading spidermonkey source code"
4949

5050
echo "Building spidermonkey"
5151
cd firefox-source
52+
53+
# Apply patching
5254
# making it work for both GNU and BSD (macOS) versions of sed
5355
sed -i'' -e 's/os not in ("WINNT", "OSX", "Android")/os not in ("WINNT", "Android")/' ./build/moz.configure/pkg.configure # use pkg-config on macOS
5456
sed -i'' -e '/"WindowsDllMain.cpp"/d' ./mozglue/misc/moz.build # https://discourse.mozilla.org/t/105671, https://bugzilla.mozilla.org/show_bug.cgi?id=1751561
@@ -63,6 +65,8 @@ sed -i'' -e 's/return !IsIteratorHelpersEnabled()/return false/' ./js/src/vm/Glo
6365
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
6466
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`
6567
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
68+
sed -i'' -e 's/-fuse-ld=ld/-ld64/' ./build/moz.configure/toolchain.configure # the classic linker can be explicitly requested using the `-ld64` flag. See https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes#Linking
69+
6670
cd js/src
6771
mkdir -p _build
6872
cd _build
@@ -74,6 +78,7 @@ mkdir -p ../../../../_spidermonkey_install/
7478
--disable-debug-symbols \
7579
--disable-jemalloc \
7680
--disable-tests \
81+
$(if [[ "$OSTYPE" == "darwin"* ]]; then echo "--enable-linker=ld64"; fi) \
7782
--enable-optimize
7883
make -j$CPUS
7984
echo "Done building spidermonkey"

0 commit comments

Comments
 (0)