Bug#662742: clang: files compiled with "-flto" fail to link

Miles Bader miles at gnu.org
Tue Mar 6 06:24:12 UTC 2012


Package: clang
Version: 3.0-6
Severity: normal

I do not know if "-flto" is ever expected to work with clang, but it
doesn't work correctly in the Debian installation:

   $ echo 'int main () { return 0; }' > foo.cc
   $ clang++ -c -flto -O2 foo.cc -o foo.o
   $ clang++ -flto -O2 foo.o -o foo
   /usr/bin/ld: error: foo.o:1:3: invalid character
   /usr/bin/ld: error: foo.o:1:3: syntax error, unexpected $end
   /usr/bin/ld: error: foo.o: not an object or archive
   /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/crt1.o(.text+0x20): error: undefined reference to 'main'
   clang: error: linker command failed with exit code 1 (use -v to see invocation)
   $ file foo.o
   foo.o: LLVM bitcode

Is there supposed to be a special linker that handles LLVM bitcode?

Thanks,

-miles


-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (50, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=ja_JP.utf8, LC_CTYPE=ja_JP.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages clang depends on:
ii  libc6                2.13-27
ii  libclang-common-dev  3.0-6
ii  libffi5              3.0.10-3
ii  libgcc1              1:4.7.0~rc1-1
ii  libllvm3.0           3.0-5
ii  libstdc++6           4.7.0~rc1-1
ii  libstdc++6-4.6-dev   4.6.3-1

Versions of packages clang recommends:
ii  llvm-3.0-dev  <none>
ii  python        2.7.2-10

clang suggests no packages.

-- no debconf information





More information about the Pkg-llvm-team mailing list