Closed Bug 1847697 Opened 10 months ago Closed 9 months ago

Build failure with mold linker: DT_RELR without GLIBC_ABI_DT_RELR dependency

Categories

(Firefox Build System :: General, defect)

Firefox 116
defect

Tracking

(firefox-esr102 unaffected, firefox-esr115 unaffected, firefox116 wontfix, firefox117 fixed, firefox118 fixed)

RESOLVED FIXED
118 Branch
Tracking Status
firefox-esr102 --- unaffected
firefox-esr115 --- unaffected
firefox116 --- wontfix
firefox117 --- fixed
firefox118 --- fixed

People

(Reporter: amit.prakash.ambasta, Assigned: glandium)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/116.0

Steps to reproduce:

  1. Configure mozbuild to use mold ac_add_options --enable-linker=mold
  2. Build firefox ./mach build -j1

Actual results:

Build failure with
2:03.77 error: failed to run custom build command for proc-macro2 v1.0.59
2:03.77 note: To improve backtraces for build dependencies, set the CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation.
2:03.77 Caused by:
2:03.77 process didn't exit successfully: /home/firefox/firefox_build/release/build/proc-macro2-5215be08b7af038e/build-script-build (exit status: 127)
2:03.77 --- stderr
2:03.77 /home/firefox/firefox_build/release/build/proc-macro2-5215be08b7af038e/build-script-build: error while loading shared libraries: /home/firefox/firefox_build/release/build/proc-macro2-5215be08b7af038e/build-script-build: DT_RELR without GLIBC_ABI_DT_RELR dependency

Expected results:

Build should succeed.

Attached file .mozconfig

Added mozconfig used to build firefox

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

Component: Untriaged → General
Product: Firefox → Firefox Build System

I am facing the same issue on Arch linux when building either librewolf or firedragon from source. It appears to be a regression, as the 115 version still builds successfully. My error log (trying to compile firewolf 116):

error: failed to run custom build command for proc-macro2 v1.0.59
0:42.35 note: To improve backtraces for build dependencies, set the CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation.
0:42.35 Caused by:
0:42.35 process didn't exit successfully: /compile/makepkg/firedragon/src/firefox-116.0.1/obj/release/build/proc-macro2-c90cdd8afb47e91e/build-script-build (exit status: 127)
0:42.35 --- stderr
0:42.35 /compile/makepkg/firedragon/src/firefox-116.0.1/obj/release/build/proc-macro2-c90cdd8afb47e91e/build-script-build: error while loading shared libraries: /compile/makepkg/firedragon/src/firefox-116.0.1/obj/release/build/proc-macro2-c90cdd8afb47e91e/build-script-build: DT_RELR without GLIBC_ABI_DT_RELR dependency
0:42.58 make[4]: *** [/compile/makepkg/firedragon/src/firefox-116.0.1/config/makefiles/rust.mk:434: force-cargo-library-build] Error 101
0:42.58 make[3]: *** [/compile/makepkg/firedragon/src/firefox-116.0.1/config/recurse.mk:72: toolkit/library/rust/target] Error 2
0:42.58 make[3]: *** Waiting for unfinished jobs....

This is a bug in mold. https://github.com/rui314/mold/issues/653#issuecomment-1670274638

We'll have to work around it... in the meantime, please use another linker.

Keywords: regression
Regressed by: 1839743
Assignee: nobody → mh+mozilla
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

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

This issue appears to have been fixed by mold with commit f467ad1add2ab6e381e0e458f026df197e63d487: https://github.com/rui314/mold/commit/f467ad1add2ab6e381e0e458f026df197e63d487
Librewolf 116 now compiles successfully with the AUR-package mold-git (only relevant for archlinux users).

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

This is a bug in mold. https://github.com/rui314/mold/issues/653#issuecomment-1670274638

We'll have to work around it... in the meantime, please use another linker.

Would a workaround still be required if it is already fixed in the linker?

Would a workaround still be required if it is already fixed in the linker?

Already released versions of the linker are not fixed. There's also no version containing the fix currently.

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

Would a workaround still be required if it is already fixed in the linker?

Already released versions of the linker are not fixed. There's also no version containing the fix currently.

You are correct, I am not quite sure when the next release for mold will be. It might still be useful to find a workaround.

Also, it looks like I might've spoken too soon. The first build succeeded, but the second (PGO) build failed. I will retry tomorrow to check whether or not this is a one-off issue.

Small update: it appears only PGO builds fail when using mold-git. The new error message:

24:40.58 mold: fatal: /tmp/lto-llvm-a1d87e.o: REL-type relocation table is not supported for this target
24:40.60 clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
24:40.61 make[4]: *** [/home/maxy/.cache/paru/clone/librewolf/src/librewolf-116.0.2-1/config/rules.mk:532: libmozsqlite3.so] Error 1
24:40.61 make[3]: *** [/home/maxy/.cache/paru/clone/librewolf/src/librewolf-116.0.2-1/config/recurse.mk:72: config/external/sqlite/target] Error 2

I am not quite sure if this is an issue with mold or firefox, so I have made a bug report on their github page too: https://github.com/rui314/mold/issues/1085.

Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/721a5102bc50
Don't use -z,pack-relative-relocs when it would lead to a ld.so error. r=firefox-build-system-reviewers,ahochheiden
Status: ASSIGNED → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → 118 Branch

The patch landed in nightly and beta is affected.
:glandium, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox117 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(mh+mozilla)

Comment on attachment 9348012 [details]
Bug 1847697 - Don't use -z,pack-relative-relocs when it would lead to a ld.so error.

Beta/Release Uplift Approval Request

  • User impact if declined: Startup failure in some build configurations
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): NPOTB
  • String changes made/needed: N/A
  • Is Android affected?: No
Flags: needinfo?(mh+mozilla)
Attachment #9348012 - Flags: approval-mozilla-beta?

Comment on attachment 9348012 [details]
Bug 1847697 - Don't use -z,pack-relative-relocs when it would lead to a ld.so error.

Approved for 117.0b8.

Attachment #9348012 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Regressions: 1851089

(In reply to maxy.visser from comment #10)

Small update: it appears only PGO builds fail when using mold-git. The new error message:

24:40.58 mold: fatal: /tmp/lto-llvm-a1d87e.o: REL-type relocation table is not supported for this target
24:40.60 clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
24:40.61 make[4]: *** [/home/maxy/.cache/paru/clone/librewolf/src/librewolf-116.0.2-1/config/rules.mk:532: libmozsqlite3.so] Error 1
24:40.61 make[3]: *** [/home/maxy/.cache/paru/clone/librewolf/src/librewolf-116.0.2-1/config/recurse.mk:72: config/external/sqlite/target] Error 2

I am not quite sure if this is an issue with mold or firefox, so I have made a bug report on their github page too: https://github.com/rui314/mold/issues/1085.

Side note, someone also recently filed this^ build error as bug 1854331 in this bugzilla instance.

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

Attachment

General

Created:
Updated:
Size: