| Summary: | sys-devel/llvm-3.0-r1 without -fPIC in CXXFLAGS - work/ llvm-3.0.src/Release/lib/libLLVMJIT.a(JIT.o): requires dynamic R_X86_64_PC32 reloc against '__dso_handle' which may overflow at runtime; recompile with -fPIC | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Stanislav Ochotnicky (RETIRED) <sochotnicky> |
| Component: | New packages | Assignee: | Bernard Cafarelli <voyageur> |
| Status: | RESOLVED TEST-REQUEST | ||
| Severity: | normal | CC: | bug |
| Priority: | Normal | ||
| Version: | unspecified | ||
| Hardware: | AMD64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
| Attachments: | build log | ||
|
Description
Stanislav Ochotnicky (RETIRED)
2012-03-08 15:47:16 UTC
Created attachment 304635 [details]
build log
had to compress the log due to size
Scratch the -fPIC solution, it was just taking much longer to compile so I assumed I've passed that point. However when I disabled [gold] and set current binutils to 2.21.1-r1, I managed to compile llvm withtou issues. Not sure now if this is binutils or llvm problem Strange one, I never had the problem on my boxes (just retested with binutils-2.22-r1, gcc-4.5.3-r2 and USE=gold). The "--enable-pic" is passed correctly also... See this when building llvm-3.0-r2 (without USE=gold) with gcc-4.5.4. An old gcc-4.4.5 builds fine. gcc-4.5.3-r2 fails. Seems the distinction is in whether gcc is built with ld.gold. Those builds fail. ld.bfd builds of gcc succeed. Cleaning old bugreports, I know several people who have no problem with this combination and current packages. Don't hesitate to reopen if you still have problems! It looks problem still exists (at least for me):
make[1]: Entering directory '/var/tmp/portage/sys-devel/llvm-3.0-r2/work/llvm-3.0.src/tools/llvm-shlib'
llvm[1]: Linking Release Shared Library libLLVM-3.0.so
g++ -I/var/tmp/portage/sys-devel/llvm-3.0-r2/work/llvm-3.0.src/include -I/var/tmp/portage/sys-devel/llvm-3.0-r2/work/llvm-3.0.src/tools/llvm-shlib -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fno-exceptions -fPIC -Woverloaded-virtual -Wcast-qual -O2 -march=native -pipe -fpeel-loops -frename-registers -frecord-gcc-switches -fno-unwind-tables -fno-asynchronous-unwind-tables -fpredictive-commoning -fweb -ftree-vectorize -floop-interchange -fivopts -floop-block -floop-strip-mine -fira-loop-pressure -floop-interchange -ftree-loop-linear -Wdisabled-optimization -fuse-linker-plugin -flto=2 -Wl,-R -Wl,'$ORIGIN' -L/var/tmp/portage/sys-devel/llvm-3.0-r2/work/llvm-3.0.src/Release/lib -L/var/tmp/portage/sys-devel/llvm-3.0-r2/work/llvm-3.0.src/Release/lib -Wl,-O1 -Wl,--as-needed -z relro -Wl,--sort-common -Wl,-O1 -Wl,--as-needed -z relro -Wl,--sort-common -Wl,-O1 -Wl,--as-needed -z relro -Wl,--sort-common -Wl,-O1 -Wl,--as-needed -z relro -Wl,--sort-common -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -shared -o /var/tmp/portage/sys-devel/llvm-3.0-r2/work/llvm-3.0.src/Release/lib/libLLVM-3.0.so \
-Wl,--whole-archive -lLLVMMCJIT -lLLVMX86Utils -lLLVMX86AsmPrinter -lLLVMScalarOpts -lLLVMJIT -lLLVMMCDisassembler -lLLVMSupport -lLLVMSelectionDAG -lLLVMAnalysis -lLLVMRuntimeDyld -lLLVMX86CodeGen -lLLVMExecutionEngine -lLLVMLinker -lLLVMX86AsmParser -lLLVMX86Info -lLLVMipo -lLLVMMC -lLLVMCore -lLLVMX86Disassembler -lLLVMObject -lLLVMMCParser -lLLVMInterpreter -lLLVMipa -lLLVMBitWriter -lLLVMAsmPrinter -lLLVMBitReader -lLLVMTransformUtils -lLLVMCodeGen -lLLVMAsmParser -lLLVMInstCombine -lLLVMArchive -lLLVMTarget -lLLVMInstrumentation -lLLVMDebugInfo -lLLVMX86Desc -Wl,--no-whole-archive -Wl,--soname,libLLVM-3.0.so -Wl,--no-undefined -lpthread -lffi -ldl -lm
/usr/include/bits/unistd.h: In member function ‘getMagicNumber’:
/usr/include/bits/unistd.h:39:76: warning: call to ‘__read_chk_warn’ declared with attribute warning: read called with bigger length than size of the destination buffer [enabled by default]
return __read_chk (__fd, __buf, __nbytes, __bos0 (__buf));
^
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../x86_64-pc-linux-gnu/bin/ld: error: /var/tmp/portage/sys-devel/llvm-3.0-r2/temp/ccxmdJmR.ltrans0.ltrans.o: requires dynamic R_X86_64_PC32 reloc against 'X86CompilationCallback2' which may overflow at runtime; recompile with -fPIC
/var/tmp/portage/sys-devel/llvm-3.0-r2/temp/ccxmdJmR.ltrans0.ltrans.o:ccxmdJmR.ltrans0.o:function X86CompilationCallback: error: undefined reference to 'X86CompilationCallback2'
collect2: error: ld returned 1 exit status
/var/tmp/portage/sys-devel/llvm-3.0-r2/work/llvm-3.0.src/Makefile.rules:1143: recipe for target '/var/tmp/portage/sys-devel/llvm-3.0-r2/work/llvm-3.0.src/Release/lib/libLLVM-3.0.so' failed
make[1]: *** [/var/tmp/portage/sys-devel/llvm-3.0-r2/work/llvm-3.0.src/Release/lib/libLLVM-3.0.so] Error 1
make[1]: Leaving directory '/var/tmp/portage/sys-devel/llvm-3.0-r2/work/llvm-3.0.src/tools/llvm-shlib'
/var/tmp/portage/sys-devel/llvm-3.0-r2/work/llvm-3.0.src/Makefile.rules:782: recipe for target 'all' failed
make: *** [all] Error 1
* ERROR: sys-devel/llvm-3.0-r2::gentoo failed (compile phase):
* emake failed
|