Help with linking llvm 3.2 into an .so

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Help with linking llvm 3.2 into an .so

Damien D Neff
Hi everyone, sorry to bother you guys.   I’m moving a linux application that uses LLVM from version 3.0 to 3.2, and I’m getting a relocation error that I didn’t used to get with the older version of LLVM.   I believe that I correctly turned on fPIC, but I’m getting this warning anyway:

/usr/bin/ld: /scratch/thirdparty/default/lib/libLLVMBitReader.a(BitcodeReader.o): relocation R_X86_64_PC32 against `llvm::Use::set(llvm::Value*)' can not be used when making a shared object; recompile with -fPIC

/usr/bin/ld: final link failed: Bad value

Does anyone have an idea what the issue might be?

// make  command line for BitCodeReader.o

if  g++ -I/home/damien/llvm32/build2/include -I/home/damien/llvm32/build2/lib/Bitcode/Reader -I/home/damien/llvm32/llvm-3.2.src/include -I/home/damien/llvm32/llvm-3.2.src/lib/Bitcode/Reader  -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -O3 -fomit-frame-pointer -fvisibility-inlines-hidden -fno-exceptions -fPIC -Woverloaded-virtual -Wcast-qual    -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -fPIC  -c -MMD -MP -MF "/home/damien/llvm32/build2/lib/Bitcode/Reader/Release/BitcodeReader.d.tmp" -MT "/home/damien/llvm32/build2/lib/Bitcode/Reader/Release/BitcodeReader.o" -MT "/home/damien/llvm32/build2/lib/Bitcode/Reader/Release/BitcodeReader.d" /home/damien/llvm32/llvm-3.2.src/lib/Bitcode/Reader/BitcodeReader.cpp -o /home/damien/llvm32/build2/lib/Bitcode/Reader/Release/BitcodeReader.o ; \

                then /bin/mv -f "/home/damien/llvm32/build2/lib/Bitcode/Reader/Release/BitcodeReader.d.tmp" "/home/damien/llvm32/build2/lib/Bitcode/Reader/Release/BitcodeReader.d"; else /bin/rm "/home/damien/llvm32/build2/lib/Bitcode/Reader/Release/BitcodeReader.d.tmp"; exit 1; fi

g++ version is 4.6.3

Thanks,

  Damien

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Help with linking llvm 3.2 into an .so

Damien D Neff
Please ignore, I think this is an issue with an older version of binutils.

From: Damien D Neff
Sent: 1/4/2013 1:25 PM
To: [hidden email]
Subject: Help with linking llvm 3.2 into an .so

Hi everyone, sorry to bother you guys.   I’m moving a linux application that uses LLVM from version 3.0 to 3.2, and I’m getting a relocation error that I didn’t used to get with the older version of LLVM.   I believe that I correctly turned on fPIC, but I’m getting this warning anyway:

/usr/bin/ld: /scratch/thirdparty/default/lib/libLLVMBitReader.a(BitcodeReader.o): relocation R_X86_64_PC32 against `llvm::Use::set(llvm::Value*)' can not be used when making a shared object; recompile with -fPIC

/usr/bin/ld: final link failed: Bad value

Does anyone have an idea what the issue might be?

// make  command line for BitCodeReader.o

if  g++ -I/home/damien/llvm32/build2/include -I/home/damien/llvm32/build2/lib/Bitcode/Reader -I/home/damien/llvm32/llvm-3.2.src/include -I/home/damien/llvm32/llvm-3.2.src/lib/Bitcode/Reader  -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -O3 -fomit-frame-pointer -fvisibility-inlines-hidden -fno-exceptions -fPIC -Woverloaded-virtual -Wcast-qual    -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -fPIC  -c -MMD -MP -MF "/home/damien/llvm32/build2/lib/Bitcode/Reader/Release/BitcodeReader.d.tmp" -MT "/home/damien/llvm32/build2/lib/Bitcode/Reader/Release/BitcodeReader.o" -MT "/home/damien/llvm32/build2/lib/Bitcode/Reader/Release/BitcodeReader.d" /home/damien/llvm32/llvm-3.2.src/lib/Bitcode/Reader/BitcodeReader.cpp -o /home/damien/llvm32/build2/lib/Bitcode/Reader/Release/BitcodeReader.o ; \

                then /bin/mv -f "/home/damien/llvm32/build2/lib/Bitcode/Reader/Release/BitcodeReader.d.tmp" "/home/damien/llvm32/build2/lib/Bitcode/Reader/Release/BitcodeReader.d"; else /bin/rm "/home/damien/llvm32/build2/lib/Bitcode/Reader/Release/BitcodeReader.d.tmp"; exit 1; fi

g++ version is 4.6.3

Thanks,

  Damien

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev