[v1,01/13] Introduce aarch64-w64-mingw32 target

Message ID VI1PR83MB04310070C9BEB9F34C9E865FF8572@VI1PR83MB0431.EURPRD83.prod.outlook.com
State New
Headers
Series Add aarch64-w64-mingw32 target |

Commit Message

Evgeny Karpov Feb. 21, 2024, 6:16 p.m. UTC
  From c5fec28077184119bc81d927e6062704c1796446 Mon Sep 17 00:00:00 2001
From: Zac Walker <zacwalker@microsoft.com>
Date: Tue, 30 Jan 2024 06:42:46 +0100
Subject: [PATCH v1 01/13] Introduce aarch64-w64-mingw32 target

Add the initial aarch64-w64-mingw32 target for gcc.

fixincludes/ChangeLog:

	* mkfixinc.sh: Extend for *-mingw32* targets.

gcc/ChangeLog:

	* config.gcc: Add aarch64-w64-mingw32 target.
---
 fixincludes/mkfixinc.sh |  3 +--
 gcc/config.gcc          | 14 ++++++++++++++
 2 files changed, 15 insertions(+), 2 deletions(-)
  

Comments

Andrew Pinski Feb. 21, 2024, 6:23 p.m. UTC | #1
On Wed, Feb 21, 2024 at 10:17 AM Evgeny Karpov
<Evgeny.Karpov@microsoft.com> wrote:
>
>

> need_64bit_isa=yes

This is not needed in the patch as it is only used for x86_64 targets.

Should you make sure nobody specifies the big-endian target:
aarch64_be-w64-mingw32  ?

Thanks,
Andrew Pinski
  
Richard Earnshaw (lists) Feb. 22, 2024, 11:33 a.m. UTC | #2
On 21/02/2024 18:16, Evgeny Karpov wrote:
> 
+aarch64*-*-mingw*)

Other targets are a bit inconsistent here as well, but, as Andrew mentioned, if you don't want to handle big-endian, it might be better to match aarch64-*-mingw* here.

R.
  
Evgeny Karpov Feb. 23, 2024, 2:15 p.m. UTC | #3
Hi Andrew and Richard,

Thank you for pointing out there's no need for a 64-bit ISA and the big-endian target.
These changes will be addressed in v2.

Regards,
Evgeny

-----Original Message-----
Thursday, February 22, 2024 12:33 PM 
Richard Earnshaw (lists)  wrote:
>
+aarch64*-*-mingw*)

Other targets are a bit inconsistent here as well, but, as Andrew mentioned, if you don't want to handle big-endian, it might be better to match aarch64-*-mingw* here.


-----Original Message-----
Wednesday, February 21, 2024 7:23 PM 
Andrew Pinski wrote:

> need_64bit_isa=yes

This is not needed in the patch as it is only used for x86_64 targets.

Should you make sure nobody specifies the big-endian target:
aarch64_be-w64-mingw32  ?
  
Fangrui Song Feb. 23, 2024, 10:02 p.m. UTC | #4
+Martin who may have an opinion
(https://github.com/mstorsjo/llvm-mingw supports aarch64)

On Fri, Feb 23, 2024 at 6:15 AM Evgeny Karpov
<Evgeny.Karpov@microsoft.com> wrote:
>
> Hi Andrew and Richard,
>
> Thank you for pointing out there's no need for a 64-bit ISA and the big-endian target.
> These changes will be addressed in v2.
>
> Regards,
> Evgeny
>
> -----Original Message-----
> Thursday, February 22, 2024 12:33 PM
> Richard Earnshaw (lists)  wrote:
> >
> +aarch64*-*-mingw*)
>
> Other targets are a bit inconsistent here as well, but, as Andrew mentioned, if you don't want to handle big-endian, it might be better to match aarch64-*-mingw* here.
>
>
> -----Original Message-----
> Wednesday, February 21, 2024 7:23 PM
> Andrew Pinski wrote:
>
> > need_64bit_isa=yes
>
> This is not needed in the patch as it is only used for x86_64 targets.
>
> Should you make sure nobody specifies the big-endian target:
> aarch64_be-w64-mingw32  ?
>
  

Patch

diff --git a/fixincludes/mkfixinc.sh b/fixincludes/mkfixinc.sh
index df90720b716..7112f4dcd64 100755
--- a/fixincludes/mkfixinc.sh
+++ b/fixincludes/mkfixinc.sh
@@ -12,8 +12,7 @@  target=fixinc.sh
 # Check for special fix rules for particular targets
 case $machine in
     i?86-*-cygwin* | \
-    i?86-*-mingw32* | \
-    x86_64-*-mingw32* | \
+    *-mingw32* | \
     powerpc-*-eabisim* | \
     powerpc-*-eabi*    | \
     powerpc-*-rtems*   | \
diff --git a/gcc/config.gcc b/gcc/config.gcc
index a0f9c672308..092a091595d 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1263,6 +1263,20 @@  aarch64*-*-linux*)
 	done
 	TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
 	;;
+aarch64*-*-mingw*)
+	tmake_file="${tmake_file} aarch64/t-aarch64"
+	case ${enable_threads} in
+	  "" | yes | win32)
+	    thread_file='win32'
+	    ;;
+	  posix)
+	    thread_file='posix'
+	    ;;
+	esac
+	default_use_cxa_atexit=yes
+	need_64bit_isa=yes
+	user_headers_inc_next_post="${user_headers_inc_next_post} float.h"
+	;;
 aarch64*-wrs-vxworks*)
         tm_file="${tm_file} elfos.h aarch64/aarch64-elf.h"
         tm_file="${tm_file} vx-common.h vxworks.h aarch64/aarch64-vxworks.h"