@insn I'd prefer to fix existing code instead of quirking build chain but it's very sophisticated.
E.g. I'm unable to build working/sane object file from `dlls/winecrt0/setjmp.c` with LTO enabled due to further linking issues like `undefined reference to '__wine_setjmpex'`.
Proposed change (doesn't work though): ```diff --- a/dlls/winecrt0/setjmp.c +++ b/dlls/winecrt0/setjmp.c @@ -25,6 +25,22 @@
#if defined(__GNUC__) || defined(__clang__)
+#if (defined(__i386__) || defined(__x86_64__) || defined(__arm__) || defined(__aarch64__)) && !defined(__arm64ec__) +__attribute__((used)) +extern int __cdecl __wine_setjmpex( __wine_jmp_buf *buf, EXCEPTION_REGISTRATION_RECORD *frame ); +__attribute__((used)) +extern void __cdecl __wine_longjmp( __wine_jmp_buf *buf, int retval ); +#endif + +#ifdef __WINE_LTO_BUILD +__attribute__((used)) +static void __wine_lto_fixup( void ) +{ + (void) __wine_setjmpex( NULL, NULL ); + __wine_longjmp( NULL, 0 ); +} +#endif + #if defined(__i386__)
__ASM_GLOBAL_FUNC( __wine_setjmpex, ```