-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LLVMlto library does not build on Linux (amd64) #1427
Comments
assigned to @chandlerc |
This is because all of LLVM needs to be built PIC to link liblto. We should probably just do this. -Chris |
An --enable-pic option to configure has been added. Chandler is going to try it |
Sounds good, when we know it works, we should just enable it by default everywhere. The pain of |
Well, the -fPIC option seems to work, but isn't sufficient to solve this As a side note, I feel like when I was using a pure GNU autotools build system -Chandler |
Ok, I've been setting SHARED_LIBRARY=1 in Makefiles of the various objects that g++ -shared -nostdlib -Chandler |
Patch builds LLVMlto as a static library |
Patch to build LLVMlto on non Darwin systems |
Reid: can you review the makefile changes please? -Chris |
Makefile changes look fine to me. Much of this was worked out between Chanderl |
When you have cvs commit access, please apply this Chandler! |
Committed patch. |
Extended Description
The library LLVMlto is only built on Darwin. Commenting out lines 26 and 28 of
tools/Makefile, to add lto to the build, results in the following error:
...
make[2]: Entering directory `/home/chandlerc/code/compilers/build/llvm/tools/lto'
llvm[2]: Linking Debug Loadable Module LLVMlto.so
*** Warning: Linking the shared library
/home/chandlerc/code/compilers/build/llvm/Debug/lib/LLVMlto.la against the
non-libtool
*** objects /home/chandlerc/code/compilers/build/llvm/Debug/lib/LLVMARM.o
/home/chandlerc/code/compilers/build/llvm/Debug/lib/LLVMIA64.o
/home/chandlerc/code/compilers/build/llvm/Debug/lib/LLVMAlpha.o
/home/chandlerc/code/compilers/build/llvm/Debug/lib/LLVMPowerPC.o
/home/chandlerc/code/compilers/build/llvm/Debug/lib/LLVMSparc.o
/home/chandlerc/code/compilers/build/llvm/Debug/lib/LLVMX86.o
/home/chandlerc/code/compilers/build/llvm/Debug/lib/LLVMCBackend.o is not portable!
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../../../x86_64-pc-linux-gnu/bin/ld:
/home/chandlerc/code/compilers/build/llvm/Debug/lib/LLVMARM.o: relocation
R_X86_64_32 against
llvm::SupportDwarfLinkVar' can not be used when making a shared object; recompile with -fPIC /home/chandlerc/code/compilers/build/llvm/Debug/lib/LLVMARM.o: could not read symbols: Bad value collect2: ld returned 1 exit status make[2]: *** [/home/chandlerc/code/compilers/build/llvm/Debug/lib/LLVMlto.la] Error 1 make[2]: Leaving directory
/home/chandlerc/code/compilers/build/llvm/tools/lto'...
The same error is generated using './configure --with-pic' and without.
I am running Gentoo Linux, amd64 architecture, gcc (GCC) 4.1.1 (Gentoo 4.1.1-r3)
.
-Chandler
The text was updated successfully, but these errors were encountered: