xref: /netbsd-src/external/gpl3/gcc.old/dist/gcc/config/aarch64/aarch64-netbsd.h (revision 8feb0f0b7eaff0608f8350bbfa3098827b4bb91b)
1 /* Definitions for AArch64 running NetBSD
2    Copyright (C) 2016-2020 Free Software Foundation, Inc.
3    Contributed by Matthew Green (mrg@eterna.com.au) and Christos Zoulas
4    (christos@NetBSD.org.)
5 
6    This file is part of GCC.
7 
8    GCC is free software; you can redistribute it and/or modify it
9    under the terms of the GNU General Public License as published by
10    the Free Software Foundation; either version 3, or (at your option)
11    any later version.
12 
13    GCC is distributed in the hope that it will be useful, but
14    WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16    General Public License for more details.
17 
18    You should have received a copy of the GNU General Public License
19    along with GCC; see the file COPYING3.  If not see
20    <http://www.gnu.org/licenses/>.  */
21 
22 #ifndef GCC_AARCH64_NETBSD_H
23 #define GCC_AARCH64_NETBSD_H
24 
25 /* NetBSD malloc(3) does 64, not 128 bits. */
26 #undef MALLOC_ABI_ALIGNMENT
27 #define MALLOC_ABI_ALIGNMENT  64
28 
29 #define TARGET_LINKER_BIG_EMULATION "aarch64nbsdb"
30 #define TARGET_LINKER_LITTLE_EMULATION "aarch64nbsd"
31 
32 #if TARGET_BIG_ENDIAN_DEFAULT
33 #define TARGET_LINKER_EMULATION  TARGET_LINKER_BIG_EMULATION
34 #else
35 #define TARGET_LINKER_EMULATION  TARGET_LINKER_LITTLE_EMULATION
36 #endif
37 
38 #undef  SUBTARGET_EXTRA_LINK_SPEC
39 #define SUBTARGET_EXTRA_LINK_SPEC " -m" TARGET_LINKER_EMULATION
40 
41 #define NETBSD_ENTRY_POINT "__start"
42 
43 #define NETBSD_TARGET_LINK_SPEC  "%{h*} "				\
44   "-X %{mbig-endian:-EB -m " TARGET_LINKER_BIG_EMULATION "} "		\
45   "%{mlittle-endian:-EL -m " TARGET_LINKER_LITTLE_EMULATION "} "	\
46   "%(netbsd_link_spec)"
47 
48 #undef  LINK_SPEC
49 #define LINK_SPEC NETBSD_LINK_SPEC_ELF		\
50 		  NETBSD_TARGET_LINK_SPEC	\
51 		  AARCH64_ERRATA_LINK_SPEC
52 
53 #undef TARGET_OS_CPP_BUILTINS
54 #define TARGET_OS_CPP_BUILTINS()		\
55   do						\
56     {						\
57       NETBSD_OS_CPP_BUILTINS_ELF();		\
58     }						\
59   while (0)
60 
61 #undef SUBTARGET_CPP_SPEC
62 #define SUBTARGET_CPP_SPEC NETBSD_CPP_SPEC
63 
64 #undef EXTRA_SPECS
65 #define EXTRA_SPECS \
66   { "asm_cpu_spec",             ASM_CPU_SPEC }, \
67   NETBSD_SUBTARGET_EXTRA_SPECS
68 
69 #endif  /* GCC_AARCH64_NETBSD_H */
70