Моя цель скомпилировать mesa полностью статически. Первое препятствие я преодолел, смог скомпилировать LLVM статически только внося правки в build.ninja. Теперь мне надо убрать зависимости от libgcc и libstdc++.
Пишу я значит:
meson build <аргемуненты> -Dllvm=true -Dshared-llvm=false
ninja -C build
[912/912] Linking target src/gallium/targets/libgl-xlib/libGL.so.1.5.0.
FAILED: src/gallium/targets/libgl-xlib/libGL.so.1.5.0
c++ -o src/gallium/targets/libgl-xlib/libGL.so.1.5.0 'src/gallium/targets/libgl-xlib/a6bea21@@GL@sha/xlib.c.o' -Wl,--no-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,libGL.so.1 src/gallium/state_trackers/glx/xlib/libxlib.a src/gallium/winsys/sw/xlib/libws_xlib.a src/mapi/glapi/libglapi_static.a src/gallium/auxiliary/libgallium.a src/compiler/glsl/libglsl.a src/compiler/glsl/glcpp/libglcpp.a src/util/libmesa_util.a src/compiler/nir/libnir.a src/compiler/libcompiler.a src/mesa/libmesa_gallium.a src/mesa/libmesa_sse41.a src/gallium/drivers/llvmpipe/libllvmpipe.a src/gallium/drivers/softpipe/libsoftpipe.a -Wl,-Bsymbolic -Wl,--gc-sections -Wl,--version-script /home/xdroid/Desktop/mesa/src/gallium/targets/libgl-xlib/libgl-xlib.sym -pthread /usr/lib/i386-linux-gnu/libX11.so /usr/lib/i386-linux-gnu/libXext.so /usr/lib/i386-linux-gnu/libxcb.so -L/usr/lib/llvm-8/lib -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMGlobalISel -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMX86Desc -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMMCJIT -lLLVMExecutionEngine -lLLVMTarget -lLLVMAnalysis -lLLVMProfileData -lLLVMRuntimeDyld -lLLVMObject -lLLVMMCParser -lLLVMBitReader -lLLVMCore -lLLVMMCDisassembler -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMDebugInfoMSF -lLLVMBinaryFormat -lLLVMSupport -lLLVMDemangle /usr/lib/i386-linux-gnu/libz.so -L/usr/lib/llvm-8/lib -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMGlobalISel -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMX86Desc -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMMCJIT -lLLVMExecutionEngine -lLLVMTarget -lLLVMAnalysis -lLLVMProfileData -lLLVMRuntimeDyld -lLLVMObject -lLLVMMCParser -lLLVMBitReader -lLLVMCore -lLLVMMCDisassembler -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMDebugInfoMSF -lLLVMBinaryFormat -lLLVMSupport -lLLVMDemangle -Wl,--end-group '-Wl,-rpath,$ORIGIN/../../state_trackers/glx/xlib:$ORIGIN/../../winsys/sw/xlib:$ORIGIN/../../../mapi/glapi:$ORIGIN/../../auxiliary:$ORIGIN/../../../compiler/glsl:$ORIGIN/../../../compiler/glsl/glcpp:$ORIGIN/../../../util:$ORIGIN/../../../compiler/nir:$ORIGIN/../../../compiler:$ORIGIN/../../../mesa:$ORIGIN/../../drivers/llvmpipe:$ORIGIN/../../drivers/softpipe' -Wl,-rpath-link,/home/xdroid/Desktop/mesa/build/src/gallium/state_trackers/glx/xlib -Wl,-rpath-link,/home/xdroid/Desktop/mesa/build/src/gallium/winsys/sw/xlib -Wl,-rpath-link,/home/xdroid/Desktop/mesa/build/src/mapi/glapi -Wl,-rpath-link,/home/xdroid/Desktop/mesa/build/src/gallium/auxiliary -Wl,-rpath-link,/home/xdroid/Desktop/mesa/build/src/compiler/glsl -Wl,-rpath-link,/home/xdroid/Desktop/mesa/build/src/compiler/glsl/glcpp -Wl,-rpath-link,/home/xdroid/Desktop/mesa/build/src/util -Wl,-rpath-link,/home/xdroid/Desktop/mesa/build/src/compiler/nir -Wl,-rpath-link,/home/xdroid/Desktop/mesa/build/src/compiler -Wl,-rpath-link,/home/xdroid/Desktop/mesa/build/src/mesa -Wl,-rpath-link,/home/xdroid/Desktop/mesa/build/src/gallium/drivers/llvmpipe -Wl,-rpath-link,/home/xdroid/Desktop/mesa/build/src/gallium/drivers/softpipe -lz -ltinfo -lrt -ldl -lpthread -lm -static-libstdc++ -static-libgcc
/usr/lib/llvm-8/lib/libLLVMSupport.a(Timer.cpp.o): In function llvm::CreateInfoOutputFile()': Timer.cpp:(.text._ZN4llvm20CreateInfoOutputFileEv+0x78): undefined reference tostd::system_category()'
/usr/lib/llvm-8/lib/libLLVMX86CodeGen.a(X86InsertPrefetch.cpp.o): In function (anonymous namespace)::X86InsertPrefetch::runOnMachineFunction(llvm::MachineFunction&)': X86InsertPrefetch.cpp:(.text._ZN12_GLOBAL__N_117X86InsertPrefetch20runOnMachineFunctionERN4llvm15MachineFunctionE+0x4d9): undefined reference tostd::system_category()'
X86InsertPrefetch.cpp:(.text._ZN12_GLOBAL__N_117X86InsertPrefetch20runOnMachineFunctionERN4llvm15MachineFunctionE+0x82e): undefined reference to `std::system_category()'
........
/usr/lib/llvm-8/lib/libLLVMObject.a(WasmObjectFile.cpp.o):WasmObjectFile.cpp:(.text._ZNK4llvm6object14WasmObjectFile18getSectionContentsENS0_11DataRefImplERNS_9StringRefE+0x39): more undefined references to std::system_category()' follow /usr/lib/llvm-8/lib/libLLVMDebugInfoCodeView.a(CodeViewError.cpp.o): In functionCodeViewErrorCategory::~CodeViewErrorCategory()':
CodeViewError.cpp:(.text._ZN21CodeViewErrorCategoryD0Ev[_ZN21CodeViewErrorCategoryD0Ev]+0x17): undefined reference to std::error_category::~error_category()' /usr/lib/llvm-8/lib/libLLVMDebugInfoCodeView.a(CodeViewError.cpp.o):(.data.rel.ro._ZTV21CodeViewErrorCategory[_ZTV21CodeViewErrorCategory]+0x8): undefined reference tostd::error_category::~error_category()'
/usr/lib/llvm-8/lib/libLLVMDebugInfoCodeView.a(CodeViewError.cpp.o):(.data.rel.ro._ZTV21CodeViewErrorCategory[_ZTV21CodeViewErrorCategory]+0x18): undefined reference to std::error_category::default_error_condition(int) const' /usr/lib/llvm-8/lib/libLLVMDebugInfoCodeView.a(CodeViewError.cpp.o):(.data.rel.ro._ZTV21CodeViewErrorCategory[_ZTV21CodeViewErrorCategory]+0x1c): undefined reference tostd::error_category::equivalent(int, std::error_condition const&) const'
/usr/lib/llvm-8/lib/libLLVMDebugInfoCodeView.a(CodeViewError.cpp.o):(.data.rel.ro._ZTV21CodeViewErrorCategory[_ZTV21CodeViewErrorCategory]+0x20): undefined reference to std::error_category::equivalent(std::error_code const&, int) const' /usr/lib/llvm-8/lib/libLLVMDebugInfoCodeView.a(CodeViewError.cpp.o):(.data.rel.ro._ZTI21CodeViewErrorCategory[_ZTI21CodeViewErrorCategory]+0x8): undefined reference totypeinfo for std::error_category'
/usr/lib/llvm-8/lib/libLLVMSupport.a(Memory.cpp.o): In function llvm::sys::Memory::allocateMappedMemory(unsigned int, llvm::sys::MemoryBlock const*, unsigned int, std::error_code&)': Memory.cpp:(.text._ZN4llvm3sys6Memory20allocateMappedMemoryEjPKNS0_11MemoryBlockEjRSt10error_code+0x20): undefined reference tostd::system_category()'
Memory.cpp:(.text._ZN4llvm3sys6Memory20allocateMappedMemoryEjPKNS0_11MemoryBlockEjRSt10error_code+0x143): undefined reference to std::generic_category()' /usr/lib/llvm-8/lib/libLLVMSupport.a(Memory.cpp.o): In functionllvm::sys::Memory::protectMappedMemory(llvm::sys::MemoryBlock const&, unsigned int)':
Memory.cpp:(.text._ZN4llvm3sys6Memory19protectMappedMemoryERKNS0_11MemoryBlockEj+0x89): undefined reference to std::generic_category()' Memory.cpp:(.text._ZN4llvm3sys6Memory19protectMappedMemoryERKNS0_11MemoryBlockEj+0x92): undefined reference tostd::generic_category()'
Memory.cpp:(.text._ZN4llvm3sys6Memory19protectMappedMemoryERKNS0_11MemoryBlockEj+0xbe): undefined reference to std::system_category()' /usr/lib/llvm-8/lib/libLLVMSupport.a(Memory.cpp.o): In functionllvm::sys::Memory::releaseMappedMemory(llvm::sys::MemoryBlock&)':
Memory.cpp:(.text._ZN4llvm3sys6Memory19releaseMappedMemoryERNS0_11MemoryBlockE+0x3d): undefined reference to std::generic_category()' Memory.cpp:(.text._ZN4llvm3sys6Memory19releaseMappedMemoryERNS0_11MemoryBlockE+0x59): undefined reference tostd::system_category()'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
xdroid@ubuntu:~/Desktop/mesa$