xref: /netbsd-src/external/gpl3/gcc.old/dist/gcc/config/arm/uclinux-elf.h (revision b83ebeba7f767758d2778bb0f9d7a76534253621)
1 /* Definitions for ARM running ucLinux using ELF
2    Copyright (C) 1999-2013 Free Software Foundation, Inc.
3    Contributed by Philip Blundell <pb@nexus.co.uk>
4 
5    This file is part of GCC.
6 
7    GCC is free software; you can redistribute it and/or modify it
8    under the terms of the GNU General Public License as published
9    by the Free Software Foundation; either version 3, or (at your
10    option) any later version.
11 
12    GCC is distributed in the hope that it will be useful, but WITHOUT
13    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
15    License for more details.
16 
17    You should have received a copy of the GNU General Public License
18    along with GCC; see the file COPYING3.  If not see
19    <http://www.gnu.org/licenses/>.  */
20 
21 /* We don't want a PLT.  */
22 #undef  NEED_PLT_RELOC
23 #define NEED_PLT_RELOC 0
24 
25 #undef  TARGET_DEFAULT
26 #define TARGET_DEFAULT (MASK_SINGLE_PIC_BASE)
27 
28 /* NOTE: The remaining definitions in this file are needed because uclinux
29    does not use config/linux.h.  */
30 
31 /* Add GNU/Linux builtins.  */
32 #undef TARGET_OS_CPP_BUILTINS
33 #define TARGET_OS_CPP_BUILTINS() 		\
34   do 						\
35     {						\
36       builtin_define ("__uClinux__");		\
37       builtin_define ("__gnu_linux__");         \
38       builtin_define_std ("linux");             \
39       builtin_define_std ("unix");              \
40       builtin_assert ("system=linux");          \
41       builtin_assert ("system=unix");           \
42       builtin_assert ("system=posix");          \
43     }						\
44   while (false)
45 
46 /* Do not assume anything about header files.  */
47 #define NO_IMPLICIT_EXTERN_C
48 
49 /* The GNU C++ standard library requires that these macros be defined.  */
50 #undef CPLUSPLUS_CPP_SPEC
51 #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
52 
53 #undef SUBTARGET_EXTRA_LINK_SPEC
54 #define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux"
55 
56 /* Now we define the strings used to build the spec file.  */
57 #undef  STARTFILE_SPEC
58 #define STARTFILE_SPEC	"crt1%O%s crti%O%s crtbegin%O%s"
59 
60 #undef  ENDFILE_SPEC
61 #define ENDFILE_SPEC	"crtend%O%s crtn%O%s"
62 
63 #undef  CC1_SPEC
64 #define CC1_SPEC "%{profile:-p}"
65 
66 #undef LINK_GCC_C_SEQUENCE_SPEC
67 #define LINK_GCC_C_SEQUENCE_SPEC \
68   "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
69 
70 /* Use --as-needed -lgcc_s for eh support.  */
71 #ifdef HAVE_LD_AS_NEEDED
72 #define USE_LD_AS_NEEDED 1
73 #endif
74 
75 #undef LINK_SPEC
76 #define LINK_SPEC "%{mbig-endian:-EB} %{mlittle-endian:-EL} -X -elf2flt"
77 
78 #undef  LIB_SPEC
79 #define LIB_SPEC \
80   "%{pthread:-lpthread} \
81    %{shared:-lc} \
82    %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
83 
84 #define TARGET_DEFAULT_WORD_RELOCATIONS 1
85