Re: [Mingw-w64-public] [PATCHv2 02/27] crt: Add a framework for sharing def files with arch specific differences

2017-08-19 Thread Martin Storsjö
On Sat, 19 Aug 2017, JonY via Mingw-w64-public wrote: On 08/19/2017 04:35 AM, Martin Storsjö wrote: On Sat, 19 Aug 2017, JonY via Mingw-w64-public wrote: According to https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html, both -undef and -P are options in the gcc frontend driver

Re: [Mingw-w64-public] [PATCHv2 02/27] crt: Add a framework for sharing def files with arch specific differences

2017-08-19 Thread JonY via Mingw-w64-public
On 08/19/2017 06:59 AM, Martin Storsjö wrote: > On Sat, 19 Aug 2017, JonY via Mingw-w64-public wrote: > >> On 08/19/2017 04:35 AM, Martin Storsjö wrote: >>> On Sat, 19 Aug 2017, JonY via Mingw-w64-public wrote: >>> >>> According to >>> https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html,

Re: [Mingw-w64-public] [PATCHv2 02/27] crt: Add a framework for sharing def files with arch specific differences

2017-08-19 Thread Martin Storsjö
On Sat, 19 Aug 2017, JonY via Mingw-w64-public wrote: On 08/19/2017 06:59 AM, Martin Storsjö wrote: On Sat, 19 Aug 2017, JonY via Mingw-w64-public wrote: On 08/19/2017 04:35 AM, Martin Storsjö wrote: On Sat, 19 Aug 2017, JonY via Mingw-w64-public wrote: According to

[Mingw-w64-public] [PATCH 08/17] math: Implement the exp2() wrappers using assembly on arm64

2017-08-19 Thread Martin Storsjö
The LLVM optimizer replaces a call to pow(2, x) back into a call to exp2(x), which ends up in an infinite loop/recursion here. To avoid the issue, one could either build exp2.c (or easier to accomplish, all of libmingwex.a) using -fno-builtin or -ffreestanding, or produce the exp2() function

[Mingw-w64-public] [PATCH 07/17] math: Add arm64 specific implementations of math functions

2017-08-19 Thread Martin Storsjö
All of these has been tested for at least a few different types of inputs. The assembly functions have been tested with NAN and INF. Signed-off-by: Martin Storsjö --- mingw-w64-crt/Makefile.am | 6 +- mingw-w64-crt/math/arm64/_chgsignl.S | 16

[Mingw-w64-public] [PATCH 06/17] math: Use the same generic codepaths for arm64 as for arm

2017-08-19 Thread Martin Storsjö
Just as on arm, long double is the same as double. Signed-off-by: Martin Storsjö --- Previously OK'd by J-B. --- mingw-w64-crt/math/cephes_mconf.h | 4 ++-- mingw-w64-crt/math/fabs.c | 4 ++-- mingw-w64-crt/math/fabsf.c| 4 ++-- mingw-w64-crt/math/fabsl.c

[Mingw-w64-public] [PATCH 09/17] stdio: Add arm64 assembly wrappers for the v*scanf functions

2017-08-19 Thread Martin Storsjö
Implement the forwarding function in scanf2-template.S and the va_list unwrapper in the __argtos function in scanf.S, and add arm64 to the list of supported architectures in the files that need it. Signed-off-by: Martin Storsjö --- "Seems ok" by J-B. ---

[Mingw-w64-public] [PATCH 01/17] setjmp.h: Add a fallback definition for unsupported architectures

2017-08-19 Thread Martin Storsjö
This allows including the header without errors, if building for an architecture that we lack setjmp support for so far. This matches what wine have got at the end of their setjmp.h. Signed-off-by: Martin Storsjö --- Previously OK'd by J-B. --- mingw-w64-headers/crt/setjmp.h

[Mingw-w64-public] [PATCH 03/17] headers: Detection of arm64 in some main locations

2017-08-19 Thread Martin Storsjö
Signed-off-by: Martin Storsjö --- Previously OK'd by J-B. --- mingw-w64-headers/crt/malloc.h| 2 +- mingw-w64-headers/include/winnt.h | 21 ++--- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/mingw-w64-headers/crt/malloc.h

[Mingw-w64-public] [PATCH] crt: Add a missed DLL for libarm32

2017-08-19 Thread Martin Storsjö
The def file existed for libarm32 before (originally in the libarm32 directory, later shared into lib-common), but wasn't actully built for libarm32, only for lib64. Signed-off-by: Martin Storsjö --- mingw-w64-crt/libarm32/Makefile.am | 1 + 1 file changed, 1 insertion(+)

[Mingw-w64-public] [PATCH 10/17] intrin-impl.h: Include compiler builtins based parts on arm64 as well

2017-08-19 Thread Martin Storsjö
Signed-off-by: Martin Storsjö --- Previously OK'd by J-B. --- mingw-w64-headers/include/psdk_inc/intrin-impl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mingw-w64-headers/include/psdk_inc/intrin-impl.h

[Mingw-w64-public] [PATCH 02/17] crt: Add initial support for buiding for arm64 in mingw-w64-crt

2017-08-19 Thread Martin Storsjö
This is only supported by llvm-dlltool so far. Only build def files from lib-common. Signed-off-by: Martin Storsjö --- Previously OK'd by J-B, but has got a few adjustments since. --- mingw-w64-crt/Makefile.am | 264 +++

[Mingw-w64-public] [PATCH 16/17] winnt.h: Add empty definition of arch specific structs for arm64

2017-08-19 Thread Martin Storsjö
Signed-off-by: Martin Storsjö --- The correct/official definition of these structs are available in winnt.h in the win10 sdk (but they are not documented on e.g. MSDN). I haven't looked closer at them other than noticing that they exist there. This setup (with empty dummy

[Mingw-w64-public] [PATCH 17/17] crt: Disable win64 unwinding on arm64

2017-08-19 Thread Martin Storsjö
This allows building this file for now, until the necessary struct (CONTEXT in winnt.h) is available. Signed-off-by: Martin Storsjö --- mingw-w64-crt/crt/gs_support.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mingw-w64-crt/crt/gs_support.c

[Mingw-w64-public] [PATCH 00/17] ARM64 support in MinGW, v3

2017-08-19 Thread Martin Storsjö
This is the third round of patches adding initial support for ARM64. Since the previous round, some def files have been cleaned up and shared, and this architecture now only uses def files from lib-common so far. Many of the patches were previously reviewed by J-B and got approvals, those

[Mingw-w64-public] [PATCH 11/17] intrin-impl.h: Add arm64 functions corresponding to the arm ones

2017-08-19 Thread Martin Storsjö
Signed-off-by: Martin Storsjö --- mingw-w64-headers/include/psdk_inc/intrin-impl.h | 145 +++ 1 file changed, 145 insertions(+) diff --git a/mingw-w64-headers/include/psdk_inc/intrin-impl.h b/mingw-w64-headers/include/psdk_inc/intrin-impl.h index

[Mingw-w64-public] [PATCH 12/17] crtexe: Skip __initenv on arm64 just as on arm

2017-08-19 Thread Martin Storsjö
Signed-off-by: Martin Storsjö --- Previously OK'd by J-B. --- 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 ae37e0f..bbef685 100644 ---

[Mingw-w64-public] [PATCH 14/17] crt: Change checks for _WIN64 into __x86_64__ around exception handling

2017-08-19 Thread Martin Storsjö
This keeps these codepaths disabled on arm64 for now, where _WIN64 also is defined, but exception handling isn't supported yet. Signed-off-by: Martin Storsjö --- Previously OK'd by J-B. --- mingw-w64-crt/crt/crt_handler.c | 2 +- mingw-w64-crt/crt/crtdll.c | 2 +-

[Mingw-w64-public] [PATCH 15/17] winnt.h: Add arm64 specific handling of TEB

2017-08-19 Thread Martin Storsjö
Signed-off-by: Martin Storsjö --- mingw-w64-headers/include/winnt.h | 11 +++ 1 file changed, 11 insertions(+) diff --git a/mingw-w64-headers/include/winnt.h b/mingw-w64-headers/include/winnt.h index 9107a36..f48cb30 100644 --- a/mingw-w64-headers/include/winnt.h +++

Re: [Mingw-w64-public] [PATCH 12/17] crtexe: Skip __initenv on arm64 just as on arm

2017-08-19 Thread JonY via Mingw-w64-public
On 08/19/2017 09:26 PM, Martin Storsjö wrote: > mainret = wmain (argc, argv, envp); > #else > -#ifndef __arm__ > +#if !defined(__arm__) && !defined(__aarch64__) > __initenv = envp; Shouldn't this be ||? signature.asc Description: OpenPGP digital signature

Re: [Mingw-w64-public] [PATCH] crt: Add a missed DLL for libarm32

2017-08-19 Thread JonY via Mingw-w64-public
On 08/19/2017 09:21 PM, Martin Storsjö wrote: > The def file existed for libarm32 before (originally in the libarm32 > directory, later shared into lib-common), but wasn't actully built > for libarm32, only for lib64. > > Signed-off-by: Martin Storsjö > --- >

Re: [Mingw-w64-public] [PATCH 12/17] crtexe: Skip __initenv on arm64 just as on arm

2017-08-19 Thread Martin Storsjö
On Sun, 20 Aug 2017, JonY via Mingw-w64-public wrote: On 08/19/2017 09:26 PM, Martin Storsjö wrote: mainret = wmain (argc, argv, envp); #else -#ifndef __arm__ +#if !defined(__arm__) && !defined(__aarch64__) __initenv = envp; Shouldn't this be ||? No, since it's about !defined.