1  /* Definitions for RISC-V FreeBSD systems with ELF format.
       2     Copyright (C) 2018-2023 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
       7  it 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,
      12  but WITHOUT ANY WARRANTY; without even the implied warranty of
      13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      14  GNU 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  #undef WCHAR_TYPE
      21  #define WCHAR_TYPE "int"
      22  
      23  #undef WCHAR_TYPE_SIZE
      24  #define WCHAR_TYPE_SIZE 32
      25  
      26  #undef  SUBTARGET_EXTRA_SPECS
      27  #define SUBTARGET_EXTRA_SPECS \
      28    { "fbsd_dynamic_linker", FBSD_DYNAMIC_LINKER }
      29  
      30  #undef CC1_SPEC
      31  #define CC1_SPEC "%(cc1_cpu) %{profile:-p}"
      32  
      33  /* Provide a LINK_SPEC appropriate for FreeBSD.  Here we provide support
      34     for the special GCC options -static and -shared, which allow us to
      35     link things in one of these three modes by applying the appropriate
      36     combinations of options at link-time.
      37  
      38     When the -shared link option is used a final link is not being
      39     done.  */
      40  
      41  #undef LINK_SPEC
      42  #define LINK_SPEC "						\
      43    -melf" XLEN_SPEC DEFAULT_ENDIAN_SPEC "riscv			\
      44    %{p:%nconsider using `-pg' instead of `-p' with gprof (1)}	\
      45    %{v:-V}							\
      46    %{assert*} %{R*} %{rpath*} %{defsym*}				\
      47    %{mbig-endian:-EB}						\
      48    %{mlittle-endian:-EL}						\
      49    %{shared:-Bshareable %{h*} %{soname*}}			\
      50    %{symbolic:-Bsymbolic}					\
      51    %{static:-Bstatic}						\
      52    %{!shared:							\
      53        %{!static:						\
      54          %{rdynamic:-export-dynamic}				\
      55          -dynamic-linker " FBSD_DYNAMIC_LINKER "}		\
      56          %{static:-static}}"
      57  
      58  #define STARTFILE_PREFIX_SPEC 			\
      59     "/lib" XLEN_SPEC "/" ABI_SPEC "/ "		\
      60     "/usr/lib" XLEN_SPEC "/" ABI_SPEC "/ "	\
      61     "/lib/ "					\
      62     "/usr/lib/ "