cannot use clang with gold without matching llvm-X.Y-dev package

Bug #1042822 reported by Dimitri John Ledkov
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
clang (Ubuntu)
Confirmed
Undecided
Unassigned
llvm (Ubuntu)
Confirmed
Undecided
Unassigned
llvm-3.0 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I must install llvm-dev package to use gold plugin in clang. But clang does not depend on llvm-dev by default. Maybe it should?
---
ApportVersion: 2.5.1-0ubuntu2
Architecture: amd64
DistroRelease: Ubuntu 12.10
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
Package: llvm-3.0 3.0-9ubuntu1
PackageArchitecture: amd64
ProcEnviron:
 LANGUAGE=en_GB:en
 TERM=xterm-256color
 PATH=(custom, user)
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 3.5.0-11.11-generic 3.5.2
Tags: quantal running-unity
Uname: Linux 3.5.0-11-generic x86_64
UpgradeStatus: Upgraded to quantal on 2012-01-04 (236 days ago)
UserGroups: adm admin cdrom dialout kvm libvirtd lp lpadmin plugdev sambashare sbuild vboxusers
---
ApportVersion: 2.5.1-0ubuntu2
Architecture: amd64
DistroRelease: Ubuntu 12.10
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
Package: llvm-3.0
PackageArchitecture: amd64
ProcEnviron:
 LANGUAGE=en_GB:en
 TERM=xterm-256color
 PATH=(custom, user)
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 3.5.0-11.11-generic 3.5.2
Tags: quantal running-unity
Uname: Linux 3.5.0-11-generic x86_64
UpgradeStatus: Upgraded to quantal on 2012-01-04 (236 days ago)
UserGroups: adm admin cdrom dialout kvm libvirtd lp lpadmin plugdev sambashare sbuild vboxusers

Revision history for this message
Dimitri John Ledkov (xnox) wrote : Dependencies.txt

apport information

tags: added: apport-collected quantal running-unity
description: updated
description: updated
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

apport information

Revision history for this message
Felix Geyer (debfx) wrote : Re: cannot use clang with gold without llvm-dev package

clang shouldn't depend on llvm-dev as llvm-defaults is not necessarily at the same version as clang.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

ok. Matching llvm-X.Y-dev then?

summary: - cannot use clang with gold without llvm-dev package
+ cannot use clang with gold without matching llvm-X.Y-dev package
Revision history for this message
Sylvestre Ledru (sylvestre) wrote :

Please report this bug on Debian. I will have a look then.

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

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

Changed in clang (Ubuntu):
status: New → Confirmed
Changed in llvm (Ubuntu):
status: New → Confirmed
Changed in llvm-3.0 (Ubuntu):
status: New → Confirmed
Revision history for this message
Anders Kaseorg (andersk) wrote :

llvm-X.Y-dev isn’t enough. clang really needs the /usr/lib/libLTO.so and /usr/lib/LLVMgold.so symlinks provided by the llvm-dev metapackage.

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

I don't think that would be a good idea. why can't clang use the corresponding shared libs?

Revision history for this message
Anders Kaseorg (andersk) wrote :

I dunno, I’m just explaining how it works now. clang doesn’t use these libs directly; rather, ‘clang -O4 -use-gold-plugin’ invokes the linker (which must be gold) with ‘ld -plugin /usr/lib/LLVMgold.so’. And LLVMgold.so has a shared library dependency on libLTO.so without an rpath.

(If you want my opinion, I think these libs belong somewhere other than llvm-*-dev entirely, since they’re needed by clang users and not just LLVM developers.)

Revision history for this message
Sylvestre Ledru (sylvestre) wrote :

Could you report this bug in Debian too ?

Revision history for this message
Bram Geron (bgeron) wrote :

This bug also appears when the user does not ask for link-time optimization.

bgeron@tinker:/tmp$ clang -O0 -Wno-unused-value -emit-llvm -o test.ll test.c
/usr/bin/ld: /usr/bin/../lib/LLVMgold.so: error loading plugin: /usr/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)

I currently do not have llvm-dev installed.

Revision history for this message
Bram Geron (bgeron) wrote :

Wait, that actually makes half-sense. I wanted only the LLVM, but -emit-llvm seems to activate LTO as a side effect, unless the user specifies -S .

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

Other bug subscribers

Remote bug watches

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