Awesome! Thank you very much, LIU Hao and Martin Storsjö!

Yes, making both  _set_controlfp, _set_doserrno available in MSVCRT
toolchains would be great! Should I prepare a patch?

Best,
Luca

Il giorno gio 19 gen 2023 alle ore 22:49 Martin Storsjö <[email protected]>
ha scritto:

> On Thu, 19 Jan 2023, LIU Hao wrote:
>
> > Back in 2017, commit 1035bed24e833ea5eb487c78f4f350ea48f31e8b updated
> > msvcrt.def.in and changed
> >
> >   _set_controlfp
> >   _set_doserrno
> >   _set_errno
> >
> > to
> >
> >   F_ARM_ANY(_set_controlfp)
> >   F_ARM_ANY(_set_doserrno)
> >   F_ARM_ANY(_set_errno)
> >
> > so libmsvcrt no longer has them.
>
> This summary is a bit simplified... Before
> 2146d75d7fd027118fe267f2a8fb139bcab6a9b8, in August 2017, there was
> separate msvcrt.def.in for each architecture, and then, the x86 ones did
> lack _set_doserrno.
>
> In that commit, I merged msvcrt.def.in for different architectures
> (merging arm32 and x86_64 in that commit, merging in the i386 version in
> 0360917119ad3f09635d75103b6dba859cfe0c93), and exposed a bunch of
> functions that only exist in msvcrt.dll in newer versions.
>
> Most/all of these functions, that we exposed, are missing on XP. Some of
> them are such that we do have a statically linked wrapper (that e.g. try
> to load the real one with GetProcAddress and use a fallback otherwise) -
> and by exposing them, we ended up using that instead of the statically
> linked function.
>
> So after noticing this issue, I made the commit that reverted the
> availability to pretty much exactly what it was before the merge.
>
> I don't mind making individual symbols available though (but they need to
> be checked - we can't revert that commit outright).
>
> > But really Windows 10 MSVCRT has them; I haven't checked Windows 7
> though.
>
> I checked, and it seems like these functions exist since Vista, on all
> architectures.
>
> We probably shouldn't make _set_errno available everywhere, since we have
> a custom version of that (in misc/seterrno.c). If we don't care about the
> x86_64 version of XP, we could skip that from the x86_64 version of
> libmsvcrt-os.a and make it available in the def file though.
>
> The other two functions, _set_controlfp and _set_doserrno, don't have any
> extra custom wrapping anywhere, so it's probably fine to just make them
> available though.
>
> // Martin
>
>

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

Reply via email to