StephanTLavavej / mingw-distro

MinGW distro build scripts.
492 stars 55 forks source link

Issue Compiling libpng With GCC 8.1.0 #60

Closed MrM21632 closed 5 years ago

MrM21632 commented 6 years ago

Another issue that's arisen recently: libpng throws an error similar to this when compiling with GCC 8.1.0:

x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I../src     -O3 -s -MT contrib/libtests/pngvalid.o -MD -MP -MF $depbase.Tpo -c -o contrib/libtests/pngvalid.o ../src/contrib/libtests/pngvalid.c &&\
mv -f $depbase.Tpo $depbase.Po
C:\mingw_distro_setup\msys64\tmp\ccAnQqvS.s: Assembler messages:
C:\mingw_distro_setup\msys64\tmp\ccAnQqvS.s:33889: Error: .seh_savexmm offset is negative
C:\mingw_distro_setup\msys64\tmp\ccAnQqvS.s:33890: Error: .seh_savexmm offset is negative
C:\mingw_distro_setup\msys64\tmp\ccAnQqvS.s:33895: Error: .seh_savexmm offset is negative
C:\mingw_distro_setup\msys64\tmp\ccAnQqvS.s:33896: Error: .seh_savexmm offset is negative
make[1]: *** [Makefile:1159: contrib/libtests/pngvalid.o] Error 1
make[1]: Leaving directory '/c/mingw_distro_setup/build'

The current workaround is to pass -fno-asynchronous-unwind-tables to GCC when compiling, as per this bug report.

StephanTLavavej commented 6 years ago

Ugh, thanks for letting me know. This is also GCC Bug 86048.

MrM21632 commented 6 years ago

Oh, wow. I didn't even notice that bug report.

richardebel commented 6 years ago

Thanks. Simple C++ programs will compile successfully, but wont run(segment fault) without the GCC patch:

include

int main(){ std::cout << "Hello World\n"; std::cin.get(); return 0; }