[LLVMdev] Help with linking llvm 3.2 into an .so

Damien D Neff ddneff at hotmail.com
Fri Jan 4 13:10:23 PST 2013


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: llvmdev at cs.uiuc.edu
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130104/83e65869/attachment.html>


More information about the llvm-dev mailing list