1 /* Definitions of target machine for GNU compiler, for HP PA-RISC
2 Copyright (C) 1998, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
4 This file is part of GCC.
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)
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.
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. */
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() \
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 ()) \
42 builtin_define ("_HPUX_SOURCE"); \
43 builtin_define ("_INCLUDE_LONGLONG"); \
44 builtin_define ("__STDC_EXT__"); \
45 builtin_define ("__STDCPP__"); \
51 builtin_define ("_HPUX_SOURCE"); \
52 if (preprocessing_trad_p ()) \
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"); \
63 builtin_define ("__STDC_EXT__"); \
66 builtin_define ("_ILP32"); \
69 builtin_define ("_SIO"); \
72 builtin_define ("__hp9000s700"); \
73 builtin_define ("__hp9000s700__"); \
74 builtin_define ("_WSIO"); \
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. */
86 /* We can debug dynamically linked executables on hpux11; we also
87 want dereferencing of a NULL pointer to cause a SEGV. */
89 #if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_PA_11)
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}"
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}"
112 /* hpux 11 has posix threads. */
116 %{mt|pthread:-lpthread} -lc \
117 %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}"
119 /* Under hpux11, the normal location of the `ld' and `as' programs is the
120 /usr/ccs/bin directory. */
122 #ifndef CROSS_COMPILE
123 #undef MD_EXEC_PREFIX
124 #define MD_EXEC_PREFIX "/usr/ccs/bin/"
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. */
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/"
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
142 /* Make GCC agree with types.h. */
146 #define SIZE_TYPE "long unsigned int"
147 #define PTRDIFF_TYPE "long int"
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. */
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"
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