clang++ -flto fails to work unless -B /usr/lib/gold-ld is given

Bug #1371899 reported by Matthias Andree
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
llvm-toolchain-3.4 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

clang++ -flto does not seem to configure everything properly:

$ clang++ -stdlib=libc++ try.cpp -O3 -flto -Wall -Wextra
/tmp/try-1083b9.o: file not recognized: Dateiformat nicht erkannt
clang: error: linker command failed with exit code 1 (use -v to see invocation)

$ clang++ -stdlib=libc++ try.cpp -O3 -flto -Wall -Wextra -B/usr/lib/gold-ld
however, works properly.

See the attached files for output from the same commands with "-v" added on the respective command lines.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: clang-3.4 1:3.4-1ubuntu3
ProcVersionSignature: Ubuntu 3.13.0-35.62-generic 3.13.11.6
Uname: Linux 3.13.0-35-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.4
Architecture: amd64
CurrentDesktop: KDE
Date: Sat Sep 20 12:53:53 2014
SourcePackage: llvm-toolchain-3.4
UpgradeStatus: Upgraded to trusty on 2014-08-29 (21 days ago)

Revision history for this message
Matthias Andree (matthias-andree) wrote :
Revision history for this message
Matthias Andree (matthias-andree) wrote :
Revision history for this message
Matthias Andree (matthias-andree) wrote :

The only difference that -B makes is running /usr/lib/gold-ld/ld instead of /usr/bin/ld

Revision history for this message
Matthias Andree (matthias-andree) wrote :

More importantly, -fuse-ld=gold per apt-get changelog binutils, here, does NOT work:

binutils (2.23.52.20130722-1) unstable; urgency=low

  * New upstream snapshot.
    - Fix PR ld/15762, glibc being built without warning sections.
  * Set the libdir for arm64 to lib, not lib64.
  * Stop building the binutils-gold package, let binutils provide
    binutils-gold. Packages requiring gold should explicity pass
    -fuse-ld=gold to the compiler, packages requiring the bfd linker
    should pass -fuse-ld=bfd to the compiler.
  * Refresh patches.

 -- Matthias Klose <email address hidden> Mon, 22 Jul 2013 21:13:32 +0200

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

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

Changed in llvm-toolchain-3.4 (Ubuntu):
status: New → Confirmed
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.