00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #undef PREFERRED_DEBUGGING_TYPE
00025 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
00026
00027
00028 #undef WCHAR_TYPE
00029 #define WCHAR_TYPE "long int"
00030
00031 #undef WCHAR_TYPE_SIZE
00032 #define WCHAR_TYPE_SIZE BITS_PER_WORD
00033
00034
00035
00036 #undef WINT_TYPE
00037 #define WINT_TYPE "long int"
00038
00039 #undef WINT_TYPE_SIZE
00040 #define WINT_TYPE_SIZE BITS_PER_WORD
00041
00042 #define TARGET_HANDLE_PRAGMA_REDEFINE_EXTNAME 1
00043
00044
00045
00046
00047
00048 #undef CPP_SUBTARGET_SPEC
00049 #define CPP_SUBTARGET_SPEC "\
00050 %{pthreads:-D_REENTRANT -D_PTHREADS} \
00051 %{!pthreads:%{threads:-D_REENTRANT -D_SOLARIS_THREADS}} \
00052 %{compat-bsd:-iwithprefixbefore ucbinclude -I/usr/ucbinclude} \
00053 "
00054
00055
00056 #define TARGET_SUB_OS_CPP_BUILTINS()
00057 #define TARGET_OS_CPP_BUILTINS() \
00058 do { \
00059 builtin_define_std ("unix"); \
00060 builtin_define_std ("sun"); \
00061 builtin_define ("__svr4__"); \
00062 builtin_define ("__SVR4"); \
00063 builtin_assert ("system=unix"); \
00064 builtin_assert ("system=svr4"); \
00065
00066
00067 \
00068 if (c_dialect_cxx ()) \
00069 { \
00070 builtin_define ("_XOPEN_SOURCE=500"); \
00071 builtin_define ("_LARGEFILE_SOURCE=1"); \
00072 builtin_define ("_LARGEFILE64_SOURCE=1"); \
00073 builtin_define ("__EXTENSIONS__"); \
00074 } \
00075 if (flag_pic) \
00076 { \
00077 builtin_define ("__PIC__"); \
00078 builtin_define ("__pic__"); \
00079 } \
00080 TARGET_SUB_OS_CPP_BUILTINS(); \
00081 } while (0)
00082
00083
00084 #define NO_IMPLICIT_EXTERN_C
00085
00086
00087
00088 #undef ASM_SPEC
00089 #define ASM_SPEC "\
00090 %{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Wa,*:%*} -s \
00091 %{fpic|fpie|fPIC|fPIE:-K PIC} \
00092 %(asm_cpu) \
00093 "
00094
00095
00096 #undef LIB_SPEC
00097 #define LIB_SPEC \
00098 "%{compat-bsd:-lucb -lsocket -lnsl -lelf -laio} \
00099 %{!shared:\
00100 %{!symbolic:\
00101 %{pthreads:-lpthread} \
00102 %{!pthreads:%{threads:-lthread}} \
00103 %{p|pg:-ldl} -lc}}"
00104
00105 #undef ENDFILE_SPEC
00106 #define ENDFILE_SPEC "crtend.o%s crtn.o%s"
00107
00108
00109 #undef STARTFILE_SPEC
00110 #define STARTFILE_SPEC "%{!shared: \
00111 %{!symbolic: \
00112 %{p:mcrt1.o%s} \
00113 %{!p: \
00114 %{pg:gcrt1.o%s gmon.o%s} \
00115 %{!pg:crt1.o%s}}}} \
00116 crti.o%s %(startfile_arch) \
00117 crtbegin.o%s"
00118
00119 #undef STARTFILE_ARCH32_SPEC
00120 #define STARTFILE_ARCH32_SPEC "%{ansi:values-Xc.o%s} \
00121 %{!ansi:values-Xa.o%s}"
00122
00123 #undef STARTFILE_ARCH_SPEC
00124 #define STARTFILE_ARCH_SPEC STARTFILE_ARCH32_SPEC
00125
00126 #undef LINK_ARCH32_SPEC_BASE
00127 #define LINK_ARCH32_SPEC_BASE \
00128 "%{G:-G} \
00129 %{YP,*} \
00130 %{R*} \
00131 %{compat-bsd: \
00132 %{!YP,*:%{p|pg:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
00133 %{!p:%{!pg:-Y P,/usr/ucblib:/usr/ccs/lib:/usr/lib}}} \
00134 -R /usr/ucblib} \
00135 %{!compat-bsd: \
00136 %{!YP,*:%{p|pg:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
00137 %{!p:%{!pg:-Y P,/usr/ccs/lib:/usr/lib}}}}"
00138
00139 #undef LINK_ARCH32_SPEC
00140 #define LINK_ARCH32_SPEC LINK_ARCH32_SPEC_BASE
00141
00142 #undef LINK_ARCH_SPEC
00143 #define LINK_ARCH_SPEC LINK_ARCH32_SPEC
00144
00145
00146 #undef LINK_SPEC
00147 #define LINK_SPEC \
00148 "%{h*} %{v:-V} \
00149 %{b} %{Wl,*:%*} \
00150 %{static:-dn -Bstatic} \
00151 %{shared:-G -dy %{!mimpure-text:-z text}} \
00152 %{symbolic:-Bsymbolic -G -dy -z text} \
00153 %(link_arch) \
00154 %{Qy:} %{!Qn:-Qy}"
00155
00156
00157
00158
00159 #undef SUPPORTS_INIT_PRIORITY
00160 #define SUPPORTS_INIT_PRIORITY 0
00161
00162
00163
00164 #undef SWITCH_TAKES_ARG
00165 #define SWITCH_TAKES_ARG(CHAR) \
00166 (DEFAULT_SWITCH_TAKES_ARG(CHAR) \
00167 || (CHAR) == 'R' \
00168 || (CHAR) == 'h' \
00169 || (CHAR) == 'z')
00170
00171 #define STDC_0_IN_SYSTEM_HEADERS 1
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186 #define ENABLE_EXECUTE_STACK \
00187 \
00188 \
00189 \
00190 static int need_enable_exec_stack; \
00191 \
00192 static void check_enabling(void) __attribute__ ((constructor)); \
00193 static void check_enabling(void) \
00194 { \
00195 extern long sysconf(int); \
00196 \
00197 int prot = (int) sysconf(515 ); \
00198 if (prot != 7 ) \
00199 need_enable_exec_stack = 1; \
00200 } \
00201 \
00202 extern void __enable_execute_stack (void *); \
00203 void \
00204 __enable_execute_stack (void *addr) \
00205 { \
00206 extern int mprotect(void *, size_t, int); \
00207 if (!need_enable_exec_stack) \
00208 return; \
00209 else { \
00210 long size = getpagesize (); \
00211 long mask = ~(size-1); \
00212 char *page = (char *) (((long) addr) & mask); \
00213 char *end = (char *) ((((long) (addr + TRAMPOLINE_SIZE)) & mask) + size); \
00214 \
00215 if (mprotect (page, end - page, 7 ) < 0) \
00216 perror ("mprotect of trampoline code"); \
00217 } \
00218 }
00219
00220
00221 #define TARGET_N_FORMAT_TYPES 1
00222 #define TARGET_FORMAT_TYPES solaris_format_types
00223
00224
00225
00226 #define SOLARIS_ATTRIBUTE_TABLE \
00227 { "init", 0, 0, true, false, false, NULL }, \
00228 { "fini", 0, 0, true, false, false, NULL }
00229
00230
00231
00232 #undef ASM_DECLARE_FUNCTION_SIZE
00233 #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
00234 do \
00235 { \
00236 if (!flag_inhibit_size_directive) \
00237 ASM_OUTPUT_MEASURED_SIZE (FILE, FNAME); \
00238 solaris_output_init_fini (FILE, DECL); \
00239 } \
00240 while (0)
00241
00242
00243 #define REGISTER_TARGET_PRAGMAS() solaris_register_pragmas ()
00244
00245 extern GTY(()) tree solaris_pending_aligns;
00246 extern GTY(()) tree solaris_pending_inits;
00247 extern GTY(()) tree solaris_pending_finis;
00248
00249
00250 #define HANDLE_PRAGMA_PACK_WITH_EXPANSION