[Mesa-dev] [PATCH] scons: Use LLVM shared library if found.
Aaron Watry
awatry at gmail.com
Fri May 17 14:18:26 PDT 2013
On Fri, May 17, 2013 at 2:31 PM, Jose Fonseca <jfonseca at vmware.com> wrote:
>
>
> ----- Original Message -----
>> On Fri, May 17, 2013 at 7:44 AM, Jose Fonseca <jfonseca at vmware.com> wrote:
>> > Vinson,
>> >
>> > Why is this necessary?
>> >
>> > (I'd prefer that LLVM is statically linked by default. )
>> >
>> > Jose
>>
>> The SCons build fails on systems that only provide a LLVM shared
>> library. 'llvm-config --libs' always enumerates the libraries instead
>> of providing the shared library on such systems.
>>
>> $ cat /etc/redhat-release
>> Fedora release 18 (Spherical Cow)
>> $ llvm-config --libs
>> -lLLVMAsmParser -lLLVMInstrumentation -lLLVMLinker -lLLVMArchive
>> -lLLVMBitReader -lLLVMDebugInfo -lLLVMJIT -lLLVMipo -lLLVMVectorize
>> -lLLVMBitWriter -lLLVMTableGen -lLLVMHexagonCodeGen -lLLVMHexagonDesc
>> -lLLVMHexagonAsmPrinter -lLLVMHexagonInfo -lLLVMNVPTXCodeGen
>> -lLLVMNVPTXDesc -lLLVMNVPTXInfo -lLLVMNVPTXAsmPrinter
>> -lLLVMMBlazeDisassembler -lLLVMMBlazeAsmParser -lLLVMMBlazeCodeGen
>> -lLLVMMBlazeDesc -lLLVMMBlazeInfo -lLLVMMBlazeAsmPrinter
>> -lLLVMCppBackendCodeGen -lLLVMCppBackendInfo -lLLVMMSP430CodeGen
>> -lLLVMMSP430Desc -lLLVMMSP430Info -lLLVMMSP430AsmPrinter
>> -lLLVMXCoreCodeGen -lLLVMXCoreDesc -lLLVMXCoreInfo
>> -lLLVMCellSPUCodeGen -lLLVMCellSPUDesc -lLLVMCellSPUInfo
>> -lLLVMMipsDisassembler -lLLVMMipsAsmParser -lLLVMMipsCodeGen
>> -lLLVMMipsDesc -lLLVMMipsInfo -lLLVMMipsAsmPrinter
>> -lLLVMARMDisassembler -lLLVMARMAsmParser -lLLVMARMCodeGen
>> -lLLVMARMDesc -lLLVMARMInfo -lLLVMARMAsmPrinter -lLLVMPowerPCCodeGen
>> -lLLVMPowerPCDesc -lLLVMPowerPCInfo -lLLVMPowerPCAsmPrinter
>> -lLLVMSparcCodeGen -lLLVMSparcDesc -lLLVMSparcInfo -lLLVMX86AsmParser
>> -lLLVMX86Disassembler -lLLVMX86CodeGen -lLLVMX86Desc -lLLVMX86Info
>> -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMR600CodeGen
>> -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMR600Desc -lLLVMR600Info
>> -lLLVMR600AsmPrinter -lLLVMMCDisassembler -lLLVMMCParser
>> -lLLVMInterpreter -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine
>> -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMMCJIT
>> -lLLVMRuntimeDyld -lLLVMExecutionEngine -lLLVMTarget -lLLVMMC
>> -lLLVMObject -lLLVMCore -lLLVMSupport
>> $ ls `llvm-config --libdir`
>> BugpointPasses.so libclang.so libLLVM-3.2svn.so libLTO.so
>> libprofile_rt.so LLVMgold.so
>
> Then Fedora 18's llvm-config is busted, as `llvm-config --libs` should return libLLVM-3.2svn.so
>
I'm using upstream llvm git master, and the shared library isn't
listed in llvm-config here either.
~/src/llvm$ llvm-config --libs
-lLLVMR600CodeGen -lLLVMR600Desc -lLLVMR600Info -lLLVMR600AsmPrinter
-lLLVMTableGen -lLLVMDebugInfo -lLLVMOption -lLLVMX86Disassembler
-lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMSelectionDAG
-lLLVMAsmPrinter -lLLVMX86Desc -lLLVMX86Info -lLLVMX86AsmPrinter
-lLLVMX86Utils -lLLVMIRReader -lLLVMAsmParser -lLLVMMCDisassembler
-lLLVMMCParser -lLLVMInstrumentation -lLLVMArchive -lLLVMBitReader
-lLLVMInterpreter -lLLVMipo -lLLVMVectorize -lLLVMLinker
-lLLVMBitWriter -lLLVMMCJIT -lLLVMJIT -lLLVMCodeGen -lLLVMObjCARCOpts
-lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa
-lLLVMAnalysis -lLLVMRuntimeDyld -lLLVMExecutionEngine -lLLVMTarget
-lLLVMMC -lLLVMObject -lLLVMCore -lLLVMSupport
~/src/llvm$ which llvm-config
/usr/local/bin/llvm-config
~/src/llvm$ ls /usr/local/lib/libLLVM*
/usr/local/lib/libLLVM-3.4svn.so
/usr/local/lib/libLLVMAnalysis.a
/usr/local/lib/libLLVMArchive.a
/usr/local/lib/libLLVMAsmParser.a
<snip>
I'm guessing that 'llvm-config --libs' is only listing static libraries
--Aaron
> So I believe this issue should be filled against Fedora, not worked around here. Honestly, only shipping LLVM in a .so is already a bad idea, but breaking llvm-config is even worse -- what the point of scripts like llvm-config if their output can't be trusted?
>
> BTW, configure.ac doesn't have this hack. Does it fail the same way too?
>
> Jose
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list