LIU Hao wrote:
>在 2026-1-26 20:20, Kirill Makurin 写道:
>> LIU Hao wrote:
>>> 在 2026-1-26 07:16, Pali Rohár 写道:
>>>> C++ header files are trying to put quick_exit and at_quick_exit functions
>>>> into :: or std:: namespace. If those functions are not declared then
>>>> compilation is failing with error:
>>>> error: 'at_quick_exit' has not been declared in '::'
>>>> And it does not matter if those functions are used or not.
>>>> ---
>>>>   mingw-w64-headers/crt/stdlib.h | 4 ----
>>>>   1 file changed, 4 deletions(-)
>>>
>>> DI such headers exist in the wild? Both libstdc++ and libc++ declare them 
>>> conditionally.
>>
>> This is probably resulted from the fact that we were using libstdc++ headers 
>> configured for UCRT when we run tests for msvcrt{20,40}.dll, note condition 
>> "matrix.crt == ucrt":
>
> That's unsupported, even more unsupported than using MSVCRT headers but 
> linking against a non-default CRT
> DLL.
>
>> maybe using "matrix.crt == msvcrt" instead would solve this issue? This also 
>> means that we are linking static libstdc++ configured for UCRT when running 
>> tests for msvcrt{20,40}.dll, which may result in more issues in future.
>
> You can try that; but if libstdc++ tests can never pass with such old DLLs, 
> we cannot have such setups on
> the CI.

This is really problematic. We're doing this only when running `make check` for 
mingw-w64's tests and we link libstdc++ statically; otherwise, C++ tests would 
be linked against CRT we are testing (msvcrt20.dll or msvcrt40.dll) and 
libstdc++, which is linked against CRT specified by `matrix.crt`. The latter is 
even more mess.

One possible solution is to pass `-mcrtdll=` flag only for C compilations. 
Another, more complicated but seemingly correct solution is to configure 
libstdc++ for msvcrt{20,40}.dll.

>> Pali picked this commit from branch where we were running CI tests. There 
>> were link issues with undefined reference to __ms_vsnprintf and it seemed to 
>> do with link order. I initially pushed that commit just to see if it'll fix 
>> the issue.
>
> So what should I do? Drop it?

Pali would explain the purpose of this commit better than me. I suggest this 
one has to be re-sent with commit message.

- Kirill Makurin

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

Reply via email to