linux.h revision 1.4
1/* Definitions for MicroBlaze running Linux.
2   Copyright (C) 2009-2016 Free Software Foundation, Inc.
3
4   This file is part of GCC.
5
6   Contributed by Michael Eager <eager@eagercon.com>.
7
8   GCC is free software; you can redistribute it and/or modify
9   it under the terms of the GNU General Public License as published by
10   the Free Software Foundation; either version 3, or (at your option)
11   any later version.
12
13   GCC is distributed in the hope that it will be useful,
14   but WITHOUT ANY WARRANTY; without even the implied warranty of
15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16   GNU General Public License for more details.
17
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/>.  */
21
22#undef TARGET_SUPPORTS_PIC
23#define TARGET_SUPPORTS_PIC 1
24
25#undef CPP_SPEC
26#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
27
28#undef TLS_NEEDS_GOT
29#define TLS_NEEDS_GOT 1
30
31#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
32
33#if TARGET_BIG_ENDIAN_DEFAULT == 0 /* LE */
34#define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:;:el}"
35#else
36#define MUSL_DYNAMIC_LINKER_E "%{mlittle-endian:el}"
37#endif
38
39#undef MUSL_DYNAMIC_LINKER
40#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-microblaze" MUSL_DYNAMIC_LINKER_E ".so.1"
41
42#undef  SUBTARGET_EXTRA_SPECS
43#define SUBTARGET_EXTRA_SPECS \
44  { "dynamic_linker", GNU_USER_DYNAMIC_LINKER }
45
46#undef LINK_SPEC
47#define LINK_SPEC "%{shared:-shared} \
48  %{!shared: \
49    %{!static: \
50      %{rdynamic:-export-dynamic} \
51      -dynamic-linker %(dynamic_linker)} \
52    %{static:-static}} \
53  %{mbig-endian:-EB} \
54  %{mlittle-endian:-EL}"
55
56/* For the microblaze-*-linux* subtarget.  */
57#undef TARGET_OS_CPP_BUILTINS
58#define TARGET_OS_CPP_BUILTINS() GNU_USER_TARGET_OS_CPP_BUILTINS()
59