[LLVMdev] Help with libLTO and clang

Santosh Nagarakatte santosh.nagarakatte at gmail.com
Wed Dec 7 00:38:35 PST 2011

Hi all,

I am testing  link time optimizations with clang  on linux x86_64
machine running Ubuntu Maverick.
I am using clang with llvm release-3.0

I followed the instructions on http://llvm.org/docs/LinkTimeOptimization.html

However, when I try to compile with one file being bitcode and other
being native code exactly as shown in the documentation, I get the
following errors

clang a.o main.o -o main.out


/usr/bin/ld: error: a.o:1:3: invalid character
/usr/bin/ld: error: a.o:1:3: syntax error, unexpected $end
/usr/bin/ld: error: a.o: not an object or archive
/usr/bin/ld: main.o: in function main:main.c(.text+0x30): error:
undefined reference to 'foo1'
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I have the GOLD linker  installed in the system.

/usr/bin/ld --version


GNU gold (GNU Binutils for Ubuntu 1.11

Any suggestions?


Santosh G Nagarakatte,
PhD Student,
Computer and Information Science Department
University of Pennsylvania,

More information about the llvm-dev mailing list