OSDN Git Service

* config/sh/linux-unwind.h (sh_fallback_frame_state): Use
[pf3gnuchains/gcc-fork.git] / gcc / config / sh / superh.h
1 /* Definitions of target machine for gcc for Super-H using sh-superh-elf.
2    Copyright (C) 2001, 2006 Free Software Foundation, Inc.
3
4 This file is part of GNU CC.
5
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING.  If not, write to
18 the Free Software Foundation, 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.  */
20
21
22 /* This header file is used when the vendor name is set to 'superh'.
23    config.gcc already configured the compiler for SH4 only and switched
24    the default endianess to little (although big endian is still available).
25    This file configures the spec file to the default board configuration
26    but in such a way that it can be overridden by a boardspecs file
27    (using the -specs= option). This file is expected to disable the
28    defaults and provide options --defsym _start and --defsym _stack
29    which are required by the SuperH configuration of GNU ld.
30
31    This file is intended to override sh.h.  */
32
33
34 #ifndef _SUPERH_H
35 #define _SUPERH_H
36 #endif
37
38
39 #undef TARGET_VERSION
40 #define TARGET_VERSION fprintf (stderr, " (SuperH SH special %s)", __DATE__);
41
42 /* Override the linker spec strings to use the new emulation
43    The specstrings are concatenated as follows
44    LINK_EMUL_PREFIX.(''|'32'|'64'|LINK_DEFAULT_CPU_EMUL).SUBTARGET_LINK_EMUL_SUFFIX
45 */
46 #undef LINK_EMUL_PREFIX
47 #undef SUBTARGET_LINK_EMUL_SUFFIX
48
49 #define LINK_EMUL_PREFIX "superh"
50 #define SUBTARGET_LINK_EMUL_SUFFIX ""
51
52 /* Add the SUBTARGET_LINK_SPEC to add the board and runtime support and
53    change the endianness */
54 #undef SUBTARGET_LINK_SPEC
55 #if  TARGET_ENDIAN_DEFAULT == MASK_LITTLE_ENDIAN
56 #define SUBTARGET_LINK_SPEC "%(board_link) %(ldruntime) %{ml|!mb:-EL}%{mb:-EB}"
57 #else
58 #define SUBTARGET_LINK_SPEC "%(board_link) %(ldruntime) %{ml:-EL}%{mb|!ml:-EB}"
59 #endif
60
61
62 /* This is used by the link spec if the boardspecs file is not used (for whatever reason).
63    If the boardspecs file overrides this then an alternative can be used. */
64 #undef SUBTARGET_EXTRA_SPECS
65 #define SUBTARGET_EXTRA_SPECS \
66 { "board_link", "--defsym _start=0x1000 --defsym _stack=0x30000" }, \
67 { "asruntime", "" }, \
68 { "cppruntime", "-D__GDB_SIM__" }, \
69 { "cc1runtime", "" }, \
70 { "ldruntime", "" }, \
71 { "libruntime", "-lc -lgloss" }
72
73
74 /* Set the SUBTARGET_CPP_SPEC to define __EMBEDDED_CROSS__ which has an effect
75    on newlib and provide the runtime support */
76 #undef SUBTARGET_CPP_SPEC
77 #define SUBTARGET_CPP_SPEC \
78 "-D__EMBEDDED_CROSS__ %{m4-100*:-D__SH4_100__} %{m4-200*:-D__SH4_200__} %{m4-300*:-D__SH4_300__} %{m4-340:-D__SH4_340__} %{m4-400:-D__SH4_400__} %{m4-500:-D__SH4_500__} \
79 %(cppruntime)"
80
81 /* Override the SUBTARGET_ASM_SPEC to add the runtime support */
82 #undef SUBTARGET_ASM_SPEC
83 #define SUBTARGET_ASM_SPEC "%{m4-100*|m4-200*:-isa=sh4} %{m4-400|m4-340:-isa=sh4-nommu-nofpu} %{m4-500:-isa=sh4-nofpu} %(asruntime)"
84
85 /* Override the SUBTARGET_ASM_RELAX_SPEC so it doesn't interfere with the
86    runtime support by adding -isa=sh4 in the wrong place.  */
87 #undef SUBTARGET_ASM_RELAX_SPEC
88 #define SUBTARGET_ASM_RELAX_SPEC "%{!m4-100*:%{!m4-200*:%{!m4-300*:%{!m4-340:%{!m4-400:%{!m4-500:-isa=sh4}}}}}}"
89
90 /* Create the CC1_SPEC to add the runtime support */
91 #undef CC1_SPEC
92 #define CC1_SPEC "%(cc1runtime)"
93
94 #undef CC1PLUS_SPEC
95 #define CC1PLUS_SPEC "%(cc1runtime)"
96
97
98 /* Override the LIB_SPEC to add the runtime support */
99 #undef LIB_SPEC
100 #define LIB_SPEC "%{!shared:%{!symbolic:%(libruntime) -lc}} %{pg:-lprofile -lc}"
101
102 /* Override STARTFILE_SPEC to add profiling and MMU support.  */
103 #undef STARTFILE_SPEC
104 #define STARTFILE_SPEC \
105   "%{!shared: %{!m4-400*:%{!m4-340*: %{pg:gcrt1-mmu.o%s}%{!pg:crt1-mmu.o%s}}}} \
106    %{!shared: %{m4-340*|m4-400*: %{pg:gcrt1.o%s}%{!pg:crt1.o%s}}} \
107    crti.o%s \
108    %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"