Skip to content

Commit f7c91f8

Browse files
Blackhexeukarpov
andcommitted
Add aarch64-pc-cygwin target
Co-authored-by: Evgeny Karpov <[email protected]>
1 parent 012f096 commit f7c91f8

File tree

11 files changed

+77
-13
lines changed

11 files changed

+77
-13
lines changed

config.guess

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,9 @@ EOF
911911
i*:UWIN*:*)
912912
echo "$UNAME_MACHINE"-pc-uwin
913913
exit ;;
914+
aarch64:CYGWIN*:*:*)
915+
echo aarch64-pc-cygwin
916+
exit ;;
914917
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
915918
echo x86_64-pc-cygwin
916919
exit ;;

gcc/config.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ case $build in
5353
hppa*64*-*-hpux11* )
5454
build_install_headers_dir=install-headers-cpio
5555
;;
56-
i[34567]86-*-cygwin* | x86_64-*-cygwin* )
56+
i[34567]86-*-cygwin* | x86_64-*-cygwin* | aarch64-*-cygwin*)
5757
build_xm_file=i386/xm-cygwin.h
5858
build_exeext=.exe
5959
;;

gcc/config.gcc

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,6 +1272,36 @@ aarch64*-*-gnu*)
12721272
tmake_file="${tmake_file} aarch64/t-aarch64"
12731273
tm_defines="${tm_defines} TARGET_DEFAULT_ASYNC_UNWIND_TABLES=1"
12741274
;;
1275+
aarch64-*-cygwin*)
1276+
tm_file="${tm_file} aarch64/aarch64-abi-ms.h"
1277+
tm_file="${tm_file} aarch64/aarch64-coff.h"
1278+
tm_file="${tm_file} aarch64/cygming.h"
1279+
tm_file="${tm_file} i386/cygwin.h"
1280+
tm_file="${tm_file} i386/cygwin-w64.h"
1281+
tm_file="${tm_file} i386/cygwin-stdint.h"
1282+
tm_file="${tm_file} mingw/winnt.h"
1283+
tm_file="${tm_file} mingw/winnt-dll.h"
1284+
xm_file=i386/xm-cygwin.h
1285+
tmake_file="${tmake_file} aarch64/t-aarch64"
1286+
tmake_file="${tmake_file} mingw/t-cygming t-slibgcc"
1287+
target_gtfiles="$target_gtfiles \$(srcdir)/config/mingw/winnt.cc"
1288+
target_gtfiles="$target_gtfiles \$(srcdir)/config/mingw/winnt-dll.cc"
1289+
extra_options="${extra_options} mingw/cygming.opt i386/cygwin.opt"
1290+
extra_objs="${extra_objs} winnt.o winnt-dll.o"
1291+
c_target_objs="${c_target_objs} msformat-c.o"
1292+
cxx_target_objs="${cxx_target_objs} winnt-cxx.o msformat-c.o"
1293+
d_target_objs="${d_target_objs} cygwin-d.o"
1294+
target_has_targetdm="yes"
1295+
aarch64_multilibs="llp64"
1296+
if test x$enable_threads = xyes; then
1297+
thread_file='posix'
1298+
fi
1299+
default_use_cxa_atexit=yes
1300+
use_gcc_stdint=wrap
1301+
tm_defines="${tm_defines} TARGET_64BIT=1 TARGET_CYGWIN64=1 TARGET_64BIT_MS_ABI=1 TARGET_AARCH64_MS_ABI=1"
1302+
TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG},llp64"
1303+
TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
1304+
;;
12751305
aarch64-*-mingw*)
12761306
tm_file="${tm_file} aarch64/aarch64-abi-ms.h"
12771307
tm_file="${tm_file} aarch64/aarch64-coff.h"

gcc/config.host

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ case ${host} in
228228
;;
229229
esac
230230
;;
231-
i[34567]86-*-cygwin* | x86_64-*-cygwin*)
231+
i[34567]86-*-cygwin* | x86_64-*-cygwin* | aarch64-*-cygwin*)
232232
host_xm_file=i386/xm-cygwin.h
233233
out_host_hook_obj=host-cygwin.o
234234
host_xmake_file="${host_xmake_file} i386/x-cygwin"

gcc/config/aarch64/cygming.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,21 +140,14 @@ still needed for compilation. */
140140
#define TARGET_OS_CPP_BUILTINS() \
141141
do \
142142
{ \
143-
builtin_define ("__MSVCRT__"); \
144-
builtin_define ("__MINGW32__"); \
145-
builtin_define ("_WIN32"); \
146143
builtin_define ("__SEH__"); \
147-
builtin_define_std ("WIN32"); \
148-
builtin_define_std ("WINNT"); \
149144
builtin_define_with_int_value ("_INTEGRAL_MAX_BITS", \
150145
TYPE_PRECISION (intmax_type_node)); \
151-
builtin_define ("__MINGW64__"); \
152-
builtin_define_std ("WIN64"); \
153-
builtin_define ("_WIN64"); \
154146
builtin_define ("__stdcall=__attribute__((__stdcall__))"); \
155147
builtin_define ("__fastcall=__attribute__((__fastcall__))"); \
156148
builtin_define ("__thiscall=__attribute__((__thiscall__))"); \
157149
builtin_define ("__cdecl=__attribute__((__cdecl__))"); \
150+
EXTRA_OS_CPP_BUILTINS (); \
158151
} \
159152
while (0)
160153

gcc/config/i386/cygwin-w64.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ along with GCC; see the file COPYING3. If not see
5050

5151
#undef SUB_LINK_SPEC
5252
#undef SUB_LINK_ENTRY
53+
#if defined(TARGET_AARCH64_MS_ABI)
54+
#define SUB_LINK_SPEC "-m aarch64pe"
55+
#else
5356
#define SUB_LINK_SPEC "%{" SPEC_64 ":-m i386pep} %{" SPEC_32 ":-m i386pe}"
57+
#endif
5458
#define SUB_LINK_ENTRY "%{" SPEC_64 ":" SUB_LINK_ENTRY64 "} %{" SPEC_32 ":" SUB_LINK_ENTRY32 "}"
5559

5660
#undef MULTILIB_DEFAULTS

gcc/config/mingw/mingw32.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ along with GCC; see the file COPYING3. If not see
4242
#define DEFINE_THREAD_MODEL
4343
#endif
4444

45+
#if defined (TARGET_AARCH64_MS_ABI)
46+
# define ENABLE_TARGET_64BIT_BUILTINS 1
47+
#else
48+
# define ENABLE_TARGET_64BIT_BUILTINS (TARGET_64BIT && ix86_abi == MS_ABI)
49+
#endif
50+
4551
/* See i386/crtdll.h for an alternative definition. _INTEGRAL_MAX_BITS
4652
is for compatibility with native compiler. */
4753
#define EXTRA_OS_CPP_BUILTINS() \
@@ -54,7 +60,7 @@ along with GCC; see the file COPYING3. If not see
5460
builtin_define_std ("WINNT"); \
5561
builtin_define_with_int_value ("_INTEGRAL_MAX_BITS", \
5662
TYPE_PRECISION (intmax_type_node));\
57-
if (TARGET_64BIT && ix86_abi == MS_ABI) \
63+
if (ENABLE_TARGET_64BIT_BUILTINS) \
5864
{ \
5965
builtin_define ("__MINGW64__"); \
6066
builtin_define_std ("WIN64"); \

gcc/configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28949,7 +28949,7 @@ fi
2894928949

2895028950
;;
2895128951

28952-
i[34567]86-*-* | x86_64-*-*)
28952+
i[34567]86-*-* | x86_64-*-* | aarch64-*-*)
2895328953
case $target_os in
2895428954
cygwin*)
2895528955
# Full C++ conformance when using a shared libstdc++-v3 requires some

gcc/configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4778,7 +4778,7 @@ foo:
47784778
;;
47794779

47804780
changequote(,)dnl
4781-
i[34567]86-*-* | x86_64-*-*)
4781+
i[34567]86-*-* | x86_64-*-* | aarch64-*-*)
47824782
changequote([,])dnl
47834783
case $target_os in
47844784
cygwin*)

libgcc/config.host

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -866,6 +866,30 @@ i[34567]86-*-solaris2* | x86_64-*-solaris2*)
866866
;;
867867
i[4567]86-wrs-vxworks*|x86_64-wrs-vxworks*)
868868
;;
869+
aarch64-*-cygwin*)
870+
# This has to match the logic for DWARF2_UNWIND_INFO in gcc/config/aarch64/cygming.h
871+
if test x$ac_cv_sjlj_exceptions = xyes; then
872+
tmake_eh_file="i386/t-sjlj-eh"
873+
else
874+
tmake_eh_file="mingw/t-seh-eh"
875+
fi
876+
# Shared libgcc DLL install dir depends on cross/native build.
877+
if test x${build} = x${host} ; then
878+
tmake_dlldir_file="i386/t-dlldir"
879+
else
880+
tmake_dlldir_file="i386/t-dlldir-x"
881+
fi
882+
tmake_file="${tmake_file} ${tmake_eh_file} ${tmake_dlldir_file}"
883+
tmake_file="${tmake_file} t-dfprules"
884+
tmake_file="${tmake_file} i386/t-slibgcc-cygming i386/t-cygming i386/t-cygwin"
885+
tmake_file="${tmake_file} ${cpu_type}/t-aarch64"
886+
tmake_file="${tmake_file} ${cpu_type}/t-lse"
887+
tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp t-crtfm"
888+
extra_parts="$extra_parts crtbegin.o crtbeginS.o crtend.o crtfastmath.o"
889+
if test x$enable_vtable_verify = xyes; then
890+
extra_parts="$extra_parts vtv_start.o vtv_end.o vtv_start_preinit.o vtv_end_preinit.o"
891+
fi
892+
;;
869893
i[34567]86-*-cygwin*)
870894
extra_parts="crtbegin.o crtbeginS.o crtend.o crtfastmath.o"
871895
if test x$enable_vtable_verify = xyes; then

0 commit comments

Comments
 (0)