OSDN Git Service

2011-12-23 Tristan Gingold <gingold@adacore.com>
[pf3gnuchains/gcc-fork.git] / gcc / config / sol2-bi.h
1 /* Definitions of target machine for GCC, for bi-arch Solaris 2.
2    Copyright (C) 2011 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 under
7    the terms of the GNU General Public License as published by the Free
8    Software Foundation; either version 3, or (at your option) any later
9    version.
10
11    GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12    WARRANTY; without even the implied warranty of MERCHANTABILITY or
13    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14    for more details.
15
16    Under Section 7 of GPL version 3, you are granted additional
17    permissions described in the GCC Runtime Library Exception, version
18    3.1, as published by the Free Software Foundation.
19
20    You should have received a copy of the GNU General Public License and
21    a copy of the GCC Runtime Library Exception along with this program;
22    see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
23    <http://www.gnu.org/licenses/>.  */
24
25 /* wchar_t is called differently in <wchar.h> for 32 and 64-bit
26    compilations.  This is called for by SCD 2.4.1, p. 6-83, Figure 6-65
27    (32-bit) and p. 6P-10, Figure 6.38 (64-bit).  */
28
29 #undef WCHAR_TYPE
30 #define WCHAR_TYPE (TARGET_64BIT ? "int" : "long int")
31
32 #undef WCHAR_TYPE_SIZE
33 #define WCHAR_TYPE_SIZE 32
34
35 /* Same for wint_t.  See SCD 2.4.1, p. 6-83, Figure 6-66 (32-bit).  There's
36    no corresponding 64-bit definition, but this is what Solaris 8
37    <iso/wchar_iso.h> uses.  */
38
39 #undef WINT_TYPE
40 #define WINT_TYPE (TARGET_64BIT ? "int" : "long int")
41
42 #undef WINT_TYPE_SIZE
43 #define WINT_TYPE_SIZE 32
44
45 #if DEFAULT_ARCH32_P
46 #define MULTILIB_DEFAULTS { "m32" }
47 #else
48 #define MULTILIB_DEFAULTS { "m64" }
49 #endif
50
51 #if DEFAULT_ARCH32_P
52 #define DEF_ARCH32_SPEC(__str) "%{!m64:" __str "}"
53 #define DEF_ARCH64_SPEC(__str) "%{m64:" __str "}"
54 #else
55 #define DEF_ARCH32_SPEC(__str) "%{m32:" __str "}"
56 #define DEF_ARCH64_SPEC(__str) "%{!m32:" __str "}"
57 #endif
58
59 #undef ASM_CPU_DEFAULT_SPEC
60 #define ASM_CPU_DEFAULT_SPEC \
61 (DEFAULT_ARCH32_P ? "\
62 %{m64:" ASM_CPU64_DEFAULT_SPEC "} \
63 %{!m64:" ASM_CPU32_DEFAULT_SPEC "} \
64 " : "\
65 %{m32:" ASM_CPU32_DEFAULT_SPEC "} \
66 %{!m32:" ASM_CPU64_DEFAULT_SPEC "} \
67 ")
68
69 /* This should be the same as LINK_ARCH32_SPEC_BASE, except with
70    ARCH64_SUBDIR appended to the paths and /usr/ccs/lib is no longer
71    necessary.  */
72 #undef LINK_ARCH64_SPEC_BASE
73 #define LINK_ARCH64_SPEC_BASE \
74   "%{G:-G} \
75    %{YP,*} \
76    %{R*} \
77    %{!YP,*:%{p|pg:-Y P,%R/usr/lib/libp/" ARCH64_SUBDIR ":%R/lib/" ARCH64_SUBDIR ":%R/usr/lib/" ARCH64_SUBDIR "} \
78            %{!p:%{!pg:-Y P,%R/lib/" ARCH64_SUBDIR ":%R/usr/lib/" ARCH64_SUBDIR "}}}"
79
80 #undef LINK_ARCH64_SPEC
81 #ifndef USE_GLD
82 /* FIXME: Used to be SPARC-only.  Not SPARC-specfic but for the model name!  */
83 #define LINK_ARCH64_SPEC \
84   "%{mcmodel=medlow:-M /usr/lib/ld/" ARCH64_SUBDIR "/map.below4G} " \
85   LINK_ARCH64_SPEC_BASE
86 #else
87 #define LINK_ARCH64_SPEC LINK_ARCH64_SPEC_BASE
88 #endif
89
90 #ifdef USE_GLD
91 #if DEFAULT_ARCH32_P
92 #define ARCH_DEFAULT_EMULATION ARCH32_EMULATION
93 #else
94 #define ARCH_DEFAULT_EMULATION ARCH64_EMULATION
95 #endif
96 #define TARGET_LD_EMULATION "%{m32:-m " ARCH32_EMULATION "}" \
97                             "%{m64:-m " ARCH64_EMULATION "}" \
98                             "%{!m32:%{!m64:-m " ARCH_DEFAULT_EMULATION "}} "
99 #else
100 #define TARGET_LD_EMULATION ""
101 #endif
102
103 #undef LINK_ARCH_SPEC
104 #if DISABLE_MULTILIB
105 #if DEFAULT_ARCH32_P
106 #define LINK_ARCH_SPEC TARGET_LD_EMULATION " \
107 %{m32:%(link_arch32)} \
108 %{m64:%edoes not support multilib} \
109 %{!m32:%{!m64:%(link_arch_default)}} \
110 "
111 #else
112 #define LINK_ARCH_SPEC TARGET_LD_EMULATION " \
113 %{m32:%edoes not support multilib} \
114 %{m64:%(link_arch64)} \
115 %{!m32:%{!m64:%(link_arch_default)}} \
116 "
117 #endif
118 #else
119 #define LINK_ARCH_SPEC TARGET_LD_EMULATION " \
120 %{m32:%(link_arch32)} \
121 %{m64:%(link_arch64)} \
122 %{!m32:%{!m64:%(link_arch_default)}}"
123 #endif
124
125 #define LINK_ARCH_DEFAULT_SPEC \
126 (DEFAULT_ARCH32_P ? LINK_ARCH32_SPEC : LINK_ARCH64_SPEC)
127
128 #undef SUBTARGET_EXTRA_SPECS
129 #define SUBTARGET_EXTRA_SPECS \
130   { "startfile_arch",    STARTFILE_ARCH_SPEC },         \
131   { "link_arch32",       LINK_ARCH32_SPEC },            \
132   { "link_arch64",       LINK_ARCH64_SPEC },            \
133   { "link_arch_default", LINK_ARCH_DEFAULT_SPEC },      \
134   { "link_arch",         LINK_ARCH_SPEC },              \
135   SUBTARGET_CPU_EXTRA_SPECS