pal1000 / mesa-dist-win

Pre-built Mesa3D drivers for Windows
MIT License
864 stars 78 forks source link

Building gallium megadriver with mingw fails to link regex #79

Closed TheLastRar closed 2 years ago

TheLastRar commented 2 years ago

See following build output

"c++"  -o src/gallium/targets/wgl/libgallium_wgl.dll src/gallium/targets/wgl/libgallium_wgl.dll.p/wgl.c.obj "-Wl,--allow-shlib-undefined" "-Wl,-O1" "-shared" "../../src/gallium/targets/wgl/gallium_wgl.mingw.def" "-Wl,--start-group" "-Wl,--out-implib=src/gallium/targets/wgl/libgallium_wgl.dll.a" "-Wl,--whole-archive" "src/gallium/frontends/wgl/libwgl.a" "-Wl,--no-whole-archive" "-Wl,--nxcompat" "-Wl,--dynamicbase" "-static-libgcc" "-static-libstdc++" "-static" "-s" "src/gallium/auxiliary/libgallium.a" "src/compiler/nir/libnir.a" "src/compiler/libcompiler.a" "src/util/libmesa_util.a" "src/util/format/libmesa_format.a" "src/compiler/glsl/libglsl.a" "src/compiler/glsl/glcpp/libglcpp.a" "src/mesa/libmesa_gallium.a" "src/mesa/libmesa_common.a" "src/mesa/libmesa_sse41.a" "src/gallium/winsys/sw/gdi/libwsgdi.a" "src/mapi/glapi/libglapi_static.a" "src/gallium/drivers/llvmpipe/libllvmpipe.a" "src/gallium/drivers/softpipe/libsoftpipe.a" "src/gallium/drivers/zink/libzink.a" "src/util/libxmlconfig.a" "-Wl,--enable-stdcall-fixup" "-lws2_32" "D:/Air/Source/ReadOnlyRepos/mesa-build/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/10.3.0/../../../../lib/libz.a" "-pthread" "-lm" "-lpthread" "-LD:/Air/Source/ReadOnlyRepos/mesa-build/msys64/mingw32/lib" "-lLLVMCoroutines" "-lLLVMipo" "-lLLVMInstrumentation" "-lLLVMVectorize" "-lLLVMLinker" "-lLLVMIRReader" "-lLLVMAsmParser" "-lLLVMFrontendOpenMP" "-lLLVMX86Disassembler" "-lLLVMX86AsmParser" "-lLLVMX86CodeGen" "-lLLVMCFGuard" "-lLLVMGlobalISel" "-lLLVMX86Desc" "-lLLVMX86Info" "-lLLVMSelectionDAG" "-lLLVMAsmPrinter" "-lLLVMDebugInfoDWARF" "-lLLVMMCJIT" "-lLLVMMCDisassembler" "-lLLVMInterpreter" "-lLLVMExecutionEngine" "-lLLVMRuntimeDyld" "-lLLVMCodeGen" "-lLLVMTarget" "-lLLVMScalarOpts" "-lLLVMInstCombine" "-lLLVMAggressiveInstCombine" "-lLLVMTransformUtils" "-lLLVMBitWriter" "-lLLVMAnalysis" "-lLLVMProfileData" "-lLLVMObject" "-lLLVMTextAPI" "-lLLVMMCParser" "-lLLVMMC" "-lLLVMDebugInfoCodeView" "-lLLVMDebugInfoMSF" "-lLLVMBitReader" "-lLLVMCore" "-lLLVMRemarks" "-lLLVMBitstreamReader" "-lLLVMBinaryFormat" "-lLLVMSupport" "-lLLVMDemangle" "-lpsapi" "-lshell32" "-lole32" "-luuid" "-ladvapi32" "-lz" "-lxml2" "-LD:/Air/Source/ReadOnlyRepos/mesa-build/msys64/mingw32/lib" "-lLLVMCoroutines" "-lLLVMipo" "-lLLVMInstrumentation" "-lLLVMVectorize" "-lLLVMLinker" "-lLLVMIRReader" "-lLLVMAsmParser" "-lLLVMFrontendOpenMP" "-lLLVMX86Disassembler" "-lLLVMX86AsmParser" "-lLLVMX86CodeGen" "-lLLVMCFGuard" "-lLLVMGlobalISel" "-lLLVMX86Desc" "-lLLVMX86Info" "-lLLVMSelectionDAG" "-lLLVMAsmPrinter" "-lLLVMDebugInfoDWARF" "-lLLVMMCJIT" "-lLLVMMCDisassembler" "-lLLVMInterpreter" "-lLLVMExecutionEngine" "-lLLVMRuntimeDyld" "-lLLVMCodeGen" "-lLLVMTarget" "-lLLVMScalarOpts" "-lLLVMInstCombine" "-lLLVMAggressiveInstCombine" "-lLLVMTransformUtils" "-lLLVMBitWriter" "-lLLVMAnalysis" "-lLLVMProfileData" "-lLLVMObject" "-lLLVMTextAPI" "-lLLVMMCParser" "-lLLVMMC" "-lLLVMDebugInfoCodeView" "-lLLVMDebugInfoMSF" "-lLLVMBitReader" "-lLLVMCore" "-lLLVMRemarks" "-lLLVMBitstreamReader" "-lLLVMBinaryFormat" "-lLLVMSupport" "-lLLVMDemangle" "-lpsapi" "-lshell32" "-lole32" "-luuid" "-ladvapi32" "-lz" "-lxml2" "-lws2_32" "D:/Air/Source/ReadOnlyRepos/mesa-build/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/10.3.0/../../../../lib/libzstd.a" "-LD:/Air/Source/ReadOnlyRepos/mesa-build/msys64/mingw32/lib" "-lLLVMCoroutines" "-lLLVMipo" "-lLLVMInstrumentation" "-lLLVMVectorize" "-lLLVMLinker" "-lLLVMIRReader" "-lLLVMAsmParser" "-lLLVMFrontendOpenMP" "-lLLVMX86Disassembler" "-lLLVMX86AsmParser" "-lLLVMX86CodeGen" "-lLLVMCFGuard" "-lLLVMGlobalISel" "-lLLVMX86Desc" "-lLLVMX86Info" "-lLLVMSelectionDAG" "-lLLVMAsmPrinter" "-lLLVMDebugInfoDWARF" "-lLLVMMCJIT" "-lLLVMMCDisassembler" "-lLLVMInterpreter" "-lLLVMExecutionEngine" "-lLLVMRuntimeDyld" "-lLLVMCodeGen" "-lLLVMTarget" "-lLLVMScalarOpts" "-lLLVMInstCombine" "-lLLVMAggressiveInstCombine" "-lLLVMTransformUtils" "-lLLVMBitWriter" "-lLLVMAnalysis" "-lLLVMProfileData" "-lLLVMObject" "-lLLVMTextAPI" "-lLLVMMCParser" "-lLLVMMC" "-lLLVMDebugInfoCodeView" "-lLLVMDebugInfoMSF" "-lLLVMBitReader" "-lLLVMCore" "-lLLVMRemarks" "-lLLVMBitstreamReader" "-lLLVMBinaryFormat" "-lLLVMSupport" "-lLLVMDemangle" "-lpsapi" "-lshell32" "-lole32" "-luuid" "-ladvapi32" "-lz" "-lxml2" "-LD:\VulkanSDK\1.2.189.2/Lib32" "-lvulkan-1" "-lregex" "-lregex" "-lkernel32" "-luser32" "-lgdi32" "-lwinspool" "-loleaut32" "-lcomdlg32" "-Wl,--end-group"
D:/Air/Source/ReadOnlyRepos/mesa-build/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/10.3.0/../../../../i686-w64-mingw32/bin/ld.exe: D:/Air/Source/ReadOnlyRepos/mesa-build/msys64/mingw32/lib\libregex.a(systre.o):(.text+0x1): undefined reference to `tre_regcomp'
D:/Air/Source/ReadOnlyRepos/mesa-build/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/10.3.0/../../../../i686-w64-mingw32/bin/ld.exe: D:/Air/Source/ReadOnlyRepos/mesa-build/msys64/mingw32/lib\libregex.a(systre.o):(.text+0x11): undefined reference to `tre_regfree'
D:/Air/Source/ReadOnlyRepos/mesa-build/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/10.3.0/../../../../i686-w64-mingw32/bin/ld.exe: D:/Air/Source/ReadOnlyRepos/mesa-build/msys64/mingw32/lib\libregex.a(systre.o):(.text+0x21): undefined reference to `tre_regerror'
D:/Air/Source/ReadOnlyRepos/mesa-build/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/10.3.0/../../../../i686-w64-mingw32/bin/ld.exe: D:/Air/Source/ReadOnlyRepos/mesa-build/msys64/mingw32/lib\libregex.a(systre.o):(.text+0x31): undefined reference to `tre_regexec'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: cannot make progress due to previous errors.

I can see that lavapipe have a fix for this in your buildscripts, It seems Zink also needs the same build fix.

pal1000 commented 2 years ago

It's not just zink, @TheLastRar. It appears to affect gallium megadriver as a whole. gallium megadriver is a new feature in 21.3. Basically Mesa OpenGL drivers stack has been split into its 2 components, gallium megadriver and WGL loader respectively. I personally believe this issue started when driconf support was brought to Windows.