[LLVMdev] Is the option --enable-shared discontinued in 2.7?

Jeffrey Yasskin jyasskin at google.com
Wed May 5 13:52:00 PDT 2010


On Tue, May 4, 2010 at 5:31 PM, Yuri <yuri at tsoft.com> wrote:
> Jeffrey Yasskin wrote:
>>>
>>> Would you try the patch at
>>> http://codereview.appspot.com/download/issue968046_1.diff? It should
>>> make the BSDs fall into the same path as Linux, and since you use gnu
>>> ld, that should work for you.
>>>
>>
>> Ping?
>>
>
>
> Sorry for the delay.
>
> Here is what I am getting after applying the patch:
> gmake[2]: Leaving directory `/tmp/llvm-build/2.7/llvm-objects/lib/CodeGen'
> gmake[1]: Leaving directory `/tmp/llvm-build/2.7/llvm-objects/lib'
> gmake[1]: Entering directory
> `/tmp/llvm-build/2.7/llvm-objects/tools/llvm-shlib'
> llvm[1]: Linking Release Shared Library LLVM-2.7.so
> /tmp/llvm-build/2.7/llvm-objects/Release/lib/libLLVMARMAsmParser.a(ARMAsmParser.o)(.text+0x135):
> In function `(anonymous
> namespace)::ARMAsmParser::ParseDirective(llvm::AsmToken)':
> : undefined reference to `__assert'
> /tmp/llvm-build/2.7/llvm-objects/Release/lib/libLLVMARMAsmParser.a(ARMAsmParser.o)(.text+0x3e3):
> In function `(anonymous
> namespace)::ARMAsmParser::ParseDirective(llvm::AsmToken)':
> : undefined reference to `__assert'
> /tmp/llvm-build/2.7/llvm-objects/Release/lib/libLLVMARMAsmParser.a(ARMAsmParser.o)(.text+0x5d8):
> In function `(anonymous
> namespace)::ARMAsmParser::ParseDirective(llvm::AsmToken)':
> : undefined reference to `__assert'
> /tmp/llvm-build/2.7/llvm-objects/Release/lib/libLLVMARMAsmParser.a(ARMAsmParser.o)(.text+0xd10):
> In function `(anonymous
> namespace)::ARMAsmParser::MatchRegisterName(llvm::StringRef const&)':
> : undefined reference to `memcmp'
> /tmp/llvm-build/2.7/llvm-objects/Release/lib/libLLVMARMAsmParser.a(ARMAsmParser.o)(.text+0xd45):
> In function `(anonymous
> namespace)::ARMAsmParser::MatchRegisterName(llvm::StringRef const&)':
> : undefined reference to `memcmp'
> /tmp/llvm-build/2.7/llvm-objects/Release/lib/libLLVMARMAsmParser.a(ARMAsmParser.o)(.text+0xd6d):
> In function `(anonymous
> namespace)::ARMAsmParser::MatchRegisterName(llvm::StringRef const&)':
> : undefined reference to `memcmp'
> /tmp/llvm-build/2.7/llvm-objects/Release/lib/libLLVMARMAsmParser.a(ARMAsmParser.o)(.text+0xdd5):
> In function `(anonymous
> namespace)::ARMAsmParser::MaybeParseRegister((anonymous
> namespace)::ARMOperand&, bool)':
> : undefined reference to `__assert'
>
> Linking command line was:
> /usr/local/gcc/4.5.0/bin/g++ -I/tmp/llvm-build/2.7/llvm-objects/include
> -I/tmp/llvm-build/2.7/llvm-objects/tools/llvm-shlib
> -I/tmp/llvm-build/2.7/llvm/include
> -I/tmp/llvm-build/2.7/llvm/tools/llvm-shlib  -D_DEBUG -D_GNU_SOURCE
> -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O2  -fno-exceptions
> -fno-rtti -fPIC -Woverloaded-virtual     -pedantic -Wno-long-long -Wall -W
> -Wno-unused-parameter -Wwrite-strings  -O2 -Wl,-R
> -Wl,/tmp/llvm-build/2.7/llvm-objects/Release/lib
> -L/tmp/llvm-build/2.7/llvm-objects/Release/lib
> -L/tmp/llvm-build/2.7/llvm-objects/Release/lib  -shared -o
> /tmp/llvm-build/2.7/llvm-objects/Release/lib/libLLVM-2.7.so
> -Wl,--whole-archive -lLLVMARMAsmParser -lLLVMARMAsmPrinter -lLLVMARMCodeGen
> -lLLVMARMInfo -lLLVMAlphaAsmPrinter -lLLVMAlphaCodeGen -lLLVMAlphaInfo
> -lLLVMAnalysis -lLLVMArchive -lLLVMAsmParser -lLLVMAsmPrinter
> -lLLVMBitReader -lLLVMBitWriter -lLLVMBlackfinAsmPrinter
> -lLLVMBlackfinCodeGen -lLLVMBlackfinInfo -lLLVMCBackend -lLLVMCBackendInfo
> -lLLVMCellSPUAsmPrinter -lLLVMCellSPUCodeGen -lLLVMCellSPUInfo -lLLVMCodeGen
> -lLLVMCore -lLLVMCppBackend -lLLVMCppBackendInfo -lLLVMExecutionEngine
> -lLLVMInstCombine -lLLVMInstrumentation -lLLVMInterpreter -lLLVMJIT
> -lLLVMLinker -lLLVMMBlazeAsmPrinter -lLLVMMBlazeCodeGen -lLLVMMBlazeInfo
> -lLLVMMC -lLLVMMCParser -lLLVMMSIL -lLLVMMSILInfo -lLLVMMSP430AsmPrinter
> -lLLVMMSP430CodeGen -lLLVMMSP430Info -lLLVMMipsAsmPrinter -lLLVMMipsCodeGen
> -lLLVMMipsInfo -lLLVMPIC16AsmPrinter -lLLVMPIC16CodeGen -lLLVMPIC16Info
> -lLLVMPowerPCAsmPrinter -lLLVMPowerPCCodeGen -lLLVMPowerPCInfo
> -lLLVMScalarOpts -lLLVMSelectionDAG -lLLVMSparcAsmPrinter -lLLVMSparcCodeGen
> -lLLVMSparcInfo -lLLVMSupport -lLLVMSystem -lLLVMSystemZAsmPrinter
> -lLLVMSystemZCodeGen -lLLVMSystemZInfo -lLLVMTarget -lLLVMTransformUtils
> -lLLVMX86AsmParser -lLLVMX86AsmPrinter -lLLVMX86CodeGen
> -lLLVMX86Disassembler -lLLVMX86Info -lLLVMXCoreAsmPrinter -lLLVMXCoreCodeGen
> -lLLVMXCoreInfo -lLLVMipa -lLLVMipo -lLLVMpic16passes -Wl,--no-whole-archive
> -Wl,--no-undefined -lpthread -lm
>
> Adding -lc in the end fixes the errors and produces the full size
> libLLVM-2.7.so.

That's odd. On Linux, g++ adds -lc to the end of the link line itself.
It must be adding -lstdc++ for you too, or you'd have more missing
symbols. If you run that command with "-v", it'll show you the actual
link line, but given your errors it does seem like -lc is missing. I
don't think it'll hurt anyone else to add that, so I'll try it.

I assume builds without --enable-shared do work for you? If so, I
wonder why g++ would omit -lc for shared links but not executable
links?

Jeffrey




More information about the llvm-dev mailing list