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