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