aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Green <mrg@eterna.com.au>2019-06-17 14:43:11 +0000
committerRichard Earnshaw <rearnsha@gcc.gnu.org>2019-06-17 14:43:11 +0000
commitf32f75858a14e7b304df7a71dae15d75081b0deb (patch)
tree02586d019f74d3b896d2d2f5b98a9bb3bbaf1d75
parent360a758ec81936f87978d6422677bb759202e47c (diff)
downloadgcc-f32f75858a14e7b304df7a71dae15d75081b0deb.zip
gcc-f32f75858a14e7b304df7a71dae15d75081b0deb.tar.gz
gcc-f32f75858a14e7b304df7a71dae15d75081b0deb.tar.bz2
[netbsd][aarch64] add netbsd/aarch64 target
Initial support for AArch64 running NetBSD. Matthew Green <mrg@eterna.com.au> Maya Rashish <coypu@sdf.org> gcc: * config.gcc (aarch64*-*-netbsd*): New target. * config/aarch64/aarch64-netbsd.h: New file. * config/aarch64/t-aarch64-netbsd: Likewise. libgcc: * config.host (aarch64*-*-netbsd*): New case. Co-Authored-By: Maya Rashish <coypu@sdf.org> From-SVN: r272387
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config.gcc6
-rw-r--r--gcc/config/aarch64/aarch64-netbsd.h80
-rw-r--r--gcc/config/aarch64/t-aarch64-netbsd21
-rw-r--r--libgcc/ChangeLog5
-rw-r--r--libgcc/config.host6
6 files changed, 125 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f118544..dfcf057 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2019-06-17 Matthew Green <mrg@eterna.com.au>
+ Maya Rashish <coypu@sdf.org>
+
+ * config.gcc (aarch64*-*-netbsd*): New target.
+ * config/aarch64/aarch64-netbsd.h: New file.
+ * config/aarch64/t-aarch64-netbsd: Likewise.
+
2019-06-17 Jan Hubicka <hubicka@ucw.cz>
* tree-ssa-alias.c (aliasing_component_refs_p): Consider only
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 8f864c8..fda048d 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1021,6 +1021,12 @@ aarch64*-*-freebsd*)
tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-freebsd"
tm_defines="${tm_defines} TARGET_DEFAULT_ASYNC_UNWIND_TABLES=1"
;;
+aarch64*-*-netbsd*)
+ tm_file="${tm_file} dbxelf.h elfos.h ${nbsd_tm_file}"
+ tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-netbsd.h"
+ tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-netbsd"
+ extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
+ ;;
aarch64*-*-linux*)
tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h"
tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-linux.h"
diff --git a/gcc/config/aarch64/aarch64-netbsd.h b/gcc/config/aarch64/aarch64-netbsd.h
new file mode 100644
index 0000000..2686a1b
--- /dev/null
+++ b/gcc/config/aarch64/aarch64-netbsd.h
@@ -0,0 +1,80 @@
+/* Definitions for AArch64 running NetBSD
+ Copyright (C) 2016-2019 Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ GCC is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GCC; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef GCC_AARCH64_NETBSD_H
+#define GCC_AARCH64_NETBSD_H
+
+#define TARGET_LINKER_BIG_EMULATION "aarch64nbsdb"
+#define TARGET_LINKER_LITTLE_EMULATION "aarch64nbsd"
+
+#if TARGET_BIG_ENDIAN_DEFAULT
+#define TARGET_LINKER_EMULATION TARGET_LINKER_BIG_EMULATION
+#else
+#define TARGET_LINKER_EMULATION TARGET_LINKER_LITTLE_EMULATION
+#endif
+
+#undef SUBTARGET_EXTRA_LINK_SPEC
+#define SUBTARGET_EXTRA_LINK_SPEC " -m" TARGET_LINKER_EMULATION
+
+#define NETBSD_ENTRY_POINT "__start"
+
+#define NETBSD_TARGET_LINK_SPEC "%{h*} " \
+ "-X %{mbig-endian:-EB -m " TARGET_LINKER_BIG_EMULATION "} " \
+ "%{mlittle-endian:-EL -m " TARGET_LINKER_LITTLE_EMULATION "} " \
+ "%(netbsd_link_spec)"
+
+#if TARGET_FIX_ERR_A53_835769_DEFAULT
+#define CA53_ERR_835769_SPEC \
+ " %{!mno-fix-cortex-a53-835769:--fix-cortex-a53-835769}"
+#else
+#define CA53_ERR_835769_SPEC \
+ " %{mfix-cortex-a53-835769:--fix-cortex-a53-835769}"
+#endif
+
+#ifdef TARGET_FIX_ERR_A53_843419_DEFAULT
+#define CA53_ERR_843419_SPEC \
+ " %{!mno-fix-cortex-a53-843419:--fix-cortex-a53-843419}"
+#else
+#define CA53_ERR_843419_SPEC \
+ " %{mfix-cortex-a53-843419:--fix-cortex-a53-843419}"
+#endif
+
+#undef LINK_SPEC
+#define LINK_SPEC NETBSD_LINK_SPEC_ELF \
+ NETBSD_TARGET_LINK_SPEC \
+ CA53_ERR_835769_SPEC \
+ CA53_ERR_843419_SPEC
+
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ NETBSD_OS_CPP_BUILTINS_ELF(); \
+ } \
+ while (0)
+
+#undef SUBTARGET_CPP_SPEC
+#define SUBTARGET_CPP_SPEC NETBSD_CPP_SPEC
+
+#undef EXTRA_SPECS
+#define EXTRA_SPECS \
+ { "asm_cpu_spec", ASM_CPU_SPEC }, \
+ NETBSD_SUBTARGET_EXTRA_SPECS
+
+#endif /* GCC_AARCH64_NETBSD_H */
diff --git a/gcc/config/aarch64/t-aarch64-netbsd b/gcc/config/aarch64/t-aarch64-netbsd
new file mode 100644
index 0000000..aa447d0
--- /dev/null
+++ b/gcc/config/aarch64/t-aarch64-netbsd
@@ -0,0 +1,21 @@
+# Machine description for AArch64 architecture.
+# Copyright (C) 2016-2019 Free Software Foundation, Inc.
+#
+# This file is part of GCC.
+#
+# GCC is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GCC is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+LIB1ASMSRC = aarch64/lib1funcs.asm
+LIB1ASMFUNCS = _aarch64_sync_cache_range
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index fee8b38..934733d 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,8 @@
+2019-06-17 Matthew Green <mrg@eterna.com.au>
+ Maya Rashish <coypu@sdf.org>
+
+ * config.host (aarch64*-*-netbsd*): New case.
+
2019-06-16 Jozef Lawrynowicz <jozef.l@mittosystems.com>
* config/msp430/slli.S (__mspabi_sllll): New library function for
diff --git a/libgcc/config.host b/libgcc/config.host
index 0574b4d..e6a834b 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -359,6 +359,12 @@ aarch64*-*-freebsd*)
tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp t-crtfm"
md_unwind_header=aarch64/freebsd-unwind.h
;;
+aarch64*-*-netbsd*)
+ extra_parts="$extra_parts crtfastmath.o"
+ tmake_file="${tmake_file} ${cpu_type}/t-aarch64"
+ tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp t-crtfm"
+ md_unwind_header=aarch64/aarch64-unwind.h
+ ;;
aarch64*-*-fuchsia*)
tmake_file="${tmake_file} ${cpu_type}/t-aarch64"
tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp"