@@ -28,8 +28,15 @@ elif [[ "$OSTYPE" == "darwin"* ]]; then # macOS
2828 # `llvm`/`lld` have no bottles for Intel macOS or macOS 14 and build from
2929 # source for hours (and lld pulls in the unversioned llvm). Both kegs are
3030 # keg-only, so put them on PATH explicitly.
31- brew install llvm@19 lld@19
32- export PATH=" $( brew --prefix llvm@19) /bin:$( brew --prefix lld@19) /bin:$PATH "
31+ if [[ " $( uname -m) " == " x86_64" ]]; then
32+ # Homebrew no longer ships llvm@19/lld@19 bottles for Intel macOS and would
33+ # build LLVM from source (which fails), so use the clang toolchain that
34+ # Mozilla's own bootstrap downloads once the source is extracted (below).
35+ echo " Intel macOS: will use Mozilla's bootstrapped clang"
36+ else
37+ brew install llvm@19 lld@19
38+ export PATH=" $( brew --prefix llvm@19) /bin:$( brew --prefix lld@19) /bin:$PATH "
39+ fi
3340elif [[ " $OSTYPE " == " msys" * || " $OSTYPE " == " cygwin" * ]]; then # Windows
3441 echo " Dependencies are not going to be installed automatically on Windows."
3542else
@@ -87,6 +94,12 @@ echo "Done downloading spidermonkey source code"
8794echo " Building spidermonkey"
8895cd firefox-source
8996
97+ if [[ " $OSTYPE " == " darwin" * && " $( uname -m) " == " x86_64" ]]; then
98+ # Fetch Mozilla's prebuilt clang (>= 19) for Intel macOS, see above
99+ python3 ./mach --no-interactive bootstrap --application-choice=js --no-system-changes
100+ export PATH=" $HOME /.mozbuild/clang/bin:$PATH "
101+ fi
102+
90103# Apply patching
91104# making it work for both GNU and BSD (macOS) versions of sed
92105sed -i' ' -e ' s/os not in ("WINNT", "OSX", "Android")/os not in ("WINNT", "Android")/' ./build/moz.configure/pkg.configure # use pkg-config on macOS
0 commit comments