| 1 |
/* Definitions for RISC-V FreeBSD systems with ELF format. |
| 2 |
Copyright (C) 2018-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 |
| 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 |
" FBSD_LINK_PG_NOTE " \ |
| 46 |
%{v:-V} \ |
| 47 |
%{assert*} %{R*} %{rpath*} %{defsym*} \ |
| 48 |
-X \ |
| 49 |
%{mbig-endian:-EB} \ |
| 50 |
%{mlittle-endian:-EL} \ |
| 51 |
%{shared:-Bshareable %{h*} %{soname*}} \ |
| 52 |
%{symbolic:-Bsymbolic} \ |
| 53 |
%{static:-Bstatic} \ |
| 54 |
%{!shared: \ |
| 55 |
%{!static: \ |
| 56 |
%{rdynamic:-export-dynamic} \ |
| 57 |
-dynamic-linker " FBSD_DYNAMIC_LINKER "} \ |
| 58 |
%{static:-static}}" |
| 59 |
|
| 60 |
#define STARTFILE_PREFIX_SPEC \ |
| 61 |
"/lib" XLEN_SPEC "/" ABI_SPEC "/ " \ |
| 62 |
"/usr/lib" XLEN_SPEC "/" ABI_SPEC "/ " \ |
| 63 |
"/lib/ " \ |
| 64 |
"/usr/lib/ " |