Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mingw32: exception handling broken (breaks ccache etc) #9771

Closed
mmuetzel opened this issue Oct 14, 2021 · 37 comments
Closed

mingw32: exception handling broken (breaks ccache etc) #9771

mmuetzel opened this issue Oct 14, 2021 · 37 comments

Comments

@mmuetzel
Copy link
Collaborator

ccache doesn't work with MINGW32/MSYS2.

Steps to reproduce on the 32-bit bash:

pacman -Syu
pacman -S mingw-w64-i686-ccache
ccache -s

Expected result:
The statistics for ccache should be displayed.

Actual result:

$ ccache -s
terminate called after throwing an instance of 'core::Error'
terminate called recursively

This was still working on CI builds running on Oct 12 8:50 CEDT.
First affected CI build is from Oct 13 4:30 CEDT.

@jeremyd2019
Copy link
Member

Sounds familiar. #9289

@lazka
Copy link
Member

lazka commented Oct 14, 2021

the last gcc/gcc-libs rebuild triggered this... somehow...

@lazka
Copy link
Member

lazka commented Oct 15, 2021

Restoring libstdc++-6.dll from mingw-w64-i686-gcc-libs-10.3.0-5 fixes the issue

@Alexpux
Copy link
Member

Alexpux commented Oct 15, 2021

so need to see build log difference whats going on to bisect issue

@lazka
Copy link
Member

lazka commented Oct 15, 2021

the logs of the old build are older than 90 days and have expired sadly

@Alexpux
Copy link
Member

Alexpux commented Oct 15, 2021

I will try rebuild locally. Im never use ccache as it lead to errors time to time

@lazka
Copy link
Member

lazka commented Oct 15, 2021

I tried rebuilding gcc locally, it didn't help.

@lazka
Copy link
Member

lazka commented Oct 15, 2021

c++ exception handling is broken in general... the simplest examples fail to catch. Restoring the old libstdc++-6.dll (from https://repo.msys2.org/mingw/mingw32/mingw-w64-i686-gcc-libs-10.3.0-5-any.pkg.tar.zst) makes things work again.

#include <iostream>

int main () {
   try {
      throw "OK";
   } catch (const char* msg) {
     std::cerr << msg << std::endl;
   }
   return 0;
}

@lazka lazka changed the title ccache fails on i686 mingw32: exception handling broken (breaks ccache etc) Oct 15, 2021
@lazka lazka pinned this issue Oct 15, 2021
@lazka
Copy link
Member

lazka commented Oct 16, 2021

here is a (broken) libstdc++-6 with symbols libstdc++-6.zip

since gdb is broken by this too, one needs to use msys gdb:

/usr/bin/gdb --args ccache -s
> catch throw
> run
> ...

This goes through a bunch of dwarf2 exception handling code, but I don't know how to debug this, maybe someone else does

$ /usr/bin/gdb --args ccache -s
GNU gdb (GDB) 10.2
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-msys".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ccache...
(No debugging symbols found in ccache)
(gdb) catch throw
Catchpoint 1 (throw)
(gdb) run
Starting program: /mingw32/bin/ccache -s
[New Thread 9608.0x1a48]
[New Thread 9608.0x3e08]
[New Thread 9608.0x3394]

Thread 1 hit Catchpoint 1 (exception thrown), __cxxabiv1::__cxa_throw (obj=0xe79d50, tinfo=0x10482fc, dest=0xfe16b0)
    at ../../../../gcc-10.3.0/libstdc++-v3/libsupc++/eh_throw.cc:80
80        __cxa_eh_globals *globals = __cxa_get_globals ();
(gdb) n
81        globals->uncaughtExceptions += 1;
(gdb) n
83        __cxa_refcounted_exception *header =
(gdb) n
85        header->referenceCount = 1;
(gdb) n
90        _Unwind_RaiseException (&header->exc.unwindHeader);
(gdb) n
94        __cxa_begin_catch (&header->exc.unwindHeader);
(gdb) n
95        std::terminate ();
(gdb) n
[Thread 9608.0x3394 exited with code 3]
[Thread 9608.0x3e08 exited with code 3]
[Thread 9608.0x1a48 exited with code 3]
terminate called after throwing an instance of 'core::Error'
terminate called recursively

Program terminated with signal SIGQUIT, Quit.
The program no longer exists.
(gdb) n

@lazka
Copy link
Member

lazka commented Oct 16, 2021

related upstream discussion: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100486

@revelator
Copy link
Contributor

so it now also affects the older build Oo omg...

@oscarfv
Copy link
Contributor

oscarfv commented Oct 16, 2021

This is deja vu all over again.

Read #4728 (comment) and subsequent comments.

Then notice msys2/MSYS2-packages@990d969#diff-73207f91bc9ff822e2e6fc6cf400758228873068eb53db6dff69c8c6c5a181a9

Maybe it is worth a shot.

@jeremyd2019
Copy link
Member

omg, is that the fallout of the issue with grep? 🤯

@lazka
Copy link
Member

lazka commented Oct 16, 2021

the timeline matches. thanks @oscarfv

@oscarfv
Copy link
Contributor

oscarfv commented Oct 16, 2021

After reverting grep to 3.0-2 and building i686 gcc 11.2 (without Ada), C++ exceptions seem to work fine again.

@Alexpux
Copy link
Member

Alexpux commented Oct 17, 2021

@oscarfv good catch, I'm not update grep because upstream remove support for handling Windows line endings. This is discussed in Msys-packages times ago. I think we need add some message about this into grep PKGBUILD.

@Alexpux
Copy link
Member

Alexpux commented Oct 17, 2021

For history look:
msys2/MSYS2-packages#1353
msys2/MSYS2-packages#2163

@revelator
Copy link
Contributor

urgh what a goosechase :S this turned out to be, good catch with the grep issue.

@revelator
Copy link
Contributor

revelator commented Oct 17, 2021

well one good thing or rather a bad one depending on how you look at it is that we can now do a bootstrap of gcc-11.1 but as before only using an sjlj compiler if you need ada support, exceptions should work in that build. but it might be prudent to wait on the results of the upstream bug report instead.

@lazka
Copy link
Member

lazka commented Oct 17, 2021

For completeness I tried to figure out why this is failing, but there are too many layers and build magic, so I give up:

rm -rf i686-w64-mingw32/libstdc++-v3
make all-target-libstdc++-v3 -j1
cp i686-w64-mingw32/libstdc++-v3/src/.libs/libstdc++-6.dll /mingw32/bin

is enough to fix it with the grep revert

Diff of the configure output:

--- broken.txt	2021-10-17 19:15:31.582312000 +0200
+++ ok.txt	2021-10-17 19:10:29.938561300 +0200
@@ -1058,7 +1057,7 @@
 libtool: compile:  /home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/./gcc/xgcc -shared-libgcc -B/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/./gcc -nostdinc++ -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src/.libs -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/libsupc++/.libs -L/mingw32/i686-w64-mingw32/lib -L/mingw32/lib -isystem /mingw32/i686-w64-mingw32/include -isystem /mingw32/include -B/mingw32/i686-w64-mingw32/bin/ -B/mingw32/i686-w64-mingw32/lib/ -isystem /mingw32/i686-w64-mingw32/include -isystem /mingw32/i686-w64-mingw32/sys-include -I/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/include/i686-w64-mingw32 -I/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/include -I/home/user/M/mingw-w64-gcc/src/gcc-10.3.0/libstdc++-v3/libsupc++ -I/mingw32/include -I/mingw32/include -std=gnu++98 -DDLL_EXPORT -DPIC -fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi=2 -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -frandom-seed=compatibility-condvar.lo -g -march=pentium4 -mtune=generic -O2 -pipe -std=gnu++11 -c ../../../../gcc-10.3.0/libstdc++-v3/src/c++11/compatibility-condvar.cc  -DDLL_EXPORT -DPIC -D_GLIBCXX_SHARED -o .libs/compatibility-condvar.o
 libtool: compile:  /home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/./gcc/xgcc -shared-libgcc -B/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/./gcc -nostdinc++ -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src/.libs -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/libsupc++/.libs -L/mingw32/i686-w64-mingw32/lib -L/mingw32/lib -isystem /mingw32/i686-w64-mingw32/include -isystem /mingw32/include -B/mingw32/i686-w64-mingw32/bin/ -B/mingw32/i686-w64-mingw32/lib/ -isystem /mingw32/i686-w64-mingw32/include -isystem /mingw32/i686-w64-mingw32/sys-include -I/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/include/i686-w64-mingw32 -I/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/include -I/home/user/M/mingw-w64-gcc/src/gcc-10.3.0/libstdc++-v3/libsupc++ -I/mingw32/include -I/mingw32/include -std=gnu++98 -DDLL_EXPORT -DPIC -fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi=2 -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -frandom-seed=compatibility-condvar.lo -g -march=pentium4 -mtune=generic -O2 -pipe -std=gnu++11 -c ../../../../gcc-10.3.0/libstdc++-v3/src/c++11/compatibility-condvar.cc -o compatibility-condvar.o >/dev/null 2>&1
 /bin/sh ../libtool --tag CXX   --mode=link /home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/./gcc/xgcc -shared-libgcc -B/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/./gcc -nostdinc++ -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src/.libs -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/libsupc++/.libs -L/mingw32/i686-w64-mingw32/lib -L/mingw32/lib -isystem /mingw32/i686-w64-mingw32/include -isystem /mingw32/include -B/mingw32/i686-w64-mingw32/bin/ -B/mingw32/i686-w64-mingw32/lib/ -isystem /mingw32/i686-w64-mingw32/include -isystem /mingw32/i686-w64-mingw32/sys-include     -Wl,-O1  -no-undefined -bindir "/mingw32/bin" -Wl,--gc-sections  -std=gnu++98 -DDLL_EXPORT -DPIC -fno-implicit-templates  -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi=2  -fdiagnostics-show-location=once   -ffunction-sections -fdata-sections  -frandom-seed=libstdc++.la  '-pipe' '-Wl,--dynamicbase,--nxcompat,--no-seh' '-Wl,--large-address-aware' -o libstdc++.la -version-info 6:28:0  -lm -rpath /mingw32/lib/../lib compatibility.lo compatibility-debug_list.lo compatibility-debug_list-2.lo  compatibility-c++0x.lo compatibility-atomic-c++0x.lo compatibility-thread-c++0x.lo compatibility-chrono.lo compatibility-condvar.lo  ../libsupc++/libsupc++convenience.la ../src/c++98/libc++98convenience.la ../src/c++11/libc++11convenience.la ../src/c++17/libc++17convenience.la 
-libtool: link:  /home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/./gcc/xgcc -shared-libgcc -B/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/./gcc -nostdinc++ -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src/.libs -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/libsupc++/.libs -L/mingw32/i686-w64-mingw32/lib -L/mingw32/lib -isystem /mingw32/i686-w64-mingw32/include -isystem /mingw32/include -B/mingw32/i686-w64-mingw32/bin/ -B/mingw32/i686-w64-mingw32/lib/ -isystem /mingw32/i686-w64-mingw32/include -isystem /mingw32/i686-w64-mingw32/sys-include    -shared -nostdlib C:/msys64/mingw32/i686-w64-mingw32/lib/dllcrt2.o C:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/gcc/crtbegin.o  .libs/compatibility.o .libs/compatibility-debug_list.o .libs/compatibility-debug_list-2.o .libs/compatibility-c++0x.o .libs/compatibility-atomic-c++0x.o .libs/compatibility-thread-c++0x.o .libs/compatibility-chrono.o .libs/compatibility-condvar.o  -Wl,--whole-archive ../libsupc++/.libs/libsupc++convenience.a ../src/c++98/.libs/libc++98convenience.a ../src/c++11/.libs/libc++11convenience.a ../src/c++17/.libs/libc++17convenience.a -Wl,--no-whole-archive  -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/libsupc++/.libs -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src/.libs -L/mingw32/i686-w64-mingw32/lib -L/mingw32/lib -LC:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src -LC:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src/.libs -LC:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/libsupc++/.libs -LC:/msys64/mingw32/i686-w64-mingw32/lib -LC:/msys64/mingw32/lib -LC:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/gcc -LC:/msys64/mingw32/i686-w64-mingw32/bin -LC:/msys64/mingw32/i686-w64-mingw32/lib/../lib -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -lkernel32 -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -lkernel32   -Wl,-O1 -Wl,--gc-sections -Wl,--dynamicbase -Wl,--nxcompat -Wl,--no-seh -Wl,--large-address-aware   -o .libs/libstdc++-6.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/libstdc++.dll.a
+libtool: link:  /home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/./gcc/xgcc -shared-libgcc -B/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/./gcc -nostdinc++ -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src/.libs -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/libsupc++/.libs -L/mingw32/i686-w64-mingw32/lib -L/mingw32/lib -isystem /mingw32/i686-w64-mingw32/include -isystem /mingw32/include -B/mingw32/i686-w64-mingw32/bin/ -B/mingw32/i686-w64-mingw32/lib/ -isystem /mingw32/i686-w64-mingw32/include -isystem /mingw32/i686-w64-mingw32/sys-include    -shared -nostdlib C:/msys64/mingw32/i686-w64-mingw32/lib/dllcrt2.o C:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/gcc/crtbegin.o  .libs/compatibility.o .libs/compatibility-debug_list.o .libs/compatibility-debug_list-2.o .libs/compatibility-c++0x.o .libs/compatibility-atomic-c++0x.o .libs/compatibility-thread-c++0x.o .libs/compatibility-chrono.o .libs/compatibility-condvar.o  -Wl,--whole-archive ../libsupc++/.libs/libsupc++convenience.a ../src/c++98/.libs/libc++98convenience.a ../src/c++11/.libs/libc++11convenience.a ../src/c++17/.libs/libc++17convenience.a -Wl,--no-whole-archive  -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/libsupc++/.libs -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src -L/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src/.libs -L/mingw32/i686-w64-mingw32/lib -L/mingw32/lib -LC:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src -LC:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src/.libs -LC:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/libsupc++/.libs -LC:/msys64/mingw32/i686-w64-mingw32/lib -LC:/msys64/mingw32/lib -LC:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/gcc -LC:/msys64/mingw32/i686-w64-mingw32/bin -LC:/msys64/mingw32/i686-w64-mingw32/lib/../lib -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -lkernel32 -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -lkernel32 C:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/gcc/crtend.o  -Wl,-O1 -Wl,--gc-sections -Wl,--dynamicbase -Wl,--nxcompat -Wl,--no-seh -Wl,--large-address-aware   -o .libs/libstdc++-6.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/libstdc++.dll.a
 libtool: link: (cd .libs/libstdc++.lax/libsupc++convenience.a && /mingw32/i686-w64-mingw32/bin/ar x "/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src/../libsupc++/.libs/libsupc++convenience.a")
 libtool: link: (cd .libs/libstdc++.lax/libc++98convenience.a && /mingw32/i686-w64-mingw32/bin/ar x "/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src/../src/c++98/.libs/libc++98convenience.a")
 libtool: link: (cd .libs/libstdc++.lax/libc++11convenience.a && /mingw32/i686-w64-mingw32/bin/ar x "/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src/../src/c++11/.libs/libc++11convenience.a")

Diff of the build dir (with some noise removed):

diff -Nur libstdc++-v3-broken/config.status libstdc++-v3/config.status
--- libstdc++-v3-broken/config.status	2021-10-17 18:44:48.811354600 +0200
+++ libstdc++-v3/config.status	2021-10-17 18:47:45.225970400 +0200
@@ -755,7 +755,7 @@
 hardcode_action_CXX='immediate'
 compiler_lib_search_dirs_CXX='C:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src C:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src/.libs C:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/libsupc++/.libs C:/msys64/mingw32/i686-w64-mingw32/lib C:/msys64/mingw32/lib C:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/gcc C:/msys64/mingw32/i686-w64-mingw32/bin C:/msys64/mingw32/i686-w64-mingw32/lib C:/msys64/mingw32/i686-w64-mingw32/lib/../lib C:/msys64/mingw32/i686-w64-mingw32/lib'
 predep_objects_CXX='C:/msys64/mingw32/i686-w64-mingw32/lib/dllcrt2.o C:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/gcc/crtbegin.o'
-postdep_objects_CXX=''
+postdep_objects_CXX='C:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/gcc/crtend.o'
 predeps_CXX=''
 postdeps_CXX=' -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -lkernel32 -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -lkernel32 '
 compiler_lib_search_path_CXX='-LC:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src -LC:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/src/.libs -LC:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/libsupc++/.libs -LC:/msys64/mingw32/i686-w64-mingw32/lib -LC:/msys64/mingw32/lib -LC:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/gcc -LC:/msys64/mingw32/i686-w64-mingw32/bin -LC:/msys64/mingw32/i686-w64-mingw32/lib -LC:/msys64/mingw32/i686-w64-mingw32/lib/../lib -LC:/msys64/mingw32/i686-w64-mingw32/lib'
diff -Nur libstdc++-v3-broken/libtool libstdc++-v3/libtool
--- libstdc++-v3-broken/libtool	2021-10-17 18:45:08.664364200 +0200
+++ libstdc++-v3/libtool	2021-10-17 18:48:05.241661100 +0200
@@ -9304,7 +9304,7 @@
 # Dependencies to place before and after the objects being linked to
 # create a shared library.
 predep_objects="C:/msys64/mingw32/i686-w64-mingw32/lib/dllcrt2.o C:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/gcc/crtbegin.o"
-postdep_objects=""
+postdep_objects="C:/msys64/home/user/M/mingw-w64-gcc/src/build-i686-w64-mingw32/gcc/crtend.o"
 predeps=""
 postdeps=" -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -lkernel32 -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -lkernel32 "

@revelator
Copy link
Contributor

well it seems to be still looked at @https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100486 so maybe a real fix will eventually crop up :)

@jeremyd2019

This comment has been minimized.

@jeremyd2019

This comment has been minimized.

@jeremyd2019
Copy link
Member

Oops, commented on wrong issue

@raedrizqie
Copy link
Contributor

There is a reference to dwarf exception in libstdc++ x86_64 IIRC

@lazka lazka unpinned this issue Oct 18, 2021
@lazka
Copy link
Member

lazka commented Oct 18, 2021

new build uploaded

@Jehan
Copy link

Jehan commented Oct 18, 2021

The issue seems fixed as far as we can see (some building which failed yesterday now works). But since I see it is still opened, I wanted to ask and make sure you consider it's really good to go now, or if we should wait a bit.

Because we were planning a release yesterday which we postponed because of this issue. Yet if there are still issues to figure out, we don't mind waiting a bit more (a bit late is better than discovering bad surprises at runtime for a release build).

@Biswa96
Copy link
Member

Biswa96 commented Oct 18, 2021

Releasing GIMP?

@Jehan
Copy link

Jehan commented Oct 18, 2021

Yes. A dev release (nonetheless a release with official announcement). And we use MSYS2 for base packages on Windows to not have to rebuild everything. 🙂

@lazka
Copy link
Member

lazka commented Oct 18, 2021

yes, things should be back to "normal" now

@lazka lazka closed this as completed Oct 18, 2021
@LigH-de
Copy link

LigH-de commented Oct 19, 2021

M-AB-S with MinGW32 and ccache enabled works.

@class101
Copy link

This is quickly closed imo, downgrading to grep 3.0 should be considered a temporary solution

grep is my most used tool whether I'm on Windows or Linux.

I'm not affected by this issue and I find this is a pity to downgrade grep just because a part of users can't get things working as before.

It just lacks a patch and issue should be reopened

@mati865
Copy link
Collaborator

mati865 commented Oct 29, 2021

grep is my most used tool whether I'm on Windows or Linux.

You can still use mingw-w64-grep which is faster and up to date.

I'm not affected by this issue and I find this is a pity to downgrade grep just because a part of users can't get things working as before.

By part of users you mean developers of GCC or autotools?

It just lacks a patch and issue should be reopened

Sure you can open issue in MSYS2-packages repo, even better if you can provide patch to fix it.

@revelator
Copy link
Contributor

still some problems with exceptions when linking to static libgcc / libstdc++, catches only first exception then aborts.
does not seem to affect the 64 bit compiler.

@lazka
Copy link
Member

lazka commented Sep 14, 2022

@revelator
Copy link
Contributor

revelator commented Sep 14, 2022

i may have a possible fix, it was intended for AIX which suffers the same problem (only happens with dwarf exceptions sjlj is unaffected) but let me test it first before i post a patch.

the fix is not OS related so should also work for us, im building gcc-12.2.0 with it atm so lets see.

@revelator
Copy link
Contributor

revelator commented Sep 15, 2022

sadly not enough with the patch, every program linked statically has broken exceptions :/ for a good laugh try building ninja with gcc-12.2.0 with these flags -static -static-libgcc -static-libstdc++ it will terminate allmost instantly with no error message.
jsoncpp is another one who is hit hard by this and since cmake relies on that library it also fails if linked statically.

this is the 32 bit compiler with dwarf exceptions btw, as mentioned the SEH based 64 bit compiler has no such problem and neither does the 32 bit sjlj exception model.

im ditching any gcc above version 10 untill this is fixed upstream in my personal build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests