Open Bug 1844694 Opened 2 years ago Updated 9 months ago

Configure fails with system clang on macOS with newer command line tools

Categories

(Firefox Build System :: General, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: haik, Unassigned)

References

Details

Attachments

(1 file)

Attached file ./mach configure

On macOS 14.0 beta (23A5286g) with Xcode 15 beta 4.

$ LD_PRINT_OPTIONS=1 clang -Wl,--version
ld: unknown options: --version 
clang: error: linker command failed with exit code 1 (use -v to see invocation)

./mach config output attached.

I guess from some of the other output you pasted on matrix that this is the new Apple linker, which would certainly explain things.

Can you paste the output from clang -Wl,--help?

Flags: needinfo?(haftandilian)
$ clang -Wl,--help   
ld: unknown options: --help 
clang: error: linker command failed with exit code 1 (use -v to see invocation)
$ clang -v -Wl,--help
Apple clang version 15.0.0 (clang-1500.0.34.3)
Target: arm64-apple-darwin23.0.0
Thread model: posix
InstalledDir: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
 "/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch arm64 -platform_version macos 14.0.0 14.0 -syslibroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -o a.out -L/usr/local/lib --help -lSystem /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/lib/darwin/libclang_rt.osx.a
ld: unknown options: --help 
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Flags: needinfo?(haftandilian)

The severity field is not set for this bug.
:ahochheiden, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(ahochheiden)
Severity: -- → S3
Flags: needinfo?(ahochheiden)
Priority: -- → P3
Duplicate of this bug: 1871153
Duplicate of this bug: 1875743

Hm. I have need to build ESR 115 on my Sonoma MBP, and I'm hitting this. Is there a workaround to get me going here?

Flags: needinfo?(mh+mozilla)

(In reply to Mike Conley (:mconley) (:⚙️) from comment #7)

Hm. I have need to build ESR 115 on my Sonoma MBP, and I'm hitting this. Is there a workaround to get me going here?

build with --enable-bootstrap

Flags: needinfo?(mh+mozilla)
Duplicate of this bug: 1895465

(In reply to Mike Hommey [:glandium] from comment #8)

build with --enable-bootstrap

This does not fix the issue.

Homebrew performs the following change to be able to build (as of latest ESR 128):

s.sub! '"-Wl,--version"', '"-Wl,-ld_classic,--version"' if DevelopmentTools.clang_build_version >= 1500

(https://github.com/Homebrew/homebrew-core/blob/2311fe0d7f057806114f8b0c59d128b44bf7691f/Formula/s/spidermonkey.rb#L69C41-L69C52)

Duplicate of this bug: 1964280

I'm unable to build ESR115 on macOS Sequoia, even with ./mach bootstrap.

 0:02.64 DEBUG: Executing: `/usr/bin/clang -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -mmacosx-version-min=11.0 -std=gnu99 --target=arm64-apple-darwin -Wl,--version`
 0:02.64 ERROR: Failed to find an adequate linker

With the patch from comment 11 (or editing -Wl,--version to -Wl,-v), it does not fail at the above step, but still fails shorty after:

 0:08.34 checking the wasm C compiler works... no
 0:08.34 DEBUG: Creating `/var/folders/wy/8fq43xc970x3wvgqhfqbvhgr0000gn/T/conftest.59q5nrs_.c` with content:
 0:08.34 DEBUG: | int
 0:08.34 DEBUG: | main(void)
 0:08.34 DEBUG: | {
 0:08.34 DEBUG: |
 0:08.34 DEBUG: |   ;
 0:08.34 DEBUG: |   return 0;
 0:08.34 DEBUG: | }
 0:08.34 DEBUG: Executing: `/usr/bin/clang -std=gnu99 --target=wasm32-wasi /var/folders/wy/8fq43xc970x3wvgqhfqbvhgr0000gn/T/conftest.59q5nrs_.c -c`
 0:08.34 DEBUG: The command returned non-zero exit status 1.
 0:08.34 DEBUG: Its error output was:
 0:08.34 DEBUG: | error: unable to create target: 'No available targets are compatible with triple "wasm32-unknown-wasi"'
 0:08.34 DEBUG: | 1 error generated.
 0:08.34 ERROR: Failed compiling a simple C source with the wasm C compiler
*** Fix above errors and then restart with "./mach build"

... fortunately, in my case I did not really have to create a compiled build. I looked up the most recent hg revision from https://hg-edge.mozilla.org/releases/mozilla-esr115

and build as follows:

MOZ_ARTIFACT_REVISION=8a77c6bc418640a11727e9ffa6da543bcd84a8bd ./mach build

(I had to manually set the revision because after the migration from hg to git, the artifact cannot be located from a git repo without cinnabar metadata )

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: