illumos-gcc: change to new library paths
[unleashed-userland.git] / components / developer / illumos-gcc / files / unleashed.h
blob7d57787b6b39409030b0b38fb31c356ce5378868
1 /* Operating system specific defines to be used when targeting GCC for any
2 Unleashed
3 Copyright (C) 2002-2014 Free Software Foundation, Inc.
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)
10 any later version.
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 #define SIG_ATOMIC_TYPE "int"
23 /* Names to predefine in the preprocessor for this target machine. */
24 #define TARGET_OS_CPP_BUILTINS() \
25 do { \
26 builtin_define_std ("unix"); \
27 builtin_define_std ("sun"); \
28 builtin_define ("__svr4__"); \
29 builtin_define ("__SVR4"); \
30 builtin_define ("__unleashed__"); \
31 builtin_assert ("system=unix"); \
32 builtin_assert ("system=svr4"); \
33 } while (0)
35 /* The Solaris linker will not merge a read-only .eh_frame section
36 with a read-write .eh_frame section. None of the encodings used
37 with non-PIC code require runtime relocations. In 64-bit mode,
38 since there is no backwards compatibility issue, we use a read-only
39 section for .eh_frame. In 32-bit mode, we use a writable .eh_frame
40 section in order to be compatible with G++ for Solaris x86. */
41 #undef EH_TABLES_CAN_BE_READ_ONLY
42 #define EH_TABLES_CAN_BE_READ_ONLY (TARGET_64BIT)
44 /* Use --as-needed/-z ignore -lgcc_s for eh support. */
45 #ifdef HAVE_LD_AS_NEEDED
46 #define USE_LD_AS_NEEDED 1
47 #endif
49 #undef STARTFILE_SPEC
50 #define STARTFILE_SPEC "%{!shared:%{p|pg:gcrt1.o%s;:crt1.o%s}} " \
51 "%{ansi:values-Xc.o%s}%{!ansi:values-Xa.o%s} " \
52 "crti.o%s crtbegin.o%s"
53 #undef ENDFILE_SPEC
54 #define ENDFILE_SPEC "crtend.o%s crtn.o%s"
56 /* XXX our headers should be fixed to use the same integral types for these on both 32 and 64 bit */
57 #undef WCHAR_TYPE
58 #define WCHAR_TYPE (TARGET_64BIT ? "int" : "long int")
59 #undef WCHAR_TYPE_SIZE
60 #define WCHAR_TYPE_SIZE 32
61 #undef WINT_TYPE
62 #define WINT_TYPE (TARGET_64BIT ? "int" : "long int")
63 #undef WINT_TYPE_SIZE
64 #define WINT_TYPE_SIZE 32
66 /* sunld spec */
67 #define LINK_SPEC \
68 "%{h*} %{YP,*} %{R*} %{shared:-G -dy %{!mimpure-text:-z text}} " \
69 "%{static:-dn -Bstatic} %{symbolic:-Bsymbolic -G -dy -z text}"
71 #define STARTFILE_PREFIX_SPEC "%{m32:/lib/i386/ /usr/lib/i386/}%{!m32:/lib/ /lib/amd64/ /usr/lib/ /usr/lib/amd64/}"
73 #undef LIB_SPEC
74 #define LIB_SPEC "%{!shared:%{pthread:-lpthread} %{p|pg:-ldl} -lc}"
76 /* The system headers under Solaris 2 are C++-aware since 2.0. */
77 #define NO_IMPLICIT_EXTERN_C
79 /* Allow macro expansion in #pragma pack. */
80 #define HANDLE_PRAGMA_PACK_WITH_EXPANSION 1
81 #define HANDLE_PRAGMA_PACK_PUSH_POP 1
83 /* Support Solaris-specific format checking for cmn_err. */
84 #define TARGET_N_FORMAT_TYPES 1
85 #define TARGET_FORMAT_TYPES solaris_format_types
86 extern GTY(()) tree solaris_pending_aligns;
87 extern GTY(()) tree solaris_pending_inits;
88 extern GTY(()) tree solaris_pending_finis;
90 /* #pragma init and #pragma fini are implemented on top of init and
91 fini attributes. */
92 #define SOLARIS_ATTRIBUTE_TABLE \
93 { "init", 0, 0, true, false, false, NULL }, \
94 { "fini", 0, 0, true, false, false, NULL }
95 /* Solaris-specific #pragmas are implemented on top of attributes. Hook in
96 the bits from config/sol2.c. */
97 #define SUBTARGET_INSERT_ATTRIBUTES solaris_insert_attributes
98 #define SUBTARGET_ATTRIBUTE_TABLE SOLARIS_ATTRIBUTE_TABLE
100 /* Register the Solaris-specific #pragma directives. */
101 #define REGISTER_SUBTARGET_PRAGMAS() solaris_register_pragmas ()
103 /* Output a simple call for .init/.fini. */
104 #define ASM_OUTPUT_CALL(FILE, FN) \
105 do \
107 fprintf (FILE, "\tcall\t"); \
108 print_operand (FILE, XEXP (DECL_RTL (FN), 0), 'P'); \
109 fprintf (FILE, "\n"); \
111 while (0)
113 #define SUBTARGET_OVERRIDE_OPTIONS \
114 do \
116 if (flag_omit_frame_pointer == 2) \
117 flag_omit_frame_pointer = 0; \
119 while (0)
121 #undef TARGET_SUBTARGET_DEFAULT
122 #define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_IEEE_FP \
123 | MASK_FLOAT_RETURNS)
125 #define SUBTARGET_OPTIMIZATION_OPTIONS \
126 do \
128 if (optimize >= 1) \
129 target_flags |= MASK_OMIT_LEAF_FRAME_POINTER; \
131 while (0)
132 #undef SUBTARGET_RETURN_IN_MEMORY
133 #define SUBTARGET_RETURN_IN_MEMORY(TYPE, FNTYPE) \
134 ix86_sol10_return_in_memory (TYPE, FNTYPE)
136 /* This is how to declare the size of a function. For Solaris, we output
137 any .init or .fini entries here. */
138 #undef ASM_DECLARE_FUNCTION_SIZE
139 #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
140 do \
142 if (!flag_inhibit_size_directive) \
143 ASM_OUTPUT_MEASURED_SIZE (FILE, FNAME); \
144 solaris_output_init_fini (FILE, DECL); \
146 while (0)
148 /* Only recent versions of Solaris 11 ld properly support hidden .gnu.linkonce
149 sections, so don't use them. */
150 #define USE_HIDDEN_LINKONCE 0
152 #undef SWITCH_TAKES_ARG
153 #define SWITCH_TAKES_ARG(CHAR) \
154 (DEFAULT_SWITCH_TAKES_ARG(CHAR) \
155 || (CHAR) == 'R' \
156 || (CHAR) == 'h' \
157 || (CHAR) == 'z')