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