Re: [Mingw-w64-public] bug in sin(pi) ?

2021-06-14 Thread Carl Kleffner
One could think about using OpenLibm. Julia is using OpenLibm as its math implementation. There is a nice comparison of glibc, OpenLibm, Musl and Intel as well AMD math implementations: "Accuracy of Mathematical Functions in Single, Double, Extended Double and Quadruple Precision" Paul Zimmermann

Re: [Mingw-w64-public] [PATCH] headers/locale: Make result of `localeconv()` accord to GCC's, `-funsigned-char` option

2021-06-14 Thread Martin Storsjö
On Mon, 14 Jun 2021, Liu Hao wrote: 在 6/14/21 3:58 PM, Martin Storsjö 写道: BTW, one different aspect of this initialization; if you have a DLL that is built with -funsigned-char, and this is loaded by an EXE that isn't built that way, the DLL still initializes the lconv info to unsigned mode.

Re: [Mingw-w64-public] [PATCH] headers/locale: Make result of `localeconv()` accord to GCC's, `-funsigned-char` option

2021-06-14 Thread Liu Hao
在 6/14/21 3:58 PM, Martin Storsjö 写道: BTW, one different aspect of this initialization; if you have a DLL that is built with -funsigned-char, and this is loaded by an EXE that isn't built that way, the DLL still initializes the lconv info to unsigned mode. The same happens with MSVC too (as lo

Re: [Mingw-w64-public] [PATCH 3/3] crt: Add double underscore prefix to the mingw_app_type symbol

2021-06-14 Thread Martin Storsjö
Hi, On Mon, 14 Jun 2021, Liu Hao wrote: 在 6/14/21 3:37 PM, Martin Storsjö 写道: This symbol vaguely seems like it might be meant to be overridden by the app code, but I don't see how that practically would work, as the init routines (crtdll.c and crtexe.c) set it anyway, so whatever default valu

Re: [Mingw-w64-public] [PATCH 3/3] crt: Add double underscore prefix to the mingw_app_type symbol

2021-06-14 Thread Liu Hao
在 6/14/21 3:37 PM, Martin Storsjö 写道: This symbol vaguely seems like it might be meant to be overridden by the app code, but I don't see how that practically would work, as the init routines (crtdll.c and crtexe.c) set it anyway, so whatever default value the user code provided wouldn't have any

Re: [Mingw-w64-public] [PATCH] headers/locale: Make result of `localeconv()` accord to GCC's, `-funsigned-char` option

2021-06-14 Thread Martin Storsjö
On Mon, 14 Jun 2021, Martin Storsjö wrote: On Mon, 14 Jun 2021, Liu Hao wrote: 在 6/14/21 3:09 PM, Martin Storsjö 写道: Right yes... Normal C++ e.g. declared in a class header are emitted that way (but that comes with all the extra hairiness regarding inline functions that might not be emitte

Re: [Mingw-w64-public] [PATCH] headers/locale: Make result of `localeconv()` accord to GCC's, `-funsigned-char` option

2021-06-14 Thread Martin Storsjö
On Mon, 14 Jun 2021, Liu Hao wrote: 在 6/14/21 3:09 PM, Martin Storsjö 写道: Right yes... Normal C++ e.g. declared in a class header are emitted that way (but that comes with all the extra hairiness regarding inline functions that might not be emitted and/or optimized out). So unless we know we

[Mingw-w64-public] [PATCH 1/3] crt: Add double underscore prefix to internal symbols used for linking in init routines

2021-06-14 Thread Martin Storsjö
Signed-off-by: Martin Storsjö --- mingw-w64-crt/crt/charmax.c | 2 +- mingw-w64-crt/crt/crtexe.c | 12 ++-- mingw-w64-crt/crt/tlssup.c | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/mingw-w64-crt/crt/charmax.c b/mingw-w64-crt/crt/charmax.c index 08aa5a1d3

[Mingw-w64-public] [PATCH 3/3] crt: Add double underscore prefix to the mingw_app_type symbol

2021-06-14 Thread Martin Storsjö
This symbol vaguely seems like it might be meant to be overridden by the app code, but I don't see how that practically would work, as the init routines (crtdll.c and crtexe.c) set it anyway, so whatever default value the user code provided wouldn't have any effect anyway. Signed-off-by: Martin St

[Mingw-w64-public] [PATCH 2/3] crt: Add double underscore prefix to internal symbols

2021-06-14 Thread Martin Storsjö
Signed-off-by: Martin Storsjö --- mingw-w64-crt/crt/crtexe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mingw-w64-crt/crt/crtexe.c b/mingw-w64-crt/crt/crtexe.c index a7af136fe..8b1c86392 100644 --- a/mingw-w64-crt/crt/crtexe.c +++ b/mingw-w64-crt/crt/crtexe.c @@ -99,8

Re: [Mingw-w64-public] [PATCH] headers/locale: Make result of `localeconv()` accord to GCC's, `-funsigned-char` option

2021-06-14 Thread Liu Hao
在 6/14/21 3:09 PM, Martin Storsjö 写道: Right yes... Normal C++ e.g. declared in a class header are emitted that way (but that comes with all the extra hairiness regarding inline functions that might not be emitted and/or optimized out). So unless we know we can do manual selectany on a plain no

Re: [Mingw-w64-public] [PATCH] headers/locale: Make result of `localeconv()` accord to GCC's, `-funsigned-char` option

2021-06-14 Thread Martin Storsjö
On Mon, 14 Jun 2021, Liu Hao wrote: 在 6/14/21 1:49 PM, Martin Storsjö 写道: FWIW we have __declspec(selectany) in a number of places in our headers already (which expands to the same), but not in the crt/* headers yet. I don't mind either this or plain __declspec(selectany). The GCC manual