Closed Bug 1876855 Opened 4 months ago Closed 4 months ago

Local PGO build on arm64 macOS fails during proc-macro2 linking with ld64.lld: error: unknown argument '--symbol-ordering-file'

Categories

(Firefox Build System :: Toolchains, defect, P2)

defect

Tracking

(firefox-esr115 unaffected, firefox122 unaffected, firefox123+ wontfix, firefox124+ fixed)

RESOLVED FIXED
124 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox122 --- unaffected
firefox123 + wontfix
firefox124 + fixed

People

(Reporter: mstange, Assigned: sergesanspaille)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

I'm trying to make a PGO build on macOS (I'm on an M1 Max) with the following mozconfig:

ac_add_options --enable-bootstrap
ac_add_options --enable-perf
ac_add_options --enable-release
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../obj-m-pgo
mk_add_options AUTOCLOBBER=1
ac_add_options MOZ_PGO=1

export CFLAGS="--target=aarch64-apple-darwin"
export CXXFLAGS="--target=aarch64-apple-darwin"
export HOST_CFLAGS="--target=aarch64-apple-darwin"
export HOST_CXXFLAGS="--target=aarch64-apple-darwin"

ac_add_options --enable-crashreporter

It's failing after the profiling run:

 0:01.60 dom/bindings
 0:01.61 dom/cache
 0:02.36 dom/canvas
 0:04.00 dom/clients/api
 0:04.07 dom/clients/manager
 0:05.64    Compiling proc-macro2 v1.0.74
 0:05.93 error: linking with `/Users/mstange/code/mozilla/build/cargo-linker` failed: exit status: 1
 0:05.93   |
 0:05.96   = note: env -u IPHONEOS_DEPLOYMENT_TARGET -u TVOS_DEPLOYMENT_TARGET LC_ALL="C" PATH="/Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/bin:/Users/mstange/.mozbuild/clang/bin:/Users/mstange/.mozbuild/srcdirs/mozilla-7028958efdd5/_virtualenvs/build/bin:/Users/mstange/.mozbuild/srcdirs/mozilla-7028958efdd5/_virtualenvs/mach/bin:/opt/homebrew/opt/node@18/bin:/opt/homebrew/opt/openjdk/bin:/Users/mstange/.yarn/bin:/Users/mstange/.config/yarn/global/node_modules/.bin:/Users/mstange/code/emsdk:/Users/mstange/code/emsdk/upstream/emscripten:/Users/mstange/code/emsdk/node/15.14.0_64bit/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin:/usr/local/go/bin:/Users/mstange/.cargo/bin:/Users/mstange/code/depot_tools:/Users/mstange/Library/Python/3.11/bin:/Users/mstange/bin" VSLANG="1033" ZERO_AR_DATE="1" "/Users/mstange/code/mozilla/build/cargo-linker" "-arch" "arm64" "/var/folders/n0/ks1j6rkx4zg1q4kfd06cmt9r0000gn/T/rustcluYPBG/symbols.o" "/Users/mstange/code/obj-m-pgo-use/release/build/proc-macro2-60dc54fc58ad3aad/build_script_build-60dc54fc58ad3aad.build_script_build.f09267eddca7a2fc-cgu.0.rcgu.o" "/Users/mstange/code/obj-m-pgo-use/release/build/proc-macro2-60dc54fc58ad3aad/build_script_build-60dc54fc58ad3aad.build_script_build.f09267eddca7a2fc-cgu.1.rcgu.o" "/Users/mstange/code/obj-m-pgo-use/release/build/proc-macro2-60dc54fc58ad3aad/build_script_build-60dc54fc58ad3aad.3lvmhkglswxuqwz3.rcgu.o" "-L" "/Users/mstange/code/obj-m-pgo-use/release/deps" "-L" "/Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "/Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libstd-b0083070c892a1db.rlib" "/Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libpanic_unwind-8282820217d7b362.rlib" "/Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libobject-f163e9d1987a8318.rlib" "/Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libmemchr-350512940f04084a.rlib" "/Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libaddr2line-e19e4ea986b9addc.rlib" "/Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libgimli-363744fff3c4e7ba.rlib" "/Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_demangle-e1d006f163566466.rlib" "/Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libstd_detect-dea09910a3b22702.rlib" "/Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libhashbrown-4802352fcc77de56.rlib" "/Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_alloc-e71c86d9086176a7.rlib" "/Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libminiz_oxide-6d82e7a8c3f5e2c7.rlib" "/Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libadler-e66d24d044cc2029.rlib" "/Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libunwind-46eaa7bd445cb528.rlib" "/Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcfg_if-3c8a48285a1e7255.rlib" "/Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liblibc-50e20e60add24734.rlib" "/Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liballoc-edb678dd3e28691a.rlib" "/Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_core-3b6c10a2acaa607f.rlib" "/Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcore-2447397acf63b01e.rlib" "/Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcompiler_builtins-5816c590a0da89c2.rlib" "-lSystem" "-lc" "-lm" "-L" "/Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "-o" "/Users/mstange/code/obj-m-pgo-use/release/build/proc-macro2-60dc54fc58ad3aad/build_script_build-60dc54fc58ad3aad" "-Wl,-dead_strip" "-nodefaultlibs"
 0:05.96   = note: wrapping ld: ['/Users/mstange/.mozbuild/clang/bin/clang', '-isysroot', '/Users/mstange/.mozbuild/MacOSX14.2.sdk', '-mmacosx-version-min=11.0', '-std=gnu99', '-v']
 0:06.03           clang version 17.0.6 (taskcluster-NxVo4ANBSKadRWDWXhxYKg)
 0:06.03           Target: arm64-apple-darwin23.1.0
 0:06.03           Thread model: posix
 0:06.03           InstalledDir: /Users/mstange/.mozbuild/clang/bin
 0:06.05            "/Users/mstange/.mozbuild/clang/bin/ld64.lld" -demangle -dynamic -arch arm64 -platform_version macos 11.0.0 14.2 -syslibroot /Users/mstange/.mozbuild/MacOSX14.2.sdk -o /Users/mstange/code/obj-m-pgo-use/release/build/proc-macro2-60dc54fc58ad3aad/build_script_build-60dc54fc58ad3aad -L/Users/mstange/code/obj-m-pgo-use/release/deps -L/Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib -L/Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib -mllvm -import-instr-limit=10 -mllvm -import-hot-multiplier=30 -dead_strip --symbol-ordering-file /Users/mstange/code/obj-m-pgo-use/orderfile.txt --no-warn-symbol-ordering -object_path_lto .lto.o/ /var/folders/n0/ks1j6rkx4zg1q4kfd06cmt9r0000gn/T/rustcluYPBG/symbols.o /Users/mstange/code/obj-m-pgo-use/release/build/proc-macro2-60dc54fc58ad3aad/build_script_build-60dc54fc58ad3aad.build_script_build.f09267eddca7a2fc-cgu.0.rcgu.o /Users/mstange/code/obj-m-pgo-use/release/build/proc-macro2-60dc54fc58ad3aad/build_script_build-60dc54fc58ad3aad.build_script_build.f09267eddca7a2fc-cgu.1.rcgu.o /Users/mstange/code/obj-m-pgo-use/release/build/proc-macro2-60dc54fc58ad3aad/build_script_build-60dc54fc58ad3aad.3lvmhkglswxuqwz3.rcgu.o /Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libstd-b0083070c892a1db.rlib /Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libpanic_unwind-8282820217d7b362.rlib /Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libobject-f163e9d1987a8318.rlib /Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libmemchr-350512940f04084a.rlib /Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libaddr2line-e19e4ea986b9addc.rlib /Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libgimli-363744fff3c4e7ba.rlib /Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_demangle-e1d006f163566466.rlib /Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libstd_detect-dea09910a3b22702.rlib /Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libhashbrown-4802352fcc77de56.rlib /Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_alloc-e71c86d9086176a7.rlib /Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libminiz_oxide-6d82e7a8c3f5e2c7.rlib /Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libadler-e66d24d044cc2029.rlib /Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libunwind-46eaa7bd445cb528.rlib /Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcfg_if-3c8a48285a1e7255.rlib /Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liblibc-50e20e60add24734.rlib /Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liballoc-edb678dd3e28691a.rlib /Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_core-3b6c10a2acaa607f.rlib /Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcore-2447397acf63b01e.rlib /Users/mstange/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcompiler_builtins-5816c590a0da89c2.rlib -lSystem -lc -lm -dead_strip
 0:06.05           ld64.lld: error: unknown argument '--symbol-ordering-file'
 0:06.05           ld64.lld: error: unknown argument '--no-warn-symbol-ordering'
 0:06.05           clang: error: linker command failed with exit code 1 (use -v to see invocation)
 0:06.05           
 0:06.05 error: could not compile `proc-macro2` (build script) due to previous error
 0:06.19 make[4]: *** [force-cargo-library-build] Error 101
 0:06.19 make[3]: *** [toolkit/library/rust/target-objects] Error 2

(I've lightly edited build/cargo-linker to add -v and to dump out wrap_ld.)

The Bugbug bot thinks this bug should belong to the 'Firefox Build System::Toolchains' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: General → Toolchains
Keywords: regression
Regressed by: 1839832

Set release status flags based on info from the regressing bug 1839832

:sergesanspaille, since you are the author of the regressor, bug 1839832, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

Indeed symbol ordering vile is only supported starting version 18 of lld. I'll add a check for that

Flags: needinfo?(sguelton)
Assignee: nobody → sguelton
Status: NEW → ASSIGNED
See Also: → 1876930
Attachment #9376823 - Attachment description: Bug 1876855 - take into account lld version when using --symbol-ordering-file r=glandium → Bug 1876855 - take into account lld wcapabilities when using --symbol-ordering-file r=glandium

Serge, when you get a chance, can you please add Priority/Severity ratings to this report?

Flags: needinfo?(sguelton)
Severity: -- → S2
Flags: needinfo?(sguelton)
Priority: -- → P2
Attachment #9376823 - Attachment description: Bug 1876855 - take into account lld wcapabilities when using --symbol-ordering-file r=glandium → Bug 1876855 - take into account lld wcapabilities when using --symbol-ordering-file r=glandium!
Attachment #9376823 - Attachment description: Bug 1876855 - take into account lld wcapabilities when using --symbol-ordering-file r=glandium! → Bug 1876855 - Disable --symbol-ordering-file on OSX r=glandium
Attachment #9376823 - Attachment description: Bug 1876855 - Disable --symbol-ordering-file on OSX r=glandium → Bug 1876855 - Disable --symbol-ordering-file on OSX r=glandium!
Pushed by sguelton@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1b5bd5455343
Disable --symbol-ordering-file on OSX r=glandium
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 124 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: