On Tue, 16 Apr 2024, LIU Hao wrote:
I think it is better to be compatible with MSVC object level behavior
than inventing new/custom object level behavior. Meaning to export it
from def file without @SIZE.
But I think it is not possible to write declaration for this function
into header file. Because __attribute__((stdcall)) annotation cause that
all arguments are passed via stack. I looked at gcc documentation
https://gcc.gnu.org/onlinedocs/gcc/x86-Function-Attributes.html
and there is nothing which can tell to gcc compiler that first floating
point argument is passed in x87 register instead of the stack.
Maybe clang supports something?
I don't think it supports something for this case.
If these are functions necessary by the Microsoft compiler (random posts on
Google suggest they have been there to work around the Intel division bug)
and not meant to be called by users, maybe we just shouldn't provide them.
Indeed, this doesn't look like a regular function that we can add a C
level declaration for, but only for use with compiler generated special
calls.
(This is similar to e.g. the __chkstk family of functions; each of these
use a quite custom ABI/calling convention, different on each architecture,
and only possible to use in compiler generated calls generally.)
So I would agree that if we should list it at all, it should be
undecorated, to match MSVC.
I guess your main goal is to document what symbols each version
of msvcr*.dll have and make our def files match that as closely as
possible. So for that purpose, we could also just include it, even if
nobody is going to reference it. Or leave it out (just keeping comments
explaining it). I don't have a strong opinion either way.
// Martin
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public