Created attachment 46283 [details] [review] link to shared llvm I am providing an Ubuntu PPA to enable some mesa features (e.g. llvm support) not available in the Ubuntu version: https://launchpad.net/~oibaf/+archive/graphics-drivers/ Mesa defaults to use static llvm libraries and this creates huge packages (+10MB for every file using it). I am using the attached patch to link to shared llvm library. Maybe it could be used when specifying a configure flag or be the default if the availability of the shared llvm is detected.
Actually it's LLVM itself that causes linking to static libraries via llvm-config even when built with enable shared due to LLVM bug 6823. http://llvm.org/bugs/show_bug.cgi?id=6823
Created attachment 52030 [details] [review] link to shared llvm Updated patch for current mesa git.
So with this patch we'll try to link with a file name libLLVM-x.y.so? I only have static LLVM libs here and there's no libLLVM-2.9.so file. I get this error: /usr/bin/ld: cannot find -lLLVM-2.9 I think the patch needs to somehow determine if we're linking with static vs. shared libs.
Created attachment 52118 [details] [review] LLVM should prefer shared libraries. Please try this patch on LLVM. It should also work if you patch /usr/bin/llvm-config (maybe other path on your system?). Then you do not have to recompile LLVM ...
(In reply to comment #3) > So with this patch we'll try to link with a file name libLLVM-x.y.so? I only > have static LLVM libs here and there's no libLLVM-2.9.so file. I get this > error: > > /usr/bin/ld: cannot find -lLLVM-2.9 > > I think the patch needs to somehow determine if we're linking with static vs. > shared libs. Yes, the patch should eventually check that, or it also may be eventually forced with a configure flag (--force-shared-llvm ?). Anyway it would be useful to have it in mesa.
(In reply to comment #4) > Created attachment 52118 [details] [review] [review] > LLVM should prefer shared libraries. > > Please try this patch on LLVM. > > It should also work if you patch /usr/bin/llvm-config (maybe other path on your > system?). Then you do not have to recompile LLVM ... I applied this patch on my llvm-config (llvm 2.8 on Ubuntu 11.04) but it doesn't change anything. The output of "llvm-config --libs" is the same with or without the patch: $ llvm-config --libs -lLLVMpic16passes -lLLVMMCDisassembler -lLLVMXCoreCodeGen -lLLVMXCoreAsmPrinter -lLLVMXCoreInfo -lLLVMSystemZCodeGen -lLLVMSystemZAsmPrinter -lLLVMSystemZInfo -lLLVMSparcCodeGen -lLLVMSparcAsmPrinter -lLLVMSparcInfo -lLLVMPowerPCCodeGen -lLLVMPowerPCAsmPrinter -lLLVMPowerPCInfo -lLLVMPIC16AsmPrinter -lLLVMPIC16CodeGen -lLLVMPIC16Info -lLLVMMipsAsmPrinter -lLLVMMipsCodeGen -lLLVMMipsInfo -lLLVMMSP430CodeGen -lLLVMMSP430AsmPrinter -lLLVMMSP430Info -lLLVMMBlazeAsmPrinter -lLLVMMBlazeCodeGen -lLLVMMBlazeInfo -lLLVMLinker -lLLVMipo -lLLVMInterpreter -lLLVMInstrumentation -lLLVMJIT -lLLVMExecutionEngine -lLLVMCppBackend -lLLVMCppBackendInfo -lLLVMCellSPUCodeGen -lLLVMCellSPUAsmPrinter -lLLVMCellSPUInfo -lLLVMCBackend -lLLVMCBackendInfo -lLLVMBlackfinCodeGen -lLLVMBlackfinAsmPrinter -lLLVMBlackfinInfo -lLLVMBitWriter -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMX86AsmPrinter -lLLVMX86Info -lLLVMAsmParser -lLLVMARMDisassembler -lLLVMARMAsmParser -lLLVMARMCodeGen -lLLVMARMAsmPrinter -lLLVMARMInfo -lLLVMArchive -lLLVMBitReader -lLLVMAlphaCodeGen -lLLVMSelectionDAG -lLLVMAlphaAsmPrinter -lLLVMAsmPrinter -lLLVMMCParser -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMCore -lLLVMAlphaInfo -lLLVMSupport -lLLVMSystem -L/usr/lib/llvm-2.8/lib
Created attachment 53185 [details] [review] link to shared llvm Updated patch for current mesa git
Fixed with 7d87c71a70c95d4fe3a94676128fd9524f048112 .
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.