llvm-18-linker-tools does not include LLVMgold.so

Bug #2064187 reported by Paul Meckel
58
This bug affects 10 people
Affects Status Importance Assigned to Milestone
llvm-toolchain-18 (Ubuntu)
Status tracked in Oracular
Noble
Fix Released
Undecided
Unassigned
Oracular
Fix Released
Undecided
Unassigned

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

Related branches

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in llvm-toolchain-18 (Ubuntu):
status: New → Confirmed
Shengjing Zhu (zhsj)
Changed in llvm-toolchain-18 (Ubuntu Noble):
status: New → Confirmed
Changed in llvm-toolchain-18 (Ubuntu Oracular):
status: Confirmed → Fix Released
Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

Oracular is not really fixed, llvmGOLD.so is still not built on riscv64.

Revision history for this message
Shengjing Zhu (zhsj) wrote :

> llvmGOLD.so is still not built on riscv64

It's not been built from previous versions on riscv64 as well. So at least not a regression.

Revision history for this message
Matthias Klose (doko) wrote :

gold is not support upstream on riscv64

Revision history for this message
Balint Reczey (rbalint) wrote :

Please backport the fix to Noble.

Shengjing Zhu (zhsj)
description: updated
Revision history for this message
Shengjing Zhu (zhsj) wrote :
Revision history for this message
Shengjing Zhu (zhsj) wrote (last edit ):
Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

Thanks, will sponsor. I would have preferred a versioning not like ubuntu1 but ubuntu1.24.04.1, but since
there were never ubuntu1 version, I guess it is fine, specially because oracular has already a newer version.

Changed in llvm-toolchain-18 (Ubuntu Noble):
status: Confirmed → Triaged
status: Triaged → In Progress
Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

and uploaded.

Revision history for this message
Simon Quigley (tsimonq2) wrote :

Unsubscribing sponsors, please feel free to re-subscribe if another iteration is needed.

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

-1ubuntu0.1 would've been perfect for the first SRU, but not a reason to reject.

Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello Paul, or anyone else affected,

Accepted llvm-toolchain-18 into noble-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/llvm-toolchain-18/1:18.1.3-1ubuntu1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-noble to verification-done-noble. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-noble. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in llvm-toolchain-18 (Ubuntu Noble):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-noble
Revision history for this message
Oliver Kuckertz (mologie) wrote :

I successfully tested llvm-18-linker-tools 1:18.1.3-1ubuntu1. Thanks to everyone involved for addressing this issue!

The proposed package for noble resolves the issue for me with an in-house application. Additionally I tested that the simple steps to reproduce in the bug description no longer reproduce the issue, and that the symlink at /usr/lib/bfd-plugins/LLVMgold-18.so is now valid.

tags: added: verification-done verification-done-noble
removed: verification-needed verification-needed-noble
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

The dep8 tests was stuck, and the details page showed a tmpfail. I retrigered it.

Revision history for this message
Launchpad Janitor (janitor) wrote :

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 <email address hidden> Mon, 27 May 2024 16:26:20 +0800

Changed in llvm-toolchain-18 (Ubuntu Noble):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for llvm-toolchain-18 has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.