OSDN Git Service

* config/usegld.h: New file.
[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 /* This should be the same as LINK_ARCH32_SPEC_BASE, except with
60    ARCH64_SUBDIR appended to the paths and /usr/ccs/lib is no longer
61    necessary.  */
62 #undef LINK_ARCH64_SPEC_BASE
63 #define LINK_ARCH64_SPEC_BASE \
64   "%{G:-G} \
65    %{YP,*} \
66    %{R*} \
67    %{!YP,*:%{p|pg:-Y P,%R/usr/lib/libp/" ARCH64_SUBDIR ":%R/lib/" ARCH64_SUBDIR ":%R/usr/lib/" ARCH64_SUBDIR "} \
68            %{!p:%{!pg:-Y P,%R/lib/" ARCH64_SUBDIR ":%R/usr/lib/" ARCH64_SUBDIR "}}}"
69
70 #undef LINK_ARCH64_SPEC
71 #ifndef USE_GLD
72 /* FIXME: Used to be SPARC-only.  Not SPARC-specfic but for the model name!  */
73 #define LINK_ARCH64_SPEC \
74   "%{mcmodel=medlow:-M /usr/lib/ld/" ARCH64_SUBDIR "/map.below4G} " \
75   LINK_ARCH64_SPEC_BASE
76 #else
77 #define LINK_ARCH64_SPEC LINK_ARCH64_SPEC_BASE
78 #endif
79
80 #ifdef USE_GLD
81 #define TARGET_LD_EMULATION "%{m32:-m " ARCH32_EMULATION "}" \
82                             "%{m64:-m " ARCH64_EMULATION "} "
83 #else
84 #define TARGET_LD_EMULATION ""
85 #endif
86
87 #undef LINK_ARCH_SPEC
88 #if DISABLE_MULTILIB
89 #if DEFAULT_ARCH32_P
90 #define LINK_ARCH_SPEC TARGET_LD_EMULATION " \
91 %{m32:%(link_arch32)} \
92 %{m64:%edoes not support multilib} \
93 %{!m32:%{!m64:%(link_arch_default)}} \
94 "
95 #else
96 #define LINK_ARCH_SPEC TARGET_LD_EMULATION " \
97 %{m32:%edoes not support multilib} \
98 %{m64:%(link_arch64)} \
99 %{!m32:%{!m64:%(link_arch_default)}} \
100 "
101 #endif
102 #else
103 #define LINK_ARCH_SPEC TARGET_LD_EMULATION " \
104 %{m32:%(link_arch32)} \
105 %{m64:%(link_arch64)} \
106 %{!m32:%{!m64:%(link_arch_default)}}"
107 #endif
108
109 #define LINK_ARCH_DEFAULT_SPEC \
110 (DEFAULT_ARCH32_P ? LINK_ARCH32_SPEC : LINK_ARCH64_SPEC)
111
112 #undef SUBTARGET_EXTRA_SPECS
113 #define SUBTARGET_EXTRA_SPECS \
114   { "startfile_arch",    STARTFILE_ARCH_SPEC },         \
115   { "link_arch32",       LINK_ARCH32_SPEC },            \
116   { "link_arch64",       LINK_ARCH64_SPEC },            \
117   { "link_arch_default", LINK_ARCH_DEFAULT_SPEC },      \
118   { "link_arch",         LINK_ARCH_SPEC },              \
119   SUBTARGET_CPU_EXTRA_SPECS