Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / gcc / config / m32r / linux.h
blobfd09f242ee35ef65953064fc1bb1ac9b6a58cf48
1 /* Definitions for Renesas M32R running Linux-based GNU systems using ELF.
2 Copyright (C) 2003, 2004, 2006, 2007, 2010 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published
8 by the Free Software Foundation; either version 3, or (at your
9 option) any later version.
11 GCC is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
14 License for more details.
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/>. */
20 #define LINUX_DEFAULT_ELF
22 /* A lie, I guess, but the general idea behind linux/ELF is that we are
23 supposed to be outputting something that will assemble under SVr4.
24 This gets us pretty close. */
26 #undef TARGET_VERSION
27 #define TARGET_VERSION fprintf (stderr, " (M32R GNU/Linux with ELF)");
29 #undef SIZE_TYPE
30 #define SIZE_TYPE "unsigned int"
32 #undef PTRDIFF_TYPE
33 #define PTRDIFF_TYPE "int"
35 #undef WCHAR_TYPE
36 #define WCHAR_TYPE "long int"
38 #undef WCHAR_TYPE_SIZE
39 #define WCHAR_TYPE_SIZE BITS_PER_WORD
41 /* Provide a LINK_SPEC appropriate for Linux. Here we provide support
42 for the special GCC options -static and -shared, which allow us to
43 link things in one of these three modes by applying the appropriate
44 combinations of options at link-time.
46 When the -shared link option is used a final link is not being
47 done. */
49 #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
51 #undef LINK_SPEC
52 #if TARGET_LITTLE_ENDIAN
53 #define LINK_SPEC "%(link_cpu) -m m32rlelf_linux %{shared:-shared} \
54 %{!shared: \
55 %{!ibcs: \
56 %{!static: \
57 %{rdynamic:-export-dynamic} \
58 -dynamic-linker " LINUX_DYNAMIC_LINKER "} \
59 %{static:-static}}}"
60 #else
61 #define LINK_SPEC "%(link_cpu) -m m32relf_linux %{shared:-shared} \
62 %{!shared: \
63 %{!ibcs: \
64 %{!static: \
65 %{rdynamic:-export-dynamic} \
66 -dynamic-linker " LINUX_DYNAMIC_LINKER "} \
67 %{static:-static}}}"
68 #endif
70 #undef LIB_SPEC
71 #define LIB_SPEC \
72 "%{pthread:-lpthread} \
73 %{shared: -lc} \
74 %{!shared: \
75 %{mieee-fp:-lieee} \
76 %{profile:-lc_p} %{!profile: -lc}}"
78 #undef STARTFILE_SPEC
79 #if defined HAVE_LD_PIE
80 #define STARTFILE_SPEC \
81 "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
82 crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
83 #else
84 #define STARTFILE_SPEC \
85 "%{!shared: \
86 %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}\
87 crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
88 #endif
90 #undef ENDFILE_SPEC
91 #define ENDFILE_SPEC \
92 "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
94 #undef SUBTARGET_CPP_SPEC
95 #define SUBTARGET_CPP_SPEC "\
96 %{posix:-D_POSIX_SOURCE} \
97 %{pthread:-D_REENTRANT -D_PTHREADS} \
100 #define TARGET_OS_CPP_BUILTINS() LINUX_TARGET_OS_CPP_BUILTINS()
102 #define TARGET_ASM_FILE_END file_end_indicate_exec_stack