Jeffrey Yasskin wrote:> I just tried it again on trunk (not 2.7) on OSX 10.5, and it works. > What platform are you on? Does it work with another version of gcc? >Looks like this is platform dependent. libLLVM-2.7.so created has size only 4145 bytes and all llvm symbols are missing. It's empty because there are no .o modules included into it, only libraries through -l options were specified in g++ command line. Libraries normally are specified with -l option to resolve unknown imports, not to be just included into .so library. All .o files should be listed in the command line instead. Yuri
Pekka Jääskeläinen
2010-Apr-28 10:01 UTC
[LLVMdev] Is the option --enable-shared discontinued in 2.7?
On 04/28/2010 11:42 AM, Yuri wrote:> Looks like this is platform dependent.Yep, works fine here on Debian 5.0/x86_64 with gcc 4.3.2. Did you build with make REQUIRES_RTTI=1 which is required as of LLVM 2.7 to get RTTI for LLVM symbols? -- Pekka
Jeffrey Yasskin
2010-Apr-28 16:22 UTC
[LLVMdev] Is the option --enable-shared discontinued in 2.7?
On Wed, Apr 28, 2010 at 1:42 AM, Yuri <yuri at tsoft.com> wrote:> Jeffrey Yasskin wrote: >> >> I just tried it again on trunk (not 2.7) on OSX 10.5, and it works. >> What platform are you on? Does it work with another version of gcc? >> > > Looks like this is platform dependent. libLLVM-2.7.so created has size only > 4145 bytes and all llvm symbols are missing. > It's empty because there are no .o modules included into it, only libraries > through -l options were specified in g++ command line. > Libraries normally are specified with -l option to resolve unknown imports, > not to be just included into .so library. > > All .o files should be listed in the command line instead.We currently use two different techniques to get whole libraries included into the .so. On Linux (gnu ld and gold), we pass --whole-archive, while on OSX we pass -all_load. Which ld does FreeBSD use? If you can rearrange tools/llvm-shlib/Makefile until it works for you and send us a patch, we can probably get it working for llvm-2.8.
Pekka Jääskeläinen wrote:> On 04/28/2010 11:42 AM, Yuri wrote: >> Looks like this is platform dependent. > > Yep, works fine here on Debian 5.0/x86_64 with gcc 4.3.2. > > Did you build with make REQUIRES_RTTI=1 which is required > as of LLVM 2.7 to get RTTI for LLVM symbols? >No. If this is a hack to get the command 'g++ -shared -o libLLVM-2.7.so -lXXX -lXXX -lXXX ...' to actually produce the full shared library this should be done automatically by Makefile and not exposed to the user. Yuri
Jeffrey Yasskin wrote:> We currently use two different techniques to get whole libraries > included into the .so. On Linux (gnu ld and gold), we pass > --whole-archive, while on OSX we pass -all_load. Which ld does FreeBSD > use? If you can rearrange tools/llvm-shlib/Makefile until it works for > you and send us a patch, we can probably get it working for llvm-2.8. >ld on FreeBSD is from binutils. It takes --whole-archive option. But command line needs to be changed: actual archive files should be supplied, not just -lXXX. I believe that will fix the problem. Yuri
Reasonably Related Threads
- [LLVMdev] Is the option --enable-shared discontinued in 2.7?
- [LLVMdev] Is the option --enable-shared discontinued in 2.7?
- [LLVMdev] Is the option --enable-shared discontinued in 2.7?
- [LLVMdev] Is the option --enable-shared discontinued in 2.7?
- [LLVMdev] Is the option --enable-shared discontinued in 2.7?