msys2 / MINGW-packages

Package scripts for MinGW-w64 targets to build under MSYS2.
https://packages.msys2.org
BSD 3-Clause "New" or "Revised" License
2.29k stars 1.22k forks source link

32-bit Mesa software renderer crashes. Possibly never worked before #2089

Closed pal1000 closed 6 years ago

pal1000 commented 7 years ago

Quick test. Download PPSSPP (either dev build or stable) and drop mesa dll(s) in the extracted folder. Attempt to run PPSSPP will lead to an instant crash. 64-bit Mesa and PPSSPP work just fine. I tested most versions available on Sourceforge from 10.6.2 to latest 13.0.3. Other programs I was able to replicate with are:

pal1000 commented 7 years ago

QTCreator for Windows includes a 32-bit build of llvmpipe that works as expected but it is really out of date. More direct downloads for various versions are available here. It appears they used Arch Linux to build mesa 10.x according to this, now they switched to Windows exclusive using Visual Studio 2015 and various cross-platform libraries and compilers.

pal1000 commented 7 years ago

I was able to build it with Visual Studio 2015 following the tutorial I linked on my previous post and is working as expected, The only caveat is I had to build it with LLVM 3.7.1. Any newer version of LLVM fails to link (known issue), the fix has landed in time for upcoming Mesa 17, though. So the problem is definitely with MSYS2 cross-compiling. The only dependency I took from MSYS2 was m4.

Alexpux commented 7 years ago

Issue maybe in GCC dwarf exceptions.

pal1000 commented 7 years ago

Mingw build of Mesa 17.0.0 is still affected.

mati865 commented 7 years ago

@pal1000 is the osmesa.pc file used when building PPSSPP? It contains path to 64 bit libs.

I'll try to look into it but cannot promise anything.

pal1000 commented 7 years ago

PPSSPP doesn't seam to use osmesa anywhere. I searched for osmesa in the source code both with Windows Explorer (search file contents) and Visual Studio entire solution and both searches returned nothing.
Actually for 64-bit PPSSPP to work I need neither osmesa.dll nor graw.dll. I'll test Desmume Nintendo DS emulator, I am curious how that behaves.

pal1000 commented 7 years ago

Tested Desmume and is affected in similar fashion. Desmume works initially (with default 3D settings) because it uses a software rasterier, but as soon as I switch to OpenGL (either old or new) it crashes right away, actually you can't even get the configuration to stick because Desmume attempts to load OpenGL right away. Additionally in the Command Prompt like log console it appears that Desmume doesn't even identify Mesa virtual GPU, says it is unknown. Since it crashes so early you don't even need any Nintendo DS game to replicate.

mati865 commented 7 years ago

This can put some light on this issue: https://sourceforge.net/p/mingw-w64/bugs/599/ Adding -fno-omit-frame-pointer or specifying -O1 should get rid of the crashes.

pal1000 commented 7 years ago

GCC 4.9 may be affected as well. I tested old GCC 4.9 builds from here: https://sourceforge.net/projects/msys2/files/REPOS/MINGW_GCC_4_9/i686/ The oldest - 10.0.0 is not affected, but the newest 10.6.0 is. What's interestingly different about 10.0.0 is that it was built without LLVM, so it only includes the very slowest softpipe driver. I will do a sort-of bisecting soon.

pal1000 commented 6 years ago

The build of Mesa 17.3.3 i686 is working as expected. Finally this long standing issue has been fixed.

sezero commented 6 years ago

It would be good to know precisely what fixed it.

pal1000 commented 6 years ago

Migration to GCC 7.2.0 and up. It may share root cause with #2271.

revelator commented 2 years ago

hmm it seems to be back with gcc-11.2.0 32 bit crashes 64 bit works.