Stephen Checkoway
2013-Mar-20 16:14 UTC
[LLVMdev] bugpoint (and possibly others) need to be compiled with -rdynamic
On Mar 19, 2013, at 12:03 PM, Rafael EspĂndola <rafael.espindola at gmail.com> wrote:>> What version of cmake are you using? I am getting the opposite >> behavior: every binary is linked using -rdynamic :-( > > BTW, I reported llvm.org/pr15543 to track this.When I first sent the email (in August of last year), I was using cmake 2.8.8. I now appear to be using 2.8.9 and I don't have the same behavior you do: steve$ ninja -v -j1 bin/llvm-as [1/1] : && /usr/bin/c++ -fPIC -fvisibility-inlines-hidden -Wno-uninitialized -Wnon-virtual-dtor -fno-rtti tools/llvm-as/CMakeFiles/llvm-as.dir/llvm-as.cpp.o -o bin/llvm-as -L/usr/local/lib lib/libLLVMAsmParser.a lib/libLLVMBitWriter.a lib/libLLVMCore.a lib/libLLVMSupport.a -lrt -lpthread -Wl,-rpath,/usr/local/lib: Switching compilers makes no difference (and I wouldn't think it would): steve$ ninja -v -j1 bin/llvm-as [1/1] : && /usr/bin/clang++ -fPIC -fvisibility-inlines-hidden -Wcovered-switch-default -Wnon-virtual-dtor -fno-rtti tools/llvm-as/CMakeFiles/llvm-as.dir/llvm-as.cpp.o -o bin/llvm-as -L/usr/local/lib lib/libLLVMAsmParser.a lib/libLLVMBitWriter.a lib/libLLVMCore.a lib/libLLVMSupport.a -lrt -lpthread -Wl,-rpath,/usr/local/lib: && : The difference seems to be Linux vs. FreeBSD. On Linux: s$ cmake --version cmake version 2.8.9 s$ grep rdynamic build.ninja |wc -l 56 On FreeBSD: steve$ cmake --version cmake version 2.8.9 steve$ grep rdynamic rules.ninja |wc -l 0 Okay, yes that's it. ${prefix}/share/cmake/Modules/Platform/Linux-Intel.cmake: # We pass this for historical reasons. Projects may have # executables that use dlopen but do not set ENABLE_EXPORTS. set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-rdynamic") I assume the CMAKE_SHARED_LIBRARY_LINK_C_FLAGS and CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS could be set empty initially and then for those that need it, set it (or something else) to -rdynamic. -- Stephen Checkoway
Stephen Checkoway
2013-Mar-20 17:48 UTC
[LLVMdev] bugpoint (and possibly others) need to be compiled with -rdynamic
On Mar 20, 2013, at 12:14 PM, Stephen Checkoway <s at pahtak.org> wrote:> I assume the CMAKE_SHARED_LIBRARY_LINK_C_FLAGS and CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS could be set empty initially and then for those that need it, set it (or something else) to -rdynamic.Attached is a small patch that sets CMAKE_SHARED_LIBRARY_LINK_CXXFLAGS to "" (as per your patch which I didn't notice initially), and then sets opt, bugpoint, and JITTests to have the property ENABLE_EXPORTS set to 1. This passes -Wl,--export-dynamic on BSD and Linux (and others) and --export-all-symbols on cygwin. I'm not sure if there are others that should be modified as well. Presumably an option for clang would be easy enough to add. -- Stephen Checkoway -------------- next part -------------- A non-text attachment was scrubbed... Name: symbols.patch Type: application/octet-stream Size: 1609 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130320/53dda558/attachment.obj>
Rafael EspĂndola
2013-Mar-25 17:49 UTC
[LLVMdev] bugpoint (and possibly others) need to be compiled with -rdynamic
> Attached is a small patch that sets CMAKE_SHARED_LIBRARY_LINK_CXXFLAGS to "" (as per your patch which I didn't notice initially), and then sets opt, bugpoint, and JITTests to have the property ENABLE_EXPORTS set to 1. This passes -Wl,--export-dynamic on BSD and Linux (and others) and --export-all-symbols on cygwin. > > I'm not sure if there are others that should be modified as well. Presumably an option for clang would be easy enough to add.This is awesome, thanks! Chandler, is Stephen's patch OK? The trivial attached patch should keep the status quo for clang, but I only have a OS X laptop with me now, so I cannot test it.> -- > Stephen Checkoway >Cheers, Rafael -------------- next part -------------- A non-text attachment was scrubbed... Name: t.patch Type: application/octet-stream Size: 400 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130325/5af67f20/attachment.obj>
Seemingly Similar Threads
- [LLVMdev] bugpoint (and possibly others) need to be compiled with -rdynamic
- [LLVMdev] bugpoint (and possibly others) need to be compiled with -rdynamic
- [LLVMdev] bugpoint (and possibly others) need to be compiled with -rdynamic
- [LLVMdev] bugpoint (and possibly others) need to be compiled with -rdynamic
- [LLVMdev] bugpoint (and possibly others) need to be compiled with -rdynamic