[Bug 2064187] Re: llvm-18-linker-tools does not include LLVMgold.so
Launchpad Bug Tracker
2064187 at bugs.launchpad.net
Mon Jul 1 09:40:26 UTC 2024
This bug was fixed in the package llvm-toolchain-18 - 1:18.1.3-1ubuntu1
---------------
llvm-toolchain-18 (1:18.1.3-1ubuntu1) noble; urgency=medium
* Disable mold for all to make sure it builds gold (LP: #2064187)
* Be explicit with what ships in llvm-18-linker-tools to make sure we always
ship gold
-- Shengjing Zhu <shengjing.zhu at canonical.com> Mon, 27 May 2024
16:26:20 +0800
** Changed in: llvm-toolchain-18 (Ubuntu Noble)
Status: Fix Committed => Fix Released
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to llvm-toolchain-18 in Ubuntu.
https://bugs.launchpad.net/bugs/2064187
Title:
llvm-18-linker-tools does not include LLVMgold.so
Status in llvm-toolchain-18 package in Ubuntu:
Fix Released
Status in llvm-toolchain-18 source package in Noble:
Fix Released
Status in llvm-toolchain-18 source package in Oracular:
Fix Released
Bug description:
[ Impact ]
* User can't use clang++-18 to build C++ code with -flto option.
[ Test Plan ]
* Install clang-18 from proposed updates.
* Try to build a C++ program with LTO (for example following the steps in original description.
[ Where problems could occur ]
* The missing LLVMgold.so is caused by switching to use mold in
package building. Using mold is introduced in llvm 18. The fix is just
to revert the change, and uses the same linker (gold) as old llvm
versions. So the change looks safe.
[ Other Info ]
* No
[Original Description]
Unlike all other llvm-*-linker-tools packages, this one does not install `/usr/lib/llvm-18/lib/LLVMgold.so`. It does however install a broken symlink to it at `/usr/lib/bfd-plugins/LLVMgold-18.so`
This results in compilation failures with clang++ when used with the `-flto` flag for link time optimization.
To reproduce:
main.cpp:
```c++
int main() { return 0; }
```
```bash
clang++ -flto main.cpp -o main
```
Results in:
```
/usr/bin/ld: /usr/lib/llvm-18/bin/../lib/LLVMgold.so: error loading plugin: /usr/lib/llvm-18/bin/../lib/LLVMgold.so: cannot open shared object file: No such file or directory
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
```
Package version is
llvm-18-linker-tools/noble,now 1:18.1.3-1 amd64
llvm-18-linker-tools:
Installed: 1:18.1.3-1
Candidate: 1:18.1.3-1
Version table:
*** 1:18.1.3-1 500
500 http://de.archive.ubuntu.com/ubuntu noble/universe amd64 Packages
100 /var/lib/dpkg/status
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/llvm-toolchain-18/+bug/2064187/+subscriptions
More information about the foundations-bugs
mailing list