Merge from mainline (gomp-merge-2005-02-26).
[official-gcc.git] / gcc / config / pa / pa-hpux10.h
blob8c24793265de23c5c6f4436a5e05bf930c91cd9d
1 /* Definitions of target machine for GNU compiler, for HP PA-RISC
2 Copyright (C) 1995, 1996, 1997, 2000, 2001, 2002, 2003, 2004
3 Free Software Foundation, Inc.
4 Contributed by Tim Moore (moore@defmacro.cs.utah.edu)
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
13 GCC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING. If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
23 /* GCC always defines __STDC__. HP C++ compilers don't define it. This
24 causes trouble when sys/stdsyms.h is included. As a work around,
25 we define __STDC_EXT__. A similar situation exists with respect to
26 the definition of __cplusplus. We define _INCLUDE_LONGLONG
27 to prevent nlist.h from defining __STDC_32_MODE__ (no longlong
28 support). We define __STDCPP__ to get certain system headers
29 (notably assert.h) to assume standard preprocessor behavior in C++. */
30 #undef TARGET_OS_CPP_BUILTINS
31 #define TARGET_OS_CPP_BUILTINS() \
32 do \
33 { \
34 builtin_assert ("system=hpux"); \
35 builtin_assert ("system=unix"); \
36 builtin_define ("__hp9000s800"); \
37 builtin_define ("__hp9000s800__"); \
38 builtin_define ("__hpux"); \
39 builtin_define ("__hpux__"); \
40 builtin_define ("__unix"); \
41 builtin_define ("__unix__"); \
42 if (c_dialect_cxx ()) \
43 { \
44 builtin_define ("_HPUX_SOURCE"); \
45 builtin_define ("_INCLUDE_LONGLONG"); \
46 builtin_define ("__STDC_EXT__"); \
47 builtin_define ("__STDCPP__"); \
48 } \
49 else 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 (flag_pa_unix >= 1995) \
66 { \
67 builtin_define ("_XOPEN_UNIX"); \
68 builtin_define ("_XOPEN_SOURCE_EXTENDED"); \
69 } \
70 if (TARGET_SIO) \
71 builtin_define ("_SIO"); \
72 else \
73 { \
74 builtin_define ("__hp9000s700"); \
75 builtin_define ("__hp9000s700__"); \
76 builtin_define ("_WSIO"); \
77 } \
78 } \
79 while (0)
81 #undef SUBTARGET_OPTIONS
82 #define SUBTARGET_OPTIONS \
83 { "unix=", &pa_unix_string, \
84 N_("Specify UNIX standard for predefines and linking.\n" \
85 "Supported value is 93."), 0}
87 #define CPP_SPEC "%{threads: -D_REENTRANT -D_DCE_THREADS}"
89 /* We can debug dynamically linked executables on hpux9; we also want
90 dereferencing of a NULL pointer to cause a SEGV. */
91 #undef LINK_SPEC
92 #if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_PA_11)
93 #define LINK_SPEC \
94 "%{!mpa-risc-1-0:%{!march=1.0:%{!shared:-L/lib/pa1.1 -L/usr/lib/pa1.1 }}}\
95 %{!shared:%{p:-L/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 %{!shared:%{pg:-L/lib/libp %{!static:\
99 %nWarning: consider linking with `-static' as system libraries with\n\
100 %n profiling support are only provided in archive format}}}\
101 -z %{mlinker-opt:-O} %{!shared:-u main}\
102 %{static:-a archive} %{shared:-b}"
103 #else
104 #define LINK_SPEC \
105 "%{!shared:%{p:-L/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 %{!shared:%{pg:-L/lib/libp %{!static:\
109 %nWarning: consider linking with `-static' as system libraries with\n\
110 %n profiling support are only provided in archive format}}}\
111 -z %{mlinker-opt:-O} %{!shared:-u main}\
112 %{static:-a archive} %{shared:-b}"
113 #endif
115 /* Like the default, except no -lg. */
116 #undef LIB_SPEC
117 #define LIB_SPEC \
118 "%{!shared:\
119 %{!p:%{!pg:\
120 %{!threads:-lc %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}\
121 %{threads:-lcma -lc_r}}}\
122 %{p:%{!pg:-lc %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}}\
123 %{pg:-lc %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}}"
125 #undef THREAD_MODEL_SPEC
126 #define THREAD_MODEL_SPEC "%{!threads:single}%{threads:dce}"
128 /* Under hpux10, the normal location of the `ld' and `as' programs is the
129 /usr/ccs/bin directory. */
131 #ifndef CROSS_COMPILE
132 #undef MD_EXEC_PREFIX
133 #define MD_EXEC_PREFIX "/usr/ccs/bin/"
134 #endif
136 /* Under hpux10, the normal location of the various *crt*.o files is
137 the /usr/ccs/lib directory. However, the profiling files are in
138 /opt/langtools/lib. */
140 #ifndef CROSS_COMPILE
141 #undef MD_STARTFILE_PREFIX
142 #define MD_STARTFILE_PREFIX "/usr/ccs/lib/"
143 #define MD_STARTFILE_PREFIX_1 "/opt/langtools/lib/"
144 #endif
146 /* hpux10 has the new HP assembler. It's still lousy, but it's a whole lot
147 better than the assembler shipped with older versions of hpux. */
148 #undef NEW_HP_ASSEMBLER
149 #define NEW_HP_ASSEMBLER 1