Closed Bug 2010541 Opened 10 months ago Closed 2 months ago

[deb13] clang-14-stage1: ld.lld: error: version script assignment of 'LLVM_14' to symbol 'LLVMCreateDisasm' failed: symbol not defined

Categories

(Firefox Build System :: Toolchains, task)

task

Tracking

(firefox158 fixed)

RESOLVED FIXED
158 Branch
Tracking Status
firefox158 --- fixed

People

(Reporter: jcristau, Assigned: jcristau)

References

Details

Attachments

(1 external file)

After updating the toolchain-build image from debian 12 (clang-13) to debian 13 (clang-19), the clang-14-stage1 toolchain build fails with

[task 2026-01-15T05:49:23.237+00:00] ld.lld: error: version script assignment of 'LLVM_14' to symbol 'LLVMCreateDisasm' failed: symbol not defined
[task 2026-01-15T05:49:23.237+00:00] ld.lld: error: version script assignment of 'LLVM_14' to symbol 'LLVMCreateDisasmCPU' failed: symbol not defined
[task 2026-01-15T05:49:23.237+00:00] ld.lld: error: version script assignment of 'LLVM_14' to symbol 'LLVMDisasmDispose' failed: symbol not defined
[task 2026-01-15T05:49:23.237+00:00] ld.lld: error: version script assignment of 'LLVM_14' to symbol 'LLVMDisasmInstruction' failed: symbol not defined
[task 2026-01-15T05:49:23.238+00:00] ld.lld: error: version script assignment of 'LLVM_14' to symbol 'LLVMSetDisasmOptions' failed: symbol not defined
[task 2026-01-15T05:49:23.238+00:00] ld.lld: error: version script assignment of 'LLVM_14' to symbol 'LLVMCreateDisasmCPUFeatures' failed: symbol not defined
[task 2026-01-15T05:49:23.238+00:00] clang++-19: error: linker command failed with exit code 1 (use -v to see invocation)

https://treeherder.mozilla.org/jobs?repo=try&revision=7ec7ee6c1f054ab42534775115e17b5291a8595d&selectedTaskRun=a78N2g_CTk2RR42P89ffoQ.0

Presumably that comes from llvm defaulting to -Wl,--no-undefined-version since https://reviews.llvm.org/D135402
I guess we'd need something like https://github.com/llvm/llvm-project/commit/61311f3c9363534eda3bc9b8a5edbab80048cdd4, or adding -Wl,--undefined-version to ldflags.

Backport llvm-project c294bdd64768 and bf07de38b05e.

LTODisassembler.cpp only forces the target disassembler registries into
the link; the LLVMCreateDisasm* entry points themselves live in
LLVMMCDisassembler. With LLVM_LINK_LLVM_DYLIB, which we enable
everywhere but Windows, they end up in libLLVM-14.so, so lto.exports
names six symbols libLTO.so.14 does not define. lld defaults to
--no-undefined-version since llvm D135402 and rejects that.

libRemarks.so has the same problem, more so: Remarks.exports lists 25
symbols and libremarks.cpp defines exactly one.

Both upstream fixes landed for LLVM 16, so clang 19 and later already
have them.

Assignee: nobody → jcristau
Attachment #9628959 - Attachment description: WIP: Bug 2010541 - Stop exporting undefined disassembler symbols from clang 14's libLTO and libRemarks. → Bug 2010541 - Stop exporting undefined disassembler symbols from clang 14's libLTO and libRemarks. r=glandium
Status: NEW → ASSIGNED
Pushed by jcristau@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/c41f6ab34f0b https://hg.mozilla.org/integration/autoland/rev/d5a1eddac54e Stop exporting undefined disassembler symbols from clang 14's libLTO and libRemarks. r=firefox-build-system-reviewers,sergesanspaille

Backed out for causing spidermonkey bustages.

Pushed by jcristau@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/4300da9b2aa7 https://hg.mozilla.org/integration/autoland/rev/49031b2b3d80 Stop exporting undefined disassembler symbols from clang 14's libLTO and libRemarks. r=firefox-build-system-reviewers,sergesanspaille
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 158 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: