-
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
lib/libLLVMRuntimeDyld.so build failure with gcc-5 #22967
Comments
gcc correctly devirtualizes in this case: markus@x4 llvm_build % cat RuntimeDyld.ii public: namespace llvm markus@x4 llvm_build % g++ -O2 -c -std=c++11 RuntimeDyld.ii Also happens with gcc-4.9. |
Hi Octoploid, Thanks for tracking this down. I've tried to fix this dependency issue in r229343. Could you try that out and see if it fixes the issue? Cheers, |
Yes it does. Thanks. |
same error compiling mesa with gcc 5 and llvm 3.6(rc): /bin/sh ../../../../libtool --tag=CXX --mode=link g++-5 -O2 -Wall -fno-strict-aliasing -fno-builtin-memcmp -shared -module -no-undefined -avoid-version -Wl,--gc-sections -Wl,--no-undefined -Wl,--version-script=../../../../src/gallium/targets/omx/omx.sym -L/usr/lib64 -O2 -o libomx_mesa.la -rpath /usr/lib64/bellagio libomx_mesa_la-target.lo ../../../../src/gallium/state_trackers/omx/libomxtracker.la ../../../../src/gallium/auxiliary/libgalliumvlwinsys.la ../../../../src/gallium/auxiliary/libgalliumvl.la ../../../../src/gallium/auxiliary/libgallium.la ../../../../src/util/libmesautil.la -lomxil-bellagio -lX11-xcb -lX11 -lxcb-dri2 -lxcb -ldrm -lm -lpthread -ldl ../../../../src/loader/libloader.la ../../../../src/gallium/drivers/r600/libr600.la -ldrm_radeon -ldrm ../../../../src/gallium/winsys/radeon/drm/libradeonwinsys.la ../../../../src/gallium/drivers/radeon/libradeon.la -lLLVMAsmParser -lLLVMR600CodeGen -lLLVMipo -lLLVMVectorize -lLLVMR600AsmParser -lLLVMR600Desc -lLLVMR600Info -lLLVMR600AsmPrinter -lLLVMBitWriter -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMCodeGen -lLLVMScalarOpts -lLLVMProfileData -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMX86Desc -lLLVMMCDisassembler -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMMCJIT -lLLVMTarget -lLLVMRuntimeDyld -lLLVMExecutionEngine -lLLVMObject -lLLVMMCParser -lLLVMBitReader -lLLVMMC -lLLVMCore -lLLVMSupport -lrt -ldl -ltinfo -latomic -lpthread -lz -lm |
CCing Hans Wennborg, who's managing the release. Hans - Would it be possible to cherry-pick r229343 into the release branch? |
I already tried this with no success. Maybe a mesa patch is needed instead? My lib shows getSymbolAddressInProcess is an unresolved symbol for some reason (getSymbolAddress is ok). |
Hi Mark, You might need to add RuntimeDyld to your list of dependencies a la r229351. Cheers, |
Since we're doing an rc4 anyway, I've merged it (and r229351) in r229553. |
Thanks Hans. |
We are already linking agaist LLVMRuntimeDyld.so, but the problem is that the symbol is unresolvable: nm /usr/lib64/libLLVMRuntimeDyld.so | grep InProcU _ZN4llvm19RTDyldMemoryManager25getSymbolAddressInProcessERKSs Somehow this works with gcc-4.9 but fails with gcc-5. |
gcc-5 uses a new C++ ABI. If you want to use LLVM libraries with gcc-5 |
ahh, you are right. Using -D_GLIBCXX_USE_CXX11_ABI=0 fixes the problem. Sorry for the noise. |
Extended Description
Building llvm with gcc-5 I get:
[1456/1987] Linking CXX shared library lib/libLLVMRuntimeDyld.so
FAILED: : && /usr/bin/g++ -fPIC -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wnon-virtual-dtor -Wno-comment -std=c++11 -ffunction-sections -fdata-sections -O3 -fno-strict-aliasing -march=native -pipe -Wl,-z,defs -Wl,-O3 -Wl,--gc-sections -shared -Wl,-soname,libLLVMRuntimeDyld.so -o lib/libLLVMRuntimeDyld.so lib/ExecutionEngine/RuntimeDyld/CMakeFiles/LLVMRuntimeDyld.dir/RuntimeDyld.cpp.o lib/ExecutionEngine/RuntimeDyld/CMakeFiles/LLVMRuntimeDyld.dir/RuntimeDyldChecker.cpp.o lib/ExecutionEngine/RuntimeDyld/CMakeFiles/LLVMRuntimeDyld.dir/RuntimeDyldELF.cpp.o lib/ExecutionEngine/RuntimeDyld/CMakeFiles/LLVMRuntimeDyld.dir/RuntimeDyldMachO.cpp.o lib/libLLVMMC.so lib/libLLVMObject.so lib/libLLVMSupport.so -Wl,-rpath,"$ORIGIN/../lib" && :
lib/ExecutionEngine/RuntimeDyld/CMakeFiles/LLVMRuntimeDyld.dir/RuntimeDyld.cpp.o:RuntimeDyld.cpp:function llvm::RTDyldMemoryManager::getSymbolAddress(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&): error: undefined reference to 'llvm::RTDyldMemoryManager::getSymbolAddressInProcess(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
lib/ExecutionEngine/RuntimeDyld/CMakeFiles/LLVMRuntimeDyld.dir/RuntimeDyld.cpp.o:RuntimeDyld.cpp:function llvm::RuntimeDyldImpl::resolveExternalSymbols(): error: undefined reference to 'llvm::RTDyldMemoryManager::getSymbolAddressInProcess(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
lib/ExecutionEngine/RuntimeDyld/CMakeFiles/LLVMRuntimeDyld.dir/RuntimeDyldChecker.cpp.o:RuntimeDyldChecker.cpp:function llvm::RuntimeDyldCheckerImpl::getSymbolRemoteAddr(llvm::StringRef) const: error: undefined reference to 'llvm::RTDyldMemoryManager::getSymbolAddressInProcess(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
collect2: error: ld returned 1 exit status
The missing symbol is defined in lib/ExecutionEngine/CMakeFiles/LLVMExecutionEngine.dir/RTDyldMemoryManager.cpp.o
adding it to the link command "fixes" the issue.
The text was updated successfully, but these errors were encountered: