11debfc3dSmrg /* Definitions of target machine for GNU compiler, NetBSD/arm ELF version. 2*8feb0f0bSmrg Copyright (C) 2002-2020 Free Software Foundation, Inc. 31debfc3dSmrg Contributed by Wasabi Systems, Inc. 41debfc3dSmrg 51debfc3dSmrg This file is part of GCC. 61debfc3dSmrg 71debfc3dSmrg GCC is free software; you can redistribute it and/or modify it 81debfc3dSmrg under the terms of the GNU General Public License as published 91debfc3dSmrg by the Free Software Foundation; either version 3, or (at your 101debfc3dSmrg option) any later version. 111debfc3dSmrg 121debfc3dSmrg GCC is distributed in the hope that it will be useful, but WITHOUT 131debfc3dSmrg ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 141debfc3dSmrg or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 151debfc3dSmrg License for more details. 161debfc3dSmrg 171debfc3dSmrg You should have received a copy of the GNU General Public License 181debfc3dSmrg along with GCC; see the file COPYING3. If not see 191debfc3dSmrg <http://www.gnu.org/licenses/>. */ 201debfc3dSmrg 211debfc3dSmrg /* Run-time Target Specification. */ 221debfc3dSmrg #undef MULTILIB_DEFAULTS 231debfc3dSmrg #define MULTILIB_DEFAULTS { "mabi=aapcs-linux" } 241debfc3dSmrg 25*8feb0f0bSmrg #define TARGET_LINKER_EABI_SUFFIX_SOFT \ 26*8feb0f0bSmrg "%{!mabi=apcs-gnu:%{!mabi=atpcs:%{mfloat-abi=hard:_eabihf;:_eabi}}}" 27*8feb0f0bSmrg #define TARGET_LINKER_EABI_SUFFIX_HARD \ 28*8feb0f0bSmrg "%{!mabi=apcs-gnu:%{!mabi=atpcs:%{mfloat-abi=soft:_eabi;:_eabihf}}}" 29*8feb0f0bSmrg 301debfc3dSmrg #define TARGET_LINKER_EABI_SUFFIX \ 311debfc3dSmrg (TARGET_DEFAULT_FLOAT_ABI == ARM_FLOAT_ABI_SOFT \ 32*8feb0f0bSmrg ? TARGET_LINKER_EABI_SUFFIX_SOFT \ 33*8feb0f0bSmrg : TARGET_LINKER_EABI_SUFFIX_HARD) 34*8feb0f0bSmrg 351debfc3dSmrg #define TARGET_LINKER_BIG_EMULATION "armelfb_nbsd%(linker_eabi_suffix)" 361debfc3dSmrg #define TARGET_LINKER_LITTLE_EMULATION "armelf_nbsd%(linker_eabi_suffix)" 371debfc3dSmrg 381debfc3dSmrg /* TARGET_BIG_ENDIAN_DEFAULT is set in 391debfc3dSmrg config.gcc for big endian configurations. */ 401debfc3dSmrg #undef TARGET_LINKER_EMULATION 411debfc3dSmrg #if TARGET_BIG_ENDIAN_DEFAULT 421debfc3dSmrg #define TARGET_LINKER_EMULATION TARGET_LINKER_BIG_EMULATION 431debfc3dSmrg #else 441debfc3dSmrg #define TARGET_LINKER_EMULATION TARGET_LINKER_LITTLE_EMULATION 451debfc3dSmrg #endif 461debfc3dSmrg 471debfc3dSmrg #undef ARM_DEFAULT_ABI 481debfc3dSmrg #define ARM_DEFAULT_ABI ARM_ABI_AAPCS_LINUX 491debfc3dSmrg 501debfc3dSmrg #undef ARM_UNWIND_INFO 511debfc3dSmrg #define ARM_UNWIND_INFO 0 521debfc3dSmrg #undef ARM_DWARF_UNWIND_TABLES 531debfc3dSmrg #define ARM_DWARF_UNWIND_TABLES 1 541debfc3dSmrg 551debfc3dSmrg #undef TARGET_OS_CPP_BUILTINS 561debfc3dSmrg #define TARGET_OS_CPP_BUILTINS() \ 571debfc3dSmrg do \ 581debfc3dSmrg { \ 591debfc3dSmrg if (TARGET_AAPCS_BASED) \ 601debfc3dSmrg TARGET_BPABI_CPP_BUILTINS(); \ 611debfc3dSmrg NETBSD_OS_CPP_BUILTINS_ELF(); \ 621debfc3dSmrg if (ARM_DWARF_UNWIND_TABLES) \ 631debfc3dSmrg builtin_define ("__ARM_DWARF_EH__"); \ 641debfc3dSmrg } \ 651debfc3dSmrg while (0) 661debfc3dSmrg 671debfc3dSmrg #undef SUBTARGET_CPP_SPEC 681debfc3dSmrg #define SUBTARGET_CPP_SPEC NETBSD_CPP_SPEC 691debfc3dSmrg 701debfc3dSmrg /* 711debfc3dSmrg * Override AAPCS types to remain compatible the existing NetBSD types. 721debfc3dSmrg */ 731debfc3dSmrg #undef WCHAR_TYPE 741debfc3dSmrg #define WCHAR_TYPE "int" 751debfc3dSmrg 761debfc3dSmrg #undef SIZE_TYPE 771debfc3dSmrg #define SIZE_TYPE "long unsigned int" 781debfc3dSmrg 791debfc3dSmrg #undef PTRDIFF_TYPE 801debfc3dSmrg #define PTRDIFF_TYPE "long int" 811debfc3dSmrg 821debfc3dSmrg #undef SUBTARGET_EXTRA_ASM_SPEC 831debfc3dSmrg #define SUBTARGET_EXTRA_ASM_SPEC \ 84*8feb0f0bSmrg "-matpcs %{mabi=apcs-gnu|mabi=atpcs:-meabi=gnu} " \ 85*8feb0f0bSmrg "%{fpic|fpie:-k} " \ 86*8feb0f0bSmrg "%{fPIC|fPIE:-k}" 871debfc3dSmrg 881debfc3dSmrg /* Default to full VFP if -mhard-float is specified. */ 891debfc3dSmrg #undef SUBTARGET_ASM_FLOAT_SPEC 901debfc3dSmrg #define SUBTARGET_ASM_FLOAT_SPEC \ 911debfc3dSmrg "%{mhard-float:%{!mfpu=*:-mfpu=vfp}} \ 921debfc3dSmrg %{mfloat-abi=hard:%{!mfpu=*:-mfpu=vfp}}" 931debfc3dSmrg 941debfc3dSmrg #undef SUBTARGET_EXTRA_SPECS 951debfc3dSmrg #define SUBTARGET_EXTRA_SPECS \ 961debfc3dSmrg { "subtarget_extra_asm_spec", SUBTARGET_EXTRA_ASM_SPEC }, \ 971debfc3dSmrg { "subtarget_asm_float_spec", SUBTARGET_ASM_FLOAT_SPEC }, \ 981debfc3dSmrg { "linker_eabi_suffix", TARGET_LINKER_EABI_SUFFIX }, \ 991debfc3dSmrg { "linker_emulation", TARGET_LINKER_EMULATION }, \ 1001debfc3dSmrg { "linker_big_emulation", TARGET_LINKER_BIG_EMULATION }, \ 1011debfc3dSmrg { "linker_little_emulation", TARGET_LINKER_LITTLE_EMULATION }, \ 1021debfc3dSmrg { "be8_link_spec", BE8_LINK_SPEC }, \ 1031debfc3dSmrg { "target_fix_v4bx_spec", TARGET_FIX_V4BX_SPEC }, \ 1041debfc3dSmrg NETBSD_SUBTARGET_EXTRA_SPECS 1051debfc3dSmrg 1061debfc3dSmrg #define NETBSD_ENTRY_POINT "__start" 1071debfc3dSmrg 1081debfc3dSmrg #undef LINK_SPEC 1091debfc3dSmrg #define LINK_SPEC \ 110*8feb0f0bSmrg "-X %{mbig-endian:-EB -m %(linker_big_emulation)} " \ 111*8feb0f0bSmrg "%{mlittle-endian:-EL -m %(linker_liitle_emulation)} " \ 112*8feb0f0bSmrg "%{!mbig-endian:%{!mlittle-endian:-m %(linker_emulation)}} " \ 113*8feb0f0bSmrg "%(be8_link_spec) " \ 114*8feb0f0bSmrg "%(target_fix_v4bx_spec) %(netbsd_link_spec)" 115