When I enabled this option I am getting errors, see below. Is there any way to fix this? There should be an option to have most of the code in shared library. Yuri --- error log using gcc-4.5.0 on 4 cpus with configure options: --enable-assertions --enable-optimized --enable-shared --prefix=/usr/local/llvm --- llvm[2]: Compiling llc.cpp for Release build gmake[2]: Entering directory `/tmp/llvm-build/2.7/llvm-objects/tools/llvm-ld' llvm[2]: Compiling Optimize.cpp for Release build llvm[2]: Linking Release executable llvm-dis (without symbols) llvm[2]: Compiling GraphPrinters.cpp for Release build /tmp/llvm-build/2.7/llvm-objects/tools/llvm-dis/Release/llvm-dis.o(.text+0x42): In function `main': : undefined reference to `llvm::sys::PrintStackTraceOnErrorSignal()' /tmp/llvm-build/2.7/llvm-objects/tools/llvm-dis/Release/llvm-dis.o(.text+0x51): In function `main': : undefined reference to `llvm::PrettyStackTraceEntry::PrettyStackTraceEntry()' /tmp/llvm-build/2.7/llvm-objects/tools/llvm-dis/Release/llvm-dis.o(.text+0x57): In function `main': : undefined reference to `vtable for llvm::PrettyStackTraceProgram' /tmp/llvm-build/2.7/llvm-objects/tools/llvm-dis/Release/llvm-dis.o(.text+0x68): In function `main': : undefined reference to `llvm::getGlobalContext()' /tmp/llvm-build/2.7/llvm-objects/tools/llvm-dis/Release/llvm-dis.o(.text+0x7b): In function `main': : undefined reference to `llvm::cl::ParseCommandLineOptions(int, char**, char const*, bool)' /tmp/llvm-build/2.7/llvm-objects/tools/llvm-dis/Release/llvm-dis.o(.text+0xb2): In function `main': : undefined reference to `llvm::MemoryBuffer::getFileOrSTDIN(llvm::StringRef, std::basic_string<char, std::char_traits<char>, std::allocator<char> >*, long long)' /tmp/llvm-build/2.7/llvm-objects/tools/llvm-dis/Release/llvm-dis.o(.text+0xcd): In function `main': : undefined reference to `llvm::ParseBitcodeFile(llvm::MemoryBuffer*, llvm::LLVMContext&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
Jeffrey Yasskin
2010-Apr-28 00:12 UTC
[LLVMdev] Is the option --enable-shared discontinued in 2.7?
--enable-shared was _created_ in 2.7. If you were passing it in 2.6 or earlier, it wasn't doing what you expected. 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? On Tue, Apr 27, 2010 at 4:06 PM, Yuri <yuri at tsoft.com> wrote:> > When I enabled this option I am getting errors, see below. > Is there any way to fix this? There should be an option to have most of > the code in shared library. > > Yuri > > --- error log using gcc-4.5.0 on 4 cpus with configure options: > --enable-assertions --enable-optimized --enable-shared > --prefix=/usr/local/llvm --- > llvm[2]: Compiling llc.cpp for Release build > gmake[2]: Entering directory > `/tmp/llvm-build/2.7/llvm-objects/tools/llvm-ld' > llvm[2]: Compiling Optimize.cpp for Release build > llvm[2]: Linking Release executable llvm-dis (without symbols) > llvm[2]: Compiling GraphPrinters.cpp for Release build > /tmp/llvm-build/2.7/llvm-objects/tools/llvm-dis/Release/llvm-dis.o(.text+0x42): > In function `main': > : undefined reference to `llvm::sys::PrintStackTraceOnErrorSignal()' > /tmp/llvm-build/2.7/llvm-objects/tools/llvm-dis/Release/llvm-dis.o(.text+0x51): > In function `main': > : undefined reference to > `llvm::PrettyStackTraceEntry::PrettyStackTraceEntry()' > /tmp/llvm-build/2.7/llvm-objects/tools/llvm-dis/Release/llvm-dis.o(.text+0x57): > In function `main': > : undefined reference to `vtable for llvm::PrettyStackTraceProgram' > /tmp/llvm-build/2.7/llvm-objects/tools/llvm-dis/Release/llvm-dis.o(.text+0x68): > In function `main': > : undefined reference to `llvm::getGlobalContext()' > /tmp/llvm-build/2.7/llvm-objects/tools/llvm-dis/Release/llvm-dis.o(.text+0x7b): > In function `main': > : undefined reference to `llvm::cl::ParseCommandLineOptions(int, char**, > char const*, bool)' > /tmp/llvm-build/2.7/llvm-objects/tools/llvm-dis/Release/llvm-dis.o(.text+0xb2): > In function `main': > : undefined reference to > `llvm::MemoryBuffer::getFileOrSTDIN(llvm::StringRef, > std::basic_string<char, std::char_traits<char>, std::allocator<char> >*, > long long)' > /tmp/llvm-build/2.7/llvm-objects/tools/llvm-dis/Release/llvm-dis.o(.text+0xcd): > In function `main': > : undefined reference to `llvm::ParseBitcodeFile(llvm::MemoryBuffer*, > llvm::LLVMContext&, std::basic_string<char, std::char_traits<char>, > std::allocator<char> >*)' > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
Jeffrey Yasskin wrote:> --enable-shared was _created_ in 2.7. If you were passing it in 2.6 or > earlier, it wasn't doing what you expected. >It's description in online documentation appeared long before 2.7 was released, which caused me to believe it that this feature was present in 2.6. But I never tied to use the shared library anyway.> 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? >I am on FreeBSD-8.0 i386. I tried it with gcc-4.3.1 and it also breaks the build: <...skipped...> llvm[2]: Linking Release executable llvm-as (without symbols) /tmp/llvm-build/2.7/llvm-objects/tools/llvm-ranlib/Release/llvm-ranlib.o(.text+0x1fc): In function `__static_initialization_and_destruction_0(int, int)': : undefined reference to `vtable for llvm::cl::opt<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, false, llvm::cl::parser<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >' /tmp/llvm-build/2.7/llvm-objects/tools/llvm-ranlib/Release/llvm-ranlib.o(.text+0x20b): In function `__static_initialization_and_destruction_0(int, int)': : undefined reference to `vtable for llvm::cl::parser<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >' <...skipped...> Yuri
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
Apparently Analagous 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?