This is complicated, and I don't know every bit of it yet. The symptom is that when an application built with wineg++ throws and exception, it would just abort(), and the exception can't be catch or handle at all. What's happening is that, application built this way depends on libgcc_s.so and libunwind.so at the same time. These two libraries have symbol with the same name, but ABI incompatible with each other. During exception throwing, a called is made from libgcc_s.so's _Unwind_RaiseException to libunwind.so's _Unwind_GetCFA, resulting in libgcc_s.so getting garbage CFA. It fails to find a exception handler and aborts. I don't know how to solve this. It just look all wrong to me, I was surprised that nobody has caught this until now. However, I noticed ArchLinux is doing _this_ [0]. And this indeed fixed the problem. The difference is that now libunwind.so isn't linked with libgcc_s.so anymore. ldd output comparison: Before: linux-vdso.so.1 (0x00007fff90510000) libc.so.6 => /lib64/libc.so.6 (0x00007f2a2afde000) /lib64/ld-linux-x86-64.so.2 (0x00007f2a2b21b000) libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/libgcc_s.so.1 (0x00007f2a2afbe000) libz.so.1 => /lib64/libz.so.1 (0x00007f2a2af9e000) After: linux-vdso.so.1 (0x00007ffcc1af5000) libc.so.6 => /lib64/libc.so.6 (0x00007f32c532e000) /lib64/ld-linux-x86-64.so.2 (0x00007f32c556b000) Why does this make a difference? I don't know. [0]: https://github.com/archlinux/svntogit-packages/blob/bd8ecd47e91dbb2cf77f82ca3a5a94ef1263eb31/trunk/PKGBUILD#L26 Reproducible: Always
It seems unlikely that sed would do it given we default to -Wl,--as-needed in LDFLAGS in profiles. I suppose it could happen if you override LDFLAGS in e.g. make.conf without using the profile definition too. Please include emerge --info.
(In reply to Sam James from comment #1) > It seems unlikely that sed would do it given we default to -Wl,--as-needed > in LDFLAGS in profiles. I suppose it could happen if you override LDFLAGS in > e.g. make.conf without using the profile definition too. > > Please include emerge --info. Also, while it sounds simple, a test program + needed commands to reproduce + full output would be useful, as someone who knows zilch about wine.
winegcc/g++ is usable like normal gcc (e.g. `winegcc -o hello hello.c`) except it creates hello.exe.so and hello.exe (latter is a shell script wrapper), and you can run it as `./hello.exe` or `wine hello.exe.so`. Still need some code to reproduce with though.