On Sat, 19 Feb 2022, Pali Rohár wrote:
Currently macro __LIBMSVCRT__ is defined when building any libmsvcr*.a
import library. But header file msvcrt.h contains inline function
__mingw_get_msvcrt_handle() which should be used only from import library
for runtime msvcrt.dll (and not for any other runtime msvcr*.dll) as code
from that header file directly uses msvcrt.dll library.
Protect header file msvcrt.h by a new macro __LIBMSVCRT_OS__ and fix error
message as this header file is for libmsvcrt-os.a import library.
libmsvcrt.a is import library for some msvcr*.dll runtime specified at
MinGW-w64 compile time and does not have to be msvcrt.dll.
Archive libmsvcrt_extra.a is linked only to the libmsvcrt-os.a (import
library for msvcrt.dll) by crtdll.mri script, so define this new macro
__LIBMSVCRT_OS__ when building object files for archive libmsvcrt_extra.a.
The patch looks reasonable to me. This last sentence looks a bit
inconsistent though, did you mean msvcrt-os.mri instead of crtdll.mri?
// Martin
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public