Pali Rohár <[email protected]>:
>On Sunday 15 February 2026 15:39:40 Kirill Makurin wrote:
> I feel like adding --start-group/--end-group around mingw-w64's -l flags in 
> gcc spec should be a good solution.
>
> That would be hard because gcc has definitions of -l flags in different
> sections and it combines sections together based on output target.

By running `gcc -dumpspecs` (gcc 15.2.0 from Msys2/UCRT64) I see:

```
*libgcc:
%{mthreads:-lmingwthrd} -lmingw32      %{static|static-libgcc:-lgcc -lgcc_eh}  
%{!static:    %{!static-libgcc:      %{!shared:        %{!shared-libgcc:-lgcc 
-lgcc_eh}        %{shared-libgcc:-lgcc_s -lgcc}       }      %{shared:-lgcc_s 
-lgcc}     }   }     -lmingwex %{!mcrtdll=*:-lmsvcrt} %{mcrtdll=*:-l%*}    
-lkernel32
```

So, we have -lmingwex followed by the CRT import library. Would it suffice to 
add --start-group/--end-group just around them?

>> > And that it is better if the msvcrt/ucrt import library does not call
>> > functions from libmingwex.a library.
>>
>> IMO, this will be somewhat annoying as we will have to keep track of where a 
>> function comes from when we call it. This may get pretty bad over time.
>
> I agree, but I do not have a solution for it, except get rid of libmingwex.a.

Can we just add contents of libmingwwx.a into import libraries? This will 
increase size of CRT import libraries almost twice, but should get rid of 
possible link issues coming from libmingwex.a being separate library.

- Kirill Makurin

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to