]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/i386/sco5.h
1 /* Definitions for Intel 386 running SCO Unix System V 3.2 Version 5.
2 Copyright (C) 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2002
3 Free Software Foundation, Inc.
4 Contributed by Kean Johnston (hug@netcom.com)
6 This file is part of GNU CC.
8 GNU CC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
13 GNU CC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GNU CC; see the file COPYING. If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
23 #define TARGET_VERSION fprintf (stderr, " (i386, SCO OpenServer 5 Syntax)");
29 #define ALIGN_ASM_OP "\t.align\t"
31 #undef ASCII_DATA_ASM_OP
32 #define ASCII_DATA_ASM_OP "\t.ascii\t"
35 #define IDENT_ASM_OP "\t.ident\t"
38 #define COMMON_ASM_OP "\t.comm\t"
41 #define SET_ASM_OP "\t.set\t"
44 #define LOCAL_ASM_OP "\t.local\t"
47 #define ASM_SHORT "\t.value\t"
50 #define ASM_LONG "\t.long\t"
55 #define TYPE_ASM_OP "\t.type\t"
58 #define SIZE_ASM_OP "\t.size\t"
61 #define STRING_ASM_OP "\t.string\t"
64 #define SKIP_ASM_OP "\t.zero\t"
67 #define GLOBAL_ASM_OP "\t.globl\t"
69 #undef EH_FRAME_SECTION_ASM_OP
70 #define EH_FRAME_SECTION_NAME_COFF ".ehfram"
71 #define EH_FRAME_SECTION_NAME_ELF ".eh_frame"
72 #define EH_FRAME_SECTION_NAME \
73 ((TARGET_ELF) ? EH_FRAME_SECTION_NAME_ELF : EH_FRAME_SECTION_NAME_COFF)
75 /* Avoid problems (long sectino names, forward assembler refs) with DWARF
76 exception unwinding when we're generating COFF */
77 #define DWARF2_UNWIND_INFO \
78 ((TARGET_ELF) ? 1 : 0 )
80 #undef READONLY_DATA_SECTION_ASM_OP
81 #define READONLY_DATA_SECTION_ASM_OP_COFF "\t.section\t.rodata, \"x\""
82 #define READONLY_DATA_SECTION_ASM_OP_ELF "\t.section\t.rodata"
83 #define READONLY_DATA_SECTION_ASM_OP \
85 ? READONLY_DATA_SECTION_ASM_OP_ELF \
86 : READONLY_DATA_SECTION_ASM_OP_COFF)
88 #undef INIT_SECTION_ASM_OP
89 #define INIT_SECTION_ASM_OP_ELF "\t.section\t.init"
90 /* Rename these for COFF because crt1.o will try to run them. */
91 #define INIT_SECTION_ASM_OP_COFF "\t.section\t.ctor ,\"x\""
92 #define INIT_SECTION_ASM_OP \
93 ((TARGET_ELF) ? INIT_SECTION_ASM_OP_ELF : INIT_SECTION_ASM_OP_COFF)
95 #undef CTORS_SECTION_ASM_OP
96 #define CTORS_SECTION_ASM_OP_ELF "\t.section\t.ctors,\"aw\""
97 #define CTORS_SECTION_ASM_OP_COFF INIT_SECTION_ASM_OP_COFF
98 #define CTORS_SECTION_ASM_OP \
99 ((TARGET_ELF) ? CTORS_SECTION_ASM_OP_ELF : CTORS_SECTION_ASM_OP_COFF)
101 #undef DTORS_SECTION_ASM_OP
102 #define DTORS_SECTION_ASM_OP_ELF "\t.section\t.dtors, \"aw\""
103 #define DTORS_SECTION_ASM_OP_COFF FINI_SECTION_ASM_OP_COFF
104 #define DTORS_SECTION_ASM_OP \
105 ((TARGET_ELF) ? DTORS_SECTION_ASM_OP_ELF : DTORS_SECTION_ASM_OP_COFF)
107 #undef FINI_SECTION_ASM_OP
108 #define FINI_SECTION_ASM_OP_ELF "\t.section\t.fini"
109 #define FINI_SECTION_ASM_OP_COFF "\t.section\t.dtor, \"x\""
110 #define FINI_SECTION_ASM_OP \
111 ((TARGET_ELF) ? FINI_SECTION_ASM_OP_ELF : FINI_SECTION_ASM_OP_COFF)
113 #undef BSS_SECTION_ASM_OP
114 #define BSS_SECTION_ASM_OP "\t.data"
116 #undef TEXT_SECTION_ASM_OP
117 #define TEXT_SECTION_ASM_OP "\t.text"
119 #undef DATA_SECTION_ASM_OP
120 #define DATA_SECTION_ASM_OP "\t.data"
122 #undef TYPE_OPERAND_FMT
123 #define TYPE_OPERAND_FMT "@%s"
125 #undef APPLY_RESULT_SIZE
126 #define APPLY_RESULT_SIZE \
127 (TARGET_ELF) ? size : 116
129 #ifndef ASM_DECLARE_RESULT
130 #define ASM_DECLARE_RESULT(FILE, RESULT)
133 #define SCO_DEFAULT_ASM_COFF(FILE,NAME) \
135 ASM_OUTPUT_LABEL (FILE, NAME); \
138 #undef ASM_DECLARE_FUNCTION_NAME
139 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
142 ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function"); \
143 ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
144 ASM_OUTPUT_LABEL (FILE, NAME); \
146 SCO_DEFAULT_ASM_COFF(FILE, NAME); \
149 #undef ASM_DECLARE_FUNCTION_SIZE
150 #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
152 if (TARGET_ELF && !flag_inhibit_size_directive) \
153 ASM_OUTPUT_MEASURED_SIZE (FILE, FNAME); \
156 #undef ASM_DECLARE_OBJECT_NAME
157 #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
160 HOST_WIDE_INT size; \
162 ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \
164 size_directive_output = 0; \
165 if (!flag_inhibit_size_directive \
166 && (DECL) && DECL_SIZE (DECL)) \
168 size_directive_output = 1; \
169 size = int_size_in_bytes (TREE_TYPE (DECL)); \
170 ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, size); \
173 ASM_OUTPUT_LABEL (FILE, NAME); \
175 SCO_DEFAULT_ASM_COFF(FILE, NAME); \
178 #undef ASM_FILE_START_1
179 #define ASM_FILE_START_1(FILE)
181 #undef ASM_FILE_START
182 #define ASM_FILE_START(FILE) \
184 output_file_directive((FILE),main_input_filename); \
185 fprintf ((FILE), "\t.version\t\"01.01\"\n"); \
188 #undef ASM_FINISH_DECLARE_OBJECT
189 #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
192 const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
193 HOST_WIDE_INT size; \
194 if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \
195 && ! AT_END && TOP_LEVEL \
196 && DECL_INITIAL (DECL) == error_mark_node \
197 && !size_directive_output) \
199 size_directive_output = 1; \
200 size = int_size_in_bytes (TREE_TYPE (DECL)); \
201 ASM_OUTPUT_SIZE_DIRECTIVE (FILE, name, size); \
206 #undef ASM_GENERATE_INTERNAL_LABEL
207 #define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) \
210 sprintf (LABEL, "*.%s%ld", (PREFIX), (long)(NUM)); \
212 sprintf (LABEL, ".%s%ld", (PREFIX), (long)(NUM)); \
215 #undef ASM_OUTPUT_ALIGNED_COMMON
216 #define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
218 fprintf ((FILE), "%s", COMMON_ASM_OP); \
219 assemble_name ((FILE), (NAME)); \
221 fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
223 fprintf ((FILE), ",%u\n", (SIZE)); \
226 #undef ASM_OUTPUT_ALIGNED_LOCAL
227 #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
230 fprintf ((FILE), "%s", LOCAL_ASM_OP); \
231 assemble_name ((FILE), (NAME)); \
232 fprintf ((FILE), "\n"); \
233 ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \
235 int align = exact_log2 (ALIGN); \
236 if (align > 2) align = 2; \
237 if (TARGET_SVR3_SHLIB) \
241 ASM_OUTPUT_ALIGN ((FILE), align == -1 ? 2 : align); \
242 fprintf ((FILE), "%s\t", "\t.lcomm"); \
243 assemble_name ((FILE), (NAME)); \
244 fprintf ((FILE), ",%u\n", (SIZE)); \
248 /* A C statement (sans semicolon) to output to the stdio stream
249 FILE the assembler definition of uninitialized global DECL named
250 NAME whose size is SIZE bytes and alignment is ALIGN bytes.
251 Try to use asm_output_aligned_bss to implement this macro. */
253 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
254 asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
258 "\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
259 \0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
260 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\\0\0\0\
261 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\
262 \1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
263 \1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
264 \1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
265 \1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1"
268 #define STRING_LIMIT ((unsigned) 256)
270 #undef ASM_OUTPUT_LIMITED_STRING
271 #define ASM_OUTPUT_LIMITED_STRING(FILE, STR) \
274 register const unsigned char *_limited_str = \
275 (const unsigned char *) (STR); \
276 register unsigned ch; \
277 fprintf ((FILE), "%s\"", STRING_ASM_OP); \
278 for (; (ch = *_limited_str); _limited_str++) \
280 register int escape; \
281 switch (escape = ESCAPES[ch]) \
287 fprintf ((FILE), "\\%03o", ch); \
290 putc ('\\', (FILE)); \
291 putc (escape, (FILE)); \
295 fprintf ((FILE), "\"\n"); \
300 #undef ASM_OUTPUT_ASCII
301 #define ASM_OUTPUT_ASCII(FILE, STR, LENGTH) \
303 register const unsigned char *_ascii_bytes = \
304 (const unsigned char *) (STR); \
305 register const unsigned char *limit = _ascii_bytes + (LENGTH); \
306 register unsigned bytes_in_chunk = 0; \
307 for (; _ascii_bytes < limit; _ascii_bytes++) \
309 register unsigned const char *p; \
310 if (bytes_in_chunk >= 64) \
312 fputc ('\n', (FILE)); \
313 bytes_in_chunk = 0; \
315 for (p = _ascii_bytes; p < limit && *p != '\0'; p++) \
317 if (p < limit && (p - _ascii_bytes) <= (long) STRING_LIMIT) \
319 if (bytes_in_chunk > 0) \
321 fputc ('\n', (FILE)); \
322 bytes_in_chunk = 0; \
324 ASM_OUTPUT_LIMITED_STRING ((FILE), _ascii_bytes); \
329 if (bytes_in_chunk == 0) \
330 fputs ("\t.byte\t", (FILE)); \
332 fputc (',', (FILE)); \
333 fprintf ((FILE), "0x%02x", *_ascii_bytes); \
334 bytes_in_chunk += 5; \
337 if (bytes_in_chunk > 0) \
338 fprintf ((FILE), "\n"); \
341 #undef ASM_OUTPUT_CASE_LABEL
342 #define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,JUMPTABLE) \
345 ASM_OUTPUT_ALIGN ((FILE), 2); \
346 (*targetm.asm_out.internal_label)((FILE),(PREFIX),(NUM)); \
349 #undef ASM_OUTPUT_IDENT
350 #define ASM_OUTPUT_IDENT(FILE, NAME) \
351 fprintf (FILE, "%s\"%s\"\n", IDENT_ASM_OP, NAME);
353 #undef ASM_OUTPUT_EXTERNAL_LIBCALL
354 #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
355 if (TARGET_ELF) (*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0))
357 /* The prefix to add to user-visible assembler symbols. */
359 #undef USER_LABEL_PREFIX
360 #define USER_LABEL_PREFIX ""
363 * We rename 'gcc_except_table' to the shorter name in preparation
364 * for the day when we're ready to do DWARF2 eh unwinding under COFF.
366 /* #define EXCEPTION_SECTION() named_section (NULL, ".gccexc", 1) */
368 /* Switch into a generic section. */
369 #define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section
371 #undef ASM_OUTPUT_SKIP
372 #define ASM_OUTPUT_SKIP(FILE,SIZE) \
375 fprintf (FILE, "%s%u\n", SKIP_ASM_OP, (SIZE)); \
377 fprintf ((FILE), "%s.,.+%u\n", SET_ASM_OP, (SIZE)); \
381 #undef CTOR_LIST_BEGIN
382 #define CTOR_LIST_BEGIN \
384 asm (CTORS_SECTION_ASM_OP); \
386 STATIC func_ptr __CTOR_LIST__[1] = { (func_ptr) (-1) }; \
392 #define CTOR_LIST_END \
395 asm (CTORS_SECTION_ASM_OP); \
396 STATIC func_ptr __CTOR_LIST__[1] = { (func_ptr) (0) }; \
402 #undef DBX_BLOCKS_FUNCTION_RELATIVE
403 #define DBX_BLOCKS_FUNCTION_RELATIVE 1
405 #undef DBX_FUNCTION_FIRST
406 #define DBX_FUNCTION_FIRST 1
408 #undef DBX_REGISTER_NUMBER
409 #define DBX_REGISTER_NUMBER(n) \
410 ((TARGET_ELF) ? svr4_dbx_register_map[n] : dbx_register_map[n])
412 #define DWARF2_DEBUGGING_INFO 1
413 #define DWARF_DEBUGGING_INFO 1
414 #define SDB_DEBUGGING_INFO 1
415 #define DBX_DEBUGGING_INFO 1
417 #undef PREFERRED_DEBUGGING_TYPE
418 #define PREFERRED_DEBUGGING_TYPE \
419 ((TARGET_ELF) ? DWARF2_DEBUG: SDB_DEBUG)
421 #undef EXTRA_SECTIONS
422 #define EXTRA_SECTIONS in_init, in_fini
424 #undef EXTRA_SECTION_FUNCTIONS
425 #define EXTRA_SECTION_FUNCTIONS \
426 INIT_SECTION_FUNCTION \
427 FINI_SECTION_FUNCTION
429 #undef FINI_SECTION_FUNCTION
430 #define FINI_SECTION_FUNCTION \
434 if ((!TARGET_ELF) && in_section != in_fini) \
436 fprintf (asm_out_file, "%s\n", FINI_SECTION_ASM_OP); \
437 in_section = in_fini; \
441 #undef INIT_SECTION_FUNCTION
442 #define INIT_SECTION_FUNCTION \
446 if ((!TARGET_ELF) && in_section != in_init) \
448 fprintf (asm_out_file, "%s\n", INIT_SECTION_ASM_OP); \
449 in_section = in_init; \
453 #undef SUBTARGET_FRAME_POINTER_REQUIRED
454 #define SUBTARGET_FRAME_POINTER_REQUIRED \
455 ((TARGET_ELF) ? 0 : \
456 (current_function_calls_setjmp || current_function_calls_longjmp))
458 #undef LOCAL_LABEL_PREFIX
459 #define LOCAL_LABEL_PREFIX \
460 ((TARGET_ELF) ? "" : ".")
462 #undef MD_EXEC_PREFIX
463 #undef MD_STARTFILE_PREFIX
464 #define MD_EXEC_PREFIX "/usr/ccs/bin/"
465 #define MD_STARTFILE_PREFIX "/usr/ccs/lib/"
467 #undef NON_SAVING_SETJMP
468 #define NON_SAVING_SETJMP \
469 ((TARGET_ELF) ? 0 : \
470 (current_function_calls_setjmp && current_function_calls_longjmp))
472 #undef NO_IMPLICIT_EXTERN_C
473 #define NO_IMPLICIT_EXTERN_C 1
475 /* JKJ FIXME - examine the ramifications of RETURN_IN_MEMORY and
478 #undef RETURN_POPS_ARGS
479 #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \
481 (ix86_return_pops_args (FUNDECL, FUNTYPE, SIZE)) : \
482 (((FUNDECL) && (TREE_CODE (FUNDECL) == IDENTIFIER_NODE)) ? 0 \
484 && (TYPE_ARG_TYPES (FUNTYPE) == 0 \
485 || (TREE_VALUE (tree_last (TYPE_ARG_TYPES (FUNTYPE))) \
486 == void_type_node))) ? (SIZE) \
489 /* ??? Ignore coff. */
490 #undef TARGET_ASM_SELECT_SECTION
491 #define TARGET_ASM_SELECT_SECTION default_elf_select_section
493 #undef SWITCH_TAKES_ARG
494 #define SWITCH_TAKES_ARG(CHAR) \
495 (DEFAULT_SWITCH_TAKES_ARG(CHAR) \
501 #undef WORD_SWITCH_TAKES_ARG
502 #define WORD_SWITCH_TAKES_ARG(STR) \
503 (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \
504 && strcmp (STR, "Tdata") && strcmp (STR, "Ttext") \
505 && strcmp (STR, "Tbss"))
507 #undef TARGET_SUBTARGET_DEFAULT
508 #define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS)
510 #define HANDLE_SYSV_PRAGMA 1
512 /* Though OpenServer supports .weak in COFF, we don't use it.
513 * G++ will frequently emit a symol as .weak and then (in the same .s
514 * file) declare it global. The COFF assembler finds this unamusing.
516 #define SUPPORTS_WEAK (TARGET_ELF)
517 #define ASM_WEAKEN_LABEL(FILE,NAME) \
518 do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
519 fputc ('\n', FILE); } while (0)
522 * Define sizes and types
527 #undef WCHAR_TYPE_SIZE
528 #undef LONG_DOUBLE_TYPE_SIZE
529 #define LONG_DOUBLE_TYPE_SIZE 96
530 #define SIZE_TYPE "unsigned int"
531 #define PTRDIFF_TYPE "int"
532 #define WCHAR_TYPE "long int"
533 #define WCHAR_TYPE_SIZE BITS_PER_WORD
536 * New for multilib support. Set the default switches for multilib,
539 #define MULTILIB_DEFAULTS { "melf" }
542 /* Please note that these specs may look messy but they are required in
543 order to emulate the SCO Development system as closely as possible.
544 With SCO Open Server 5.0, you now get the linker and assembler free,
545 so that is what these specs are targeted for. These utilities are
546 very argument sensitive: a space in the wrong place breaks everything.
547 So RMS, please forgive this mess. It works.
549 Parameters which can be passed to gcc, and their SCO equivalents:
550 GCC Parameter SCO Equivalent
554 -Xpg4plus -a xpg4plus
557 As with SCO, the default is XPG4 plus mode. SCO also allows you to
558 specify a C dialect with -Xt, -Xa, -Xc, -Xk and -Xm. These are passed
559 on to the assembler and linker in the same way that the SCO compiler
562 SCO also allows you to compile, link and generate either ELF or COFF
563 binaries. With gcc, unlike the SCO compiler, the default is ELF.
564 Specify -mcoff to gcc to produce COFF binaries. -fpic will get the
565 assembler and linker to produce PIC code.
568 /* Set up assembler flags for PIC and ELF compilations */
572 /* Leave ASM_SPEC undefined so we pick up the master copy from gcc.c
573 * Undef MD_EXEC_PREFIX because we don't know where GAS is, but it's not
574 * likely in /usr/ccs/bin/
576 #undef MD_EXEC_PREFIX
580 "-b %{!mcoff:elf}%{mcoff:coff \
581 %{static:%e-static not valid with -mcoff} \
582 %{shared:%e-shared not valid with -mcoff} \
583 %{symbolic:%e-symbolic not valid with -mcoff}} \
584 %{Ym,*} %{Yd,*} %{Wa,*:%*} \
585 %{!mcoff:-E%{Xa:a}%{!Xa:%{Xc:c}%{!Xc:%{Xk:k}%{!Xk:%{Xt:t}%{!Xt:a}}}},%{ansi:ansi}%{!ansi:%{posix:posix}%{!posix:%{Xpg4:xpg4}%{!Xpg4:%{Xpg4plus:XPG4PLUS}%{!Xpg4plus:%{Xods30:ods30}%{!Xods30:XPG4PLUS}}}}},ELF %{Qn:} %{!Qy:-Qn}}"
588 /* Use crt1.o as a startup file and crtn.o as a closing file. */
590 #undef STARTFILE_SPEC
591 #define STARTFILE_SPEC \
592 "%{shared: %{!mcoff: crti.o%s}} \
595 %{pg:gcrt.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}}}} \
596 %{ansi:values-Xc.o%s} \
598 %{Xa:values-Xa.o%s} \
599 %{!Xa:%{Xc:values-Xc.o%s} \
600 %{!Xc:%{Xk:values-Xk.o%s} \
601 %{!Xk:%{Xt:values-Xt.o%s} \
602 %{!Xt:values-Xa.o%s}}}}} \
603 %{mcoff:crtbeginS.o%s} %{!mcoff:crtbegin.o%s}"
606 #define ENDFILE_SPEC \
607 "%{!mcoff:crtend.o%s} \
608 %{mcoff:crtendS.o%s} \
609 %{pg:gcrtn.o%s}%{!pg:crtn.o%s}"
611 #define TARGET_OS_CPP_BUILTINS() \
614 builtin_define ("__unix"); \
615 builtin_define ("_SCO_DS"); \
616 builtin_define ("_M_I386"); \
617 builtin_define ("_M_XENIX"); \
618 builtin_define ("_M_UNIX"); \
619 builtin_assert ("system=svr3"); \
621 cpp_define (pfile, "_STRICT_ANSI"); \
624 builtin_define ("__PIC__"); \
625 builtin_define ("__pic__"); \
632 %{fpic:%{mcoff:%e-fpic is not valid with -mcoff}} \
633 %{fPIC:%{mcoff:%e-fPIC is not valid with -mcoff}} \
634 %{!Xods30:-D_STRICT_NAMES} \
635 %{!ansi:%{!posix:%{!Xods30:-D_SCO_XPG_VERS=4}}} \
636 %{ansi:-isystem include/ansi%s -isystem /usr/include/ansi} \
638 %{posix:-isystem include/posix%s -isystem /usr/include/posix \
639 -D_POSIX_C_SOURCE=2 -D_POSIX_SOURCE=1} \
640 %{!posix:%{Xpg4:-isystem include/xpg4%s -isystem /usr/include/xpg4 \
642 %{!Xpg4:-D_M_I86 -D_M_I86SM -D_M_INTERNAT -D_M_SDATA -D_M_STEXT \
643 -D_M_BITFIELDS -D_M_SYS5 -D_M_SYSV -D_M_SYSIII \
644 -D_M_WORDSWAP -Dunix -DM_I386 -DM_UNIX -DM_XENIX \
645 %{Xods30:-isystem include/ods_30_compat%s \
646 -isystem /usr/include/ods_30_compat \
647 -D_SCO_ODS_30 -DM_I86 -DM_I86SM -DM_SDATA -DM_STEXT \
648 -DM_BITFIELDS -DM_SYS5 -DM_SYSV -DM_INTERNAT -DM_SYSIII \
650 %{scointl:-DM_INTERNAT -D_M_INTERNAT} \
651 %{!mcoff:-D_SCO_ELF} \
652 %{mcoff:-D_M_COFF -D_SCO_COFF} \
653 %{Xa:-D_SCO_C_DIALECT=1} \
654 %{!Xa:%{Xc:-D_SCO_C_DIALECT=3} \
655 %{!Xc:%{Xk:-D_SCO_C_DIALECT=4} \
656 %{!Xk:%{Xt:-D_SCO_C_DIALECT=2} \
657 %{!Xt:-D_SCO_C_DIALECT=1}}}}"
661 "-b %{!mcoff:elf}%{mcoff:coff \
662 %{static:%e-static not valid with -mcoff} \
663 %{shared:%e-shared not valid with -mcoff} \
664 %{symbolic:%e-symbolic not valid with -mcoff} \
665 %{fpic:%e-fpic not valid with -mcoff} \
666 %{fPIC:%e-fPIC not valid with -mcoff}} \
667 -R%{Xa:a}%{!Xa:%{Xc:c}%{!Xc:%{Xk:k}%{!Xk:%{Xt:t}%{!Xt:a}}}},%{ansi:ansi}%{!ansi:%{posix:posix}%{!posix:%{Xpg4:xpg4}%{!Xpg4:%{Xpg4plus:XPG4PLUS}%{!Xpg4plus:%{Xods30:ods30}%{!Xods30:XPG4PLUS}}}}},%{mcoff:COFF}%{!mcoff:ELF} \
668 %{Wl,*%*} %{YP,*} %{YL,*} %{YU,*} \
669 %{!YP,*:%{p:-YP,/usr/ccs/libp:/lib/libp:/usr/lib/libp:/usr/ccs/lib:/lib:/usr/lib} \
670 %{!p:-YP,/usr/ccs/lib:/lib:/usr/lib}} \
671 %{h*} %{static:-dn -Bstatic} %{shared:-G -dy %{!z*:-z text}} \
672 %{symbolic:-Bsymbolic -G -dy %{!z*:-z text}} %{z*} %{R*} %{Y*} \
673 %{G:-G} %{!mcoff:%{Qn:} %{!Qy:-Qn}}"
675 /* The SCO COFF linker gets confused on the difference between "-ofoo"
676 and "-o foo". So we just always force a single space. */
678 #define SWITCHES_NEED_SPACES "o"
680 /* Library spec. If we are not building a shared library, provide the
681 standard libraries, as per the SCO compiler. */
685 "%{shared:pic/libgcc.a%s}%{!shared:%{!symbolic:-lcrypt -lgen -lc}}"
688 #define LIBGCC_SPEC \
691 #define MASK_COFF 010000000000 /* Mask for elf generation */
692 #define TARGET_ELF (1) /* (!(target_flags & MASK_COFF)) */
694 #undef SUBTARGET_SWITCHES
695 #define SUBTARGET_SWITCHES \
696 { "elf", -MASK_COFF, N_("Generate ELF output") },
698 #define NO_DOLLAR_IN_LABEL
700 /* Implicit library calls should use memcpy, not bcopy, etc. They are
701 faster on OpenServer libraries. */
703 #define TARGET_MEM_FUNCTIONS
705 /* Biggest alignment supported by the object file format of this
706 machine. Use this macro to limit the alignment which can be
707 specified using the `__attribute__ ((aligned (N)))' construct. If
708 not defined, the default value is `BIGGEST_ALIGNMENT'. */
710 #define MAX_OFILE_ALIGNMENT (32768*8)
712 /* Define the `__builtin_va_list' type for the ABI. On OpenServer, this
714 #undef BUILD_VA_LIST_TYPE
715 #define BUILD_VA_LIST_TYPE(VALIST) \
716 (VALIST) = build_pointer_type (char_type_node)
720 Here comes some major hackery to get the crt stuff to compile properly.
721 Since we can (and do) compile for both COFF and ELF environments, we
722 set things up accordingly, based on the pre-processor defines for ELF
723 and COFF. This is insane, but then I guess having one compiler with a
724 single back-end supporting two vastly different file format types is
725 a little insane too. But it is not impossible and we get a useful
726 compiler at the end of the day. Onward we go ...
729 #if defined(CRT_BEGIN) || defined(CRT_END) || defined(IN_LIBGCC2)
730 # undef OBJECT_FORMAT_ELF
731 # undef INIT_SECTION_ASM_OP
732 # undef FINI_SECTION_ASM_OP
733 # undef CTORS_SECTION_ASM_OP
734 # undef DTORS_SECTION_ASM_OP
735 # undef EH_FRAME_SECTION_NAME
736 # undef CTOR_LIST_BEGIN
737 # undef CTOR_LIST_END
738 # undef DO_GLOBAL_CTORS_BODY
740 # if defined (_SCO_ELF)
741 # define OBJECT_FORMAT_ELF
742 # define INIT_SECTION_ASM_OP INIT_SECTION_ASM_OP_ELF
743 # define FINI_SECTION_ASM_OP FINI_SECTION_ASM_OP_ELF
744 # define DTORS_SECTION_ASM_OP DTORS_SECTION_ASM_OP_ELF
745 # define CTORS_SECTION_ASM_OP CTORS_SECTION_ASM_OP_ELF
746 # define EH_FRAME_SECTION_NAME EH_FRAME_SECTION_NAME_ELF
747 # else /* ! _SCO_ELF */
748 # define INIT_SECTION_ASM_OP INIT_SECTION_ASM_OP_COFF
749 # define FINI_SECTION_ASM_OP FINI_SECTION_ASM_OP_COFF
750 # define DTORS_SECTION_ASM_OP DTORS_SECTION_ASM_OP_COFF
751 # define CTORS_SECTION_ASM_OP CTORS_SECTION_ASM_OP_COFF
752 # define EH_FRAME_SECTION_NAME EH_FRAME_SECTION_NAME_COFF
753 # define CTOR_LIST_BEGIN asm (INIT_SECTION_ASM_OP); asm ("pushl $0")
754 # define CTOR_LIST_END CTOR_LIST_BEGIN
755 # define DO_GLOBAL_CTORS_BODY \
757 func_ptr *p, *beg = alloca(0); \
761 # endif /* ! _SCO_ELF */
762 #endif /* CRT_BEGIN !! CRT_END */
764 /* Handle special EH pointer encodings. Absolute, pc-relative, and
765 indirect are handled automatically. */
766 #define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(FILE, ENCODING, SIZE, ADDR, DONE) \
768 if ((SIZE) == 4 && ((ENCODING) & 0x70) == DW_EH_PE_datarel) \
770 fputs (ASM_LONG, FILE); \
771 assemble_name (FILE, XSTR (ADDR, 0)); \
772 fputs (((ENCODING) & DW_EH_PE_indirect ? "@GOT" : "@GOTOFF"), FILE); \
777 /* Used by crtstuff.c to initialize the base of data-relative relocations.
778 These are GOT relative on x86, so return the pic register. */
780 #define CRT_GET_RFIB_DATA(BASE) \
782 register void *ebx_ __asm__("ebx"); \
786 #define CRT_GET_RFIB_DATA(BASE) \
787 __asm__ ("call\t.LPR%=\n" \
790 /* Due to a GAS bug, this cannot use EAX. That encodes \
791 smaller than the traditional EBX, which results in the \
792 offset being off by one. */ \
793 "addl\t$_GLOBAL_OFFSET_TABLE_+[.-.LPR%=],%0" \
797 /* Select a format to encode pointers in exception handling data. CODE
798 is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
799 true if the symbol may be affected by dynamic relocations. */
800 #undef ASM_PREFERRED_EH_DATA_FORMAT
801 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
802 (flag_pic ? (GLOBAL ? DW_EH_PE_indirect : 0) | DW_EH_PE_datarel \