1 /* Definitions of target machine for GNU compiler, for HP PA-RISC
2 Copyright (C) 1995-2013 Free Software Foundation, Inc.
3 Contributed by Tim Moore (moore@defmacro.cs.utah.edu)
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
12 GCC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
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 builtin_define ("__STDC_EXT__"); \
41 if (c_dialect_cxx ()) \
43 builtin_define ("_HPUX_SOURCE"); \
44 builtin_define ("_REENTRANT"); \
45 builtin_define ("_INCLUDE_LONGLONG"); \
46 builtin_define ("__STDCPP__"); \
50 builtin_define ("_HPUX_SOURCE"); \
51 builtin_define ("_REENTRANT"); \
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 if (flag_pa_unix >= 1995) \
65 builtin_define ("_XOPEN_UNIX"); \
66 builtin_define ("_XOPEN_SOURCE_EXTENDED"); \
69 builtin_define ("_SIO"); \
72 builtin_define ("__hp9000s700"); \
73 builtin_define ("__hp9000s700__"); \
74 builtin_define ("_WSIO"); \
79 #define CPP_SPEC "%{threads: -D_REENTRANT -D_DCE_THREADS}"
81 /* We can debug dynamically linked executables on hpux9; we also want
82 dereferencing of a NULL pointer to cause a SEGV. */
84 #if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_PA_11)
86 "%{!mpa-risc-1-0:%{!march=1.0:%{static:-L/lib/pa1.1 -L/usr/lib/pa1.1 }}}\
87 %{!shared:%{p:-L/lib/libp %{!static:\
88 %nwarning: consider linking with '-static' as system libraries with\n\
89 %n profiling support are only provided in archive format}}}\
90 %{!shared:%{pg:-L/lib/libp %{!static:\
91 %nwarning: consider linking with '-static' as system libraries with\n\
92 %n profiling support are only provided in archive format}}}\
93 %{!shared:%{!static:%{rdynamic:-E}}}\
94 -z %{mlinker-opt:-O} %{!shared:-u main}\
95 %{static:-a archive} %{shared:-b}"
98 "%{!shared:%{p:-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 %{!shared:%{pg:-L/lib/libp %{!static:\
102 %nwarning: consider linking with '-static' as system libraries with\n\
103 %n profiling support are only provided in archive format}}}\
104 %{!shared:%{!static:%{rdynamic:-E}}}\
105 -z %{mlinker-opt:-O} %{!shared:-u main}\
106 %{static:-a archive} %{shared:-b}"
109 /* Like the default, except no -lg. */
114 %{!threads:-lc %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}\
115 %{threads:-lcma -lc}}}\
116 %{p:%{!pg:-lc %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}}\
117 %{pg:-lc %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}}"
119 #undef THREAD_MODEL_SPEC
120 #define THREAD_MODEL_SPEC "%{!threads:single}%{threads:dce}"
122 /* Under hpux10, the normal location of the `ld' and `as' programs is the
123 /usr/ccs/bin directory. */
125 #ifndef CROSS_DIRECTORY_STRUCTURE
126 #undef MD_EXEC_PREFIX
127 #define MD_EXEC_PREFIX "/usr/ccs/bin/"
130 /* Under hpux10, the normal location of the various *crt*.o files is
131 the /usr/ccs/lib directory. However, the profiling files are in
132 /opt/langtools/lib. */
134 #ifndef CROSS_DIRECTORY_STRUCTURE
135 #undef MD_STARTFILE_PREFIX
136 #define MD_STARTFILE_PREFIX "/usr/ccs/lib/"
137 #define MD_STARTFILE_PREFIX_1 "/opt/langtools/lib/"
140 /* hpux10 has the new HP assembler. It's still lousy, but it's a whole lot
141 better than the assembler shipped with older versions of hpux. */
142 #undef NEW_HP_ASSEMBLER
143 #define NEW_HP_ASSEMBLER 1