OSDN Git Service

2aa3149460063f820b1f39f638581aae9972bb67
[pf3gnuchains/gcc-fork.git] / gcc / config / pa / pa-hpux11.h
1 /* Definitions of target machine for GNU compiler, for HP PA-RISC
2    Copyright (C) 1998, 1999, 2000, 2002, 2003 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
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 GCC 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 GCC; see the file COPYING.  If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA.  */
20
21 /* GCC always defines __STDC__.  HP C++ compilers don't define it.  This
22    causes trouble when sys/stdsyms.h is included.  As a work around,
23    we define __STDC_EXT__.  A similar situation exists with respect to
24    the definition of __cplusplus.  We define _INCLUDE_LONGLONG
25    to prevent nlist.h from defining __STDC_32_MODE__ (no longlong
26    support).  We define __STDCPP__ to get certain system headers
27    (notably assert.h) to assume standard preprocessor behavior in C++.  */
28 #undef TARGET_OS_CPP_BUILTINS
29 #define TARGET_OS_CPP_BUILTINS()                                \
30   do                                                            \
31     {                                                           \
32         builtin_assert ("system=hpux");                         \
33         builtin_assert ("system=unix");                         \
34         builtin_define ("__hp9000s800");                        \
35         builtin_define ("__hp9000s800__");                      \
36         builtin_define ("__hpux");                              \
37         builtin_define ("__hpux__");                            \
38         builtin_define ("__unix");                              \
39         builtin_define ("__unix__");                            \
40         if (c_dialect_cxx ())                                   \
41           {                                                     \
42             builtin_define ("_HPUX_SOURCE");                    \
43             builtin_define ("_INCLUDE_LONGLONG");               \
44             builtin_define ("__STDC_EXT__");                    \
45             builtin_define ("__STDCPP__");                      \
46           }                                                     \
47         else                                                    \
48           {                                                     \
49             if (!flag_iso)                                      \
50               {                                                 \
51                 builtin_define ("_HPUX_SOURCE");                \
52                 if (preprocessing_trad_p ())                    \
53                   {                                             \
54                     builtin_define ("hp9000s800");              \
55                     builtin_define ("hppa");                    \
56                     builtin_define ("hpux");                    \
57                     builtin_define ("unix");                    \
58                     builtin_define ("__CLASSIC_C__");           \
59                     builtin_define ("_PWB");                    \
60                     builtin_define ("PWB");                     \
61                   }                                             \
62                 else                                            \
63                   builtin_define ("__STDC_EXT__");              \
64               }                                                 \
65             if (!TARGET_64BIT)                                  \
66               builtin_define ("_ILP32");                        \
67           }                                                     \
68         if (TARGET_SIO)                                         \
69           builtin_define ("_SIO");                              \
70         else                                                    \
71           {                                                     \
72             builtin_define ("__hp9000s700");                    \
73             builtin_define ("__hp9000s700__");                  \
74             builtin_define ("_WSIO");                           \
75           }                                                     \
76     }                                                           \
77   while (0)
78
79 #undef CPP_SPEC
80 #define CPP_SPEC \
81   "%{mt|pthread:-D_REENTRANT -D_THREAD_SAFE -D_POSIX_C_SOURCE=199506L}"
82 /* aCC defines also -DRWSTD_MULTI_THREAD, -DRW_MULTI_THREAD.  These
83    affect only aCC's C++ library (Rogue Wave-derived) which we do not
84    use, and they violate the user's name space.  */
85
86 /* We can debug dynamically linked executables on hpux11; we also
87    want dereferencing of a NULL pointer to cause a SEGV.  */
88 #undef LINK_SPEC
89 #if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_PA_11)
90 #define LINK_SPEC \
91   "%{!mpa-risc-1-0:%{!shared:-L/lib/pa1.1 -L/usr/lib/pa1.1 }}\
92    %{!shared:%{p:-L/lib/libp -L/usr/lib/libp %{!static:\
93      %nWarning: consider linking with `-static' as system libraries with\n\
94      %n  profiling support are only provided in archive format}}}\
95    %{!shared:%{pg:-L/lib/libp -L/usr/lib/libp %{!static:\
96      %nWarning: consider linking with `-static' as system libraries with\n\
97      %n  profiling support are only provided in archive format}}}\
98    -z %{mlinker-opt:-O} %{!shared:-u main -u __gcc_plt_call}\
99    %{static:-a archive} %{shared:-b}"
100 #else
101 #define LINK_SPEC \
102   "%{!shared:%{p:-L/lib/libp -L/usr/lib/libp %{!static:\
103      %nWarning: consider linking with `-static' as system libraries with\n\
104      %n  profiling support are only provided in archive format}}}\
105    %{!shared:%{pg:-L/lib/libp -L/usr/lib/libp %{!static:\
106      %nWarning: consider linking with `-static' as system libraries with\n\
107      %n  profiling support are only provided in archive format}}}\
108    -z %{mlinker-opt:-O} %{!shared:-u main -u __gcc_plt_call}\
109    %{static:-a archive} %{shared:-b}"
110 #endif
111
112 /* hpux 11 has posix threads.  */
113 #undef LIB_SPEC
114 #define LIB_SPEC \
115   "%{!shared:\
116      %{mt|pthread:-lpthread} -lc \
117      %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}"
118
119 /* Under hpux11, the normal location of the `ld' and `as' programs is the
120    /usr/ccs/bin directory.  */
121
122 #ifndef CROSS_COMPILE
123 #undef MD_EXEC_PREFIX
124 #define MD_EXEC_PREFIX "/usr/ccs/bin/"
125 #endif
126
127 /* Under hpux11 the normal location of the various *crt*.o files is
128    the /usr/ccs/lib directory.  However, the profiling files are in
129    /opt/langtools/lib.  */
130
131 #ifndef CROSS_COMPILE
132 #undef MD_STARTFILE_PREFIX
133 #define MD_STARTFILE_PREFIX "/usr/ccs/lib/"
134 #define MD_STARTFILE_PREFIX_1 "/opt/langtools/lib/"
135 #endif
136
137 /* hpux11 has the new HP assembler.  It's still lousy, but it's a whole lot
138    better than the assembler shipped with older versions of hpux.  */
139 #undef NEW_HP_ASSEMBLER
140 #define NEW_HP_ASSEMBLER 1
141
142 /* Make GCC agree with types.h.  */
143 #undef SIZE_TYPE
144 #undef PTRDIFF_TYPE
145
146 #define SIZE_TYPE "long unsigned int"
147 #define PTRDIFF_TYPE "long int"
148
149 /* HP-UX 11.0 and above provides initialization and finalization function
150    support from linker command line.  We don't need to invoke __main to run
151    constructors.  We also don't need chatr to determine the dependencies of
152    dynamically linked executables and shared libraries.  */
153 #undef LDD_SUFFIX
154 #undef PARSE_LDD_OUTPUT
155 #undef HAS_INIT_SECTION
156 #define HAS_INIT_SECTION 1
157 #undef LD_INIT_SWITCH
158 #define LD_INIT_SWITCH "+init"
159 #undef LD_FINI_SWITCH
160 #define LD_FINI_SWITCH "+fini"
161
162 /* The HP-UX 11.X SOM linker (ld32) can successfully link shared libraries
163    with secondary definition (weak) symbols.  */
164 #undef TARGET_SOM_SDEF
165 #define TARGET_SOM_SDEF 1