OSDN Git Service

PR target/24837
[pf3gnuchains/gcc-fork.git] / gcc / config / m32r / linux.h
1 /* Definitions for Renesas M32R running Linux-based GNU systems using ELF.
2    Copyright (C) 2003, 2004, 2006 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 it
7    under the terms of the GNU General Public License as published
8    by the Free Software Foundation; either version 2, or (at your
9    option) any later version.
10
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.
15
16    You should have received a copy of the GNU General Public License
17    along with GCC; see the file COPYING.  If not, write to the
18    Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
19    MA 02110-1301, USA.  */
20
21 #define LINUX_DEFAULT_ELF
22
23 /* A lie, I guess, but the general idea behind linux/ELF is that we are
24    supposed to be outputting something that will assemble under SVr4.
25    This gets us pretty close.  */
26
27 #define HANDLE_SYSV_PRAGMA
28
29 #undef  HANDLE_PRAGMA_PACK
30
31 #undef  TARGET_VERSION
32 #define TARGET_VERSION fprintf (stderr, " (M32R GNU/Linux with ELF)");
33
34 #undef  SIZE_TYPE
35 #define SIZE_TYPE "unsigned int"
36  
37 #undef  PTRDIFF_TYPE
38 #define PTRDIFF_TYPE "int"
39   
40 #undef  WCHAR_TYPE
41 #define WCHAR_TYPE "long int"
42    
43 #undef  WCHAR_TYPE_SIZE
44 #define WCHAR_TYPE_SIZE BITS_PER_WORD
45     
46 /* Provide a LINK_SPEC appropriate for Linux.  Here we provide support
47    for the special GCC options -static and -shared, which allow us to
48    link things in one of these three modes by applying the appropriate
49    combinations of options at link-time. We like to support here for
50    as many of the other GNU linker options as possible. But I don't
51    have the time to search for those flags. I am sure how to add
52    support for -soname shared_object_name. H.J.
53
54    I took out %{v:%{!V:-V}}. It is too much :-(. They can use
55    -Wl,-V.
56
57    When the -shared link option is used a final link is not being
58    done.  */
59
60 /* If ELF is the default format, we should not use /lib/elf.  */
61
62 #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
63
64 #undef  LINK_SPEC
65 #if TARGET_LITTLE_ENDIAN
66 #define LINK_SPEC "%(link_cpu) -m m32rlelf_linux %{shared:-shared} \
67   %{!shared: \
68     %{!ibcs: \
69       %{!static: \
70         %{rdynamic:-export-dynamic} \
71         %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "}} \
72         %{static:-static}}}"
73 #else
74 #define LINK_SPEC "%(link_cpu) -m m32relf_linux %{shared:-shared} \
75   %{!shared: \
76     %{!ibcs: \
77       %{!static: \
78         %{rdynamic:-export-dynamic} \
79         %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "}} \
80         %{static:-static}}}"
81 #endif
82
83 #undef  LIB_SPEC
84 #define LIB_SPEC \
85   "%{shared: -lc} \
86     %{!shared: %{mieee-fp:-lieee} %{pthread:-lpthread} \
87     %{profile:-lc_p} %{!profile: -lc}}"
88
89 #undef  STARTFILE_SPEC
90 #if defined HAVE_LD_PIE
91 #define STARTFILE_SPEC \
92   "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
93    crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
94 #else
95 #define STARTFILE_SPEC \
96   "%{!shared: \
97      %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}\
98    crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
99 #endif
100
101 #undef  ENDFILE_SPEC
102 #define ENDFILE_SPEC \
103   "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
104
105 #undef  SUBTARGET_CPP_SPEC
106 #define SUBTARGET_CPP_SPEC "\
107    %{posix:-D_POSIX_SOURCE} \
108    %{pthread:-D_REENTRANT -D_PTHREADS} \
109 "
110                                                                                 
111 #define TARGET_OS_CPP_BUILTINS() LINUX_TARGET_OS_CPP_BUILTINS()
112
113 #define TARGET_ASM_FILE_END file_end_indicate_exec_stack