111
|
1 /* Definitions for RISC-V GNU/Linux systems with ELF format.
|
|
2 Copyright (C) 1998-2017 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 #define TARGET_OS_CPP_BUILTINS() \
|
|
21 do { \
|
|
22 GNU_USER_TARGET_OS_CPP_BUILTINS(); \
|
|
23 } while (0)
|
|
24
|
|
25 #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-riscv" XLEN_SPEC "-" ABI_SPEC ".so.1"
|
|
26
|
|
27 /* Because RISC-V only has word-sized atomics, it requries libatomic where
|
|
28 others do not. So link libatomic by default, as needed. */
|
|
29 #undef LIB_SPEC
|
|
30 #ifdef LD_AS_NEEDED_OPTION
|
|
31 #define LIB_SPEC GNU_USER_TARGET_LIB_SPEC \
|
|
32 " %{pthread:" LD_AS_NEEDED_OPTION " -latomic " LD_NO_AS_NEEDED_OPTION "}"
|
|
33 #else
|
|
34 #define LIB_SPEC GNU_USER_TARGET_LIB_SPEC " -latomic "
|
|
35 #endif
|
|
36
|
|
37 #define LINK_SPEC "\
|
|
38 -melf" XLEN_SPEC "lriscv \
|
|
39 %{shared} \
|
|
40 %{!shared: \
|
|
41 %{!static: \
|
|
42 %{rdynamic:-export-dynamic} \
|
|
43 -dynamic-linker " GNU_USER_DYNAMIC_LINKER "} \
|
|
44 %{static:-static}}"
|