commit 470381d40e6804b9c5de13556c9e60a6b9685a89 from: shrub date: Tue Mar 31 12:29:36 2026 UTC orcjit + stop dlopening commit - ac9b16a522f0c2fb288fd3c55d10b58f95f7be84 commit + 470381d40e6804b9c5de13556c9e60a6b9685a89 blob - ec37b14710614e0f31d454727768b4533db211e9 blob + 1583df7c5ad89ffbbc1674d99a20661f1f47555e --- lib/mesa/0001-static-lavapipe.patch +++ lib/mesa/0001-static-lavapipe.patch @@ -1,5 +1,5 @@ diff --git a/meson.build b/meson.build -index 5eaae977f67..f9023c9b402 100644 +index 5eaae97..f9023c9 100644 --- a/meson.build +++ b/meson.build @@ -1928,8 +1928,7 @@ if dep_llvm.found() @@ -48,21 +48,48 @@ index 5eaae977f67..f9023c9b402 100644 endif # Even if we find OpenMP, Gitlab CI fails to link with gcc/i386 and clang/anyarch. -diff --git a/src/gallium/auxiliary/draw/draw_context.c b/src/gallium/auxiliary/draw/draw_context.c -index 6bd9f58a1d1..c09dd709eb4 100644 ---- a/src/gallium/auxiliary/draw/draw_context.c -+++ b/src/gallium/auxiliary/draw/draw_context.c -@@ -57,7 +57,7 @@ bool - draw_get_option_use_llvm(void) - { - #if DRAW_LLVM_AVAILABLE -- return debug_get_bool_option("DRAW_USE_LLVM", true); -+ return debug_get_bool_option("DRAW_USE_LLVM", false); - #else - return false; - #endif +diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init_orc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_init_orc.cpp +index 16357fb..0e1f520 100644 +--- a/src/gallium/auxiliary/gallivm/lp_bld_init_orc.cpp ++++ b/src/gallium/auxiliary/gallivm/lp_bld_init_orc.cpp +@@ -320,6 +320,26 @@ LLVMErrorRef module_transform_wrapper( + return LLVMOrcThreadSafeModuleWithModuleDo(*ModInOut, *module_transform, Ctx); + } + ++static llvm::Expected ++lpjit_create_static_process_symbols_jd(llvm::orc::LLJIT &J) ++{ ++ using llvm::orc::JITDylibSP; ++ ++ auto &ES = J.getExecutionSession(); ++ auto &JD = ES.createBareJITDylib("process_symbols"); ++ ++ /* ok, so lljit normally wires the process-symbols jitdylib to a ++ * DynamicLibrarySearchGenerator, which resolves the symbold through dlopen(NULL) ++ * for static we still need the process symbols jitdylib itself ++ * but we need definitions to come from explicit add_mapping_to_jd() ++ * calls instead of the host process loader ++ * ++ * this might mean we have to defin some external symbols in the future, ++ * if some new helper is called, and no one maps it ++ */ ++ return JITDylibSP(&JD); ++} ++ + LPJit::LPJit() :jit_dylib_count(0) { + using namespace llvm::orc; + +@@ -337,6 +357,8 @@ LPJit::LPJit() :jit_dylib_count(0) { + lljit = ExitOnErr( + LLJITBuilder() + .setJITTargetMachineBuilder(std::move(JTMB)) ++ .setLinkProcessSymbolsByDefault(true) ++ .setProcessSymbolsJITDylibSetup(*lpjit_create_static_process_symbols_jd) + #ifdef USE_JITLINK + .setObjectLinkingLayerCreator( + #if LLVM_VERSION_MAJOR >= 21 diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp -index ce8ca02bf74..5689dcfeb4a 100644 +index ce8ca02..5689dcf 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp +++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp @@ -599,6 +599,9 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT, @@ -96,21 +123,8 @@ index ce8ca02bf74..5689dcfeb4a 100644 *OutError = strdup(Error.c_str()); return 1; } -diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c -index 2b71e1bfffb..4a23ff7dd05 100644 ---- a/src/gallium/drivers/llvmpipe/lp_screen.c -+++ b/src/gallium/drivers/llvmpipe/lp_screen.c -@@ -140,7 +140,7 @@ llvmpipe_init_shader_caps(struct pipe_screen *screen) - case MESA_SHADER_GEOMETRY: - draw_init_shader_caps(caps); - -- if (debug_get_bool_option("DRAW_USE_LLVM", true)) { -+ if (debug_get_bool_option("DRAW_USE_LLVM", false)) { - c