[LLVMdev] problem when compiling to llvm bitcode

christos13 christos700 at yahoo.com
Wed Jun 10 13:45:38 PDT 2009

Hi, I am trying to write a pass to instrument llvm ir, but I got a problem
when I worked with one of the PARSEC benchmarks. 
I stripped the source files as much as i could to still reproduce the error.

When I emit llvm bitcode and then assemble native code I get the following
+ llvm-g++ -emit-llvm annealer_thread.cpp -c -o annealer_thread.o
+ llvm-g++ -emit-llvm rng.cpp -c -o rng.o
+ llc annealer_thread.o -f -o annealer_thread.s
+ llvm-g++ -c annealer_thread.s -o annealer_thread.o
+ llc rng.o -f -o rng.s
+ llvm-g++ -c rng.s -o rng.o
+ llvm-g++ annealer_thread.o rng.o
rng.o: In function `MTRand::reload()':
rng.s:(.text+0x50): multiple definition of `MTRand::reload()'
annealer_thread.o:annealer_thread.s:(.text+0xa0): first defined here
collect2: ld returned 1 exit status

When I don't everything works:
+ llvm-g++ annealer_thread.cpp -c -o annealer_thread.o
+ llvm-g++ rng.cpp -c -o rng.o
+ llvm-g++ rng.o annealer_thread.o


http://www.nabble.com/file/p23970657/annealer_thread.cpp annealer_thread.cpp 
http://www.nabble.com/file/p23970657/rng.h rng.h 
http://www.nabble.com/file/p23970657/rng.cpp rng.cpp 
View this message in context: http://www.nabble.com/problem-when-compiling-to-llvm-bitcode-tp23970657p23970657.html
Sent from the LLVM - Dev mailing list archive at Nabble.com.

More information about the llvm-dev mailing list