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 GNU CC.
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)
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.
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, 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
27 #undef TARGET_OS_CPP_BUILTINS
28 #define TARGET_OS_CPP_BUILTINS() \
31 builtin_assert ("system=hpux"); \
32 builtin_assert ("system=unix"); \
33 builtin_define ("__hp9000s800"); \
34 builtin_define ("__hp9000s800__"); \
35 builtin_define ("__hpux"); \
36 builtin_define ("__hpux__"); \
37 builtin_define ("__unix"); \
38 builtin_define ("__unix__"); \
39 if (c_dialect_cxx ()) \
41 builtin_define ("_HPUX_SOURCE"); \
42 builtin_define ("_INCLUDE_LONGLONG"); \
43 builtin_define ("__STDC_EXT__"); \
49 builtin_define ("_HPUX_SOURCE"); \
50 if (preprocessing_trad_p ()) \
52 builtin_define ("hp9000s800"); \
53 builtin_define ("hppa"); \
54 builtin_define ("hpux"); \
55 builtin_define ("unix"); \
56 builtin_define ("__CLASSIC_C__"); \
57 builtin_define ("_PWB"); \
58 builtin_define ("PWB"); \
61 builtin_define ("__STDC_EXT__"); \
64 builtin_define ("_ILP32"); \
67 builtin_define ("_SIO"); \
70 builtin_define ("__hp9000s700"); \
71 builtin_define ("__hp9000s700__"); \
72 builtin_define ("_WSIO"); \
77 /* We can debug dynamically linked executables on hpux11; we also
78 want dereferencing of a NULL pointer to cause a SEGV. */
80 #if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_PA_11)
82 "%{!mpa-risc-1-0:%{!shared:-L/lib/pa1.1 -L/usr/lib/pa1.1 }}\
83 %{!shared:%{p:-L/lib/libp -L/usr/lib/libp %{!static:\
84 %nWarning: consider linking with `-static' as system libraries with\n\
85 %n profiling support are only provided in archive format}}}\
86 %{!shared:%{pg:-L/lib/libp -L/usr/lib/libp %{!static:\
87 %nWarning: consider linking with `-static' as system libraries with\n\
88 %n profiling support are only provided in archive format}}}\
89 -z %{mlinker-opt:-O} %{!shared:-u main -u __gcc_plt_call}\
90 %{static:-a archive} %{shared:-b}"
93 "%{!shared:%{p:-L/lib/libp -L/usr/lib/libp %{!static:\
94 %nWarning: consider linking with `-static' as system libraries with\n\
95 %n profiling support are only provided in archive format}}}\
96 %{!shared:%{pg:-L/lib/libp -L/usr/lib/libp %{!static:\
97 %nWarning: consider linking with `-static' as system libraries with\n\
98 %n profiling support are only provided in archive format}}}\
99 -z %{mlinker-opt:-O} %{!shared:-u main -u __gcc_plt_call}\
100 %{static:-a archive} %{shared:-b}"
103 /* Like the default, except no -lg. */
108 %{!threads:-lc %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}\
109 %{threads:-lcma -lc_r}}}\
110 %{p:%{!pg:-lc %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}}\
111 %{pg:-lc %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}}"
113 /* Under hpux11, the normal location of the `ld' and `as' programs is the
114 /usr/ccs/bin directory. */
116 #ifndef CROSS_COMPILE
117 #undef MD_EXEC_PREFIX
118 #define MD_EXEC_PREFIX "/usr/ccs/bin/"
121 /* Under hpux11 the normal location of the various *crt*.o files is
122 the /usr/ccs/lib directory. However, the profiling files are in
123 /opt/langtools/lib. */
125 #ifndef CROSS_COMPILE
126 #undef MD_STARTFILE_PREFIX
127 #define MD_STARTFILE_PREFIX "/usr/ccs/lib/"
128 #define MD_STARTFILE_PREFIX_1 "/opt/langtools/lib/"
131 /* hpux11 has the new HP assembler. It's still lousy, but it's a whole lot
132 better than the assembler shipped with older versions of hpux. */
133 #undef NEW_HP_ASSEMBLER
134 #define NEW_HP_ASSEMBLER 1
136 /* Make GCC agree with types.h. */
140 #define SIZE_TYPE "long unsigned int"
141 #define PTRDIFF_TYPE "long int"
143 /* HP-UX 11.0 and above provides initialization and finalization function
144 support from linker command line. We don't need to invoke __main to run
145 constructors. We also don't need chatr to determine the dependencies of
146 dynamically linked executables and shared libraries. */
148 #undef PARSE_LDD_OUTPUT
149 #undef HAS_INIT_SECTION
150 #define HAS_INIT_SECTION 1
151 #undef LD_INIT_SWITCH
152 #define LD_INIT_SWITCH "+init"
153 #undef LD_FINI_SWITCH
154 #define LD_FINI_SWITCH "+fini"
156 /* The HP-UX 11.X SOM linker (ld32) can successfully link shared libraries
157 with secondary definition (weak) symbols. */
158 #undef TARGET_SOM_SDEF
159 #define TARGET_SOM_SDEF 1