1 /* Definitions of target support for Altera Nios II systems
2 running GNU/Linux with ELF format.
3 Copyright (C) 2012-2023 Free Software Foundation, Inc.
4 Contributed by Mentor Graphics, Inc.
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published
10 by the Free Software Foundation; either version 3, or (at your
11 option) any later version.
13 GCC is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
16 License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING3. If not see
20 <http://www.gnu.org/licenses/>. */
22 #define TARGET_OS_CPP_BUILTINS() \
25 GNU_USER_TARGET_OS_CPP_BUILTINS(); \
30 #define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
32 #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-nios2.so.1"
34 #undef MUSL_DYNAMIC_LINKER
35 #define MUSL_DYNAMIC_LINKER "/lib/ld-musl-nios2.so.1"
38 #define LINK_SPEC LINK_SPEC_ENDIAN \
42 %{rdynamic:-export-dynamic} \
43 -dynamic-linker " GNU_USER_DYNAMIC_LINKER "} \
46 /* This toolchain implements the ABI for Linux Systems documented in the
47 Nios II Processor Reference Handbook. */
48 #define TARGET_LINUX_ABI 1
50 /* For Linux, we have access to kernel support for atomic operations,
51 add initialization for __sync_* builtins. */
52 #undef TARGET_INIT_LIBFUNCS
53 #define TARGET_INIT_LIBFUNCS nios2_init_libfuncs