| 1 |
/* Definitions of target machine for GNU compiler, for HP-UX. |
| 2 |
Copyright (C) 1991-2025 Free Software Foundation, Inc. |
| 3 |
|
| 4 |
This file is part of GCC. |
| 5 |
|
| 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 3, or (at your option) |
| 9 |
any later version. |
| 10 |
|
| 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. |
| 15 |
|
| 16 |
You should have received a copy of the GNU General Public License |
| 17 |
along with GCC; see the file COPYING3. If not see |
| 18 |
<http://www.gnu.org/licenses/>. */ |
| 19 |
|
| 20 |
/* HP-UX UNIX features. */ |
| 21 |
#undef TARGET_HPUX |
| 22 |
#define TARGET_HPUX 1 |
| 23 |
|
| 24 |
#undef HPUX_LONG_DOUBLE_LIBRARY |
| 25 |
#define HPUX_LONG_DOUBLE_LIBRARY 1 |
| 26 |
|
| 27 |
#undef TARGET_DEFAULT |
| 28 |
#define TARGET_DEFAULT 0 |
| 29 |
|
| 30 |
/* Make GCC agree with types.h. */ |
| 31 |
#undef SIZE_TYPE |
| 32 |
#undef PTRDIFF_TYPE |
| 33 |
|
| 34 |
#define SIZE_TYPE "unsigned int" |
| 35 |
#define PTRDIFF_TYPE "int" |
| 36 |
|
| 37 |
#undef PA_LONG_DOUBLE_TYPE_SIZE |
| 38 |
#define PA_LONG_DOUBLE_TYPE_SIZE 128 |
| 39 |
#define FLOAT_LIB_COMPARE_RETURNS_BOOL(MODE, COMPARISON) ((MODE) == TFmode) |
| 40 |
|
| 41 |
/* GCC always defines __STDC__. HP C++ compilers don't define it. This |
| 42 |
causes trouble when sys/stdsyms.h is included. As a work around, |
| 43 |
we define __STDC_EXT__. A similar situation exists with respect to |
| 44 |
the definition of __cplusplus. We define _INCLUDE_LONGLONG |
| 45 |
to prevent nlist.h from defining __STDC_32_MODE__ (no longlong |
| 46 |
support). */ |
| 47 |
#undef TARGET_OS_CPP_BUILTINS |
| 48 |
#define TARGET_OS_CPP_BUILTINS() \ |
| 49 |
do \ |
| 50 |
{ \ |
| 51 |
builtin_assert ("system=hpux"); \ |
| 52 |
builtin_assert ("system=unix"); \ |
| 53 |
builtin_define ("__hp9000s800"); \ |
| 54 |
builtin_define ("__hp9000s800__"); \ |
| 55 |
builtin_define ("__hp9k8"); \ |
| 56 |
builtin_define ("__hp9k8__"); \ |
| 57 |
builtin_define ("__hpux"); \ |
| 58 |
builtin_define ("__hpux__"); \ |
| 59 |
builtin_define ("__unix"); \ |
| 60 |
builtin_define ("__unix__"); \ |
| 61 |
builtin_define ("__STDC_EXT__"); \ |
| 62 |
if (c_dialect_cxx ()) \ |
| 63 |
{ \ |
| 64 |
builtin_define ("_HPUX_SOURCE"); \ |
| 65 |
builtin_define ("_INCLUDE_LONGLONG"); \ |
| 66 |
} \ |
| 67 |
else if (!flag_iso) \ |
| 68 |
{ \ |
| 69 |
builtin_define ("_HPUX_SOURCE"); \ |
| 70 |
if (preprocessing_trad_p ()) \ |
| 71 |
{ \ |
| 72 |
builtin_define ("hp9000s800"); \ |
| 73 |
builtin_define ("hp9k8"); \ |
| 74 |
builtin_define ("hppa"); \ |
| 75 |
builtin_define ("hpux"); \ |
| 76 |
builtin_define ("unix"); \ |
| 77 |
builtin_define ("__CLASSIC_C__"); \ |
| 78 |
builtin_define ("_PWB"); \ |
| 79 |
builtin_define ("PWB"); \ |
| 80 |
} \ |
| 81 |
} \ |
| 82 |
if (TARGET_SIO) \ |
| 83 |
builtin_define ("_SIO"); \ |
| 84 |
else \ |
| 85 |
{ \ |
| 86 |
builtin_define ("__hp9000s700"); \ |
| 87 |
builtin_define ("__hp9000s700__"); \ |
| 88 |
builtin_define ("_WSIO"); \ |
| 89 |
} \ |
| 90 |
} \ |
| 91 |
while (0) |
| 92 |
|
| 93 |
/* Like the default, except no -lg. */ |
| 94 |
#undef LIB_SPEC |
| 95 |
#define LIB_SPEC "%{!shared:%{!p:%{!pg:-lc}}%{p: -L/lib/libp/ -lc}%{pg: -L/lib/libp/ -lc}}" |
| 96 |
|
| 97 |
#undef LINK_SPEC |
| 98 |
#if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_PA_11) |
| 99 |
#define LINK_SPEC \ |
| 100 |
"%{!mpa-risc-1-0:%{!march=1.0:%{static:-L/lib/pa1.1 -L/usr/lib/pa1.1 }}}%{mlinker-opt:-O} %{!shared:-u main} %{static:-a archive} %{g*:-a archive} %{shared:-b}" |
| 101 |
#else |
| 102 |
#define LINK_SPEC \ |
| 103 |
"%{mlinker-opt:-O} %{!shared:-u main} %{static:-a archive} %{g*:-a archive} %{shared:-b}" |
| 104 |
#endif |
| 105 |
|
| 106 |
/* hpux11 and earlier don't have fputc_unlocked, so we must inhibit the |
| 107 |
transformation of fputs_unlocked and fprintf_unlocked to fputc_unlocked. */ |
| 108 |
#define DONT_HAVE_FPUTC_UNLOCKED |
| 109 |
|
| 110 |
/* We want the entry value of SP saved in the frame marker for |
| 111 |
compatibility with the HP-UX unwind library. */ |
| 112 |
#undef TARGET_HPUX_UNWIND_LIBRARY |
| 113 |
#define TARGET_HPUX_UNWIND_LIBRARY 1 |
| 114 |
|
| 115 |
#undef TARGET_LIBC_HAS_FUNCTION |
| 116 |
#define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function |