]>
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
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 #include "i386/i386.h" /* Base i386 target definitions */
24 #include "i386/att.h" /* Use AT&T i386 assembler syntax */
27 #define TARGET_VERSION fprintf (stderr, " (i386, SCO OpenServer 5 Syntax)");
33 #define ALIGN_ASM_OP "\t.align\t"
35 #undef ASCII_DATA_ASM_OP
36 #define ASCII_DATA_ASM_OP "\t.ascii\t"
39 #define ASM_BYTE_OP "\t.byte\t"
42 #define IDENT_ASM_OP "\t.ident\t"
45 #define COMMON_ASM_OP "\t.comm\t"
48 #define SET_ASM_OP "\t.set\t"
51 #define LOCAL_ASM_OP "\t.local\t"
54 #define INT_ASM_OP "\t.long\t"
57 #define ASM_SHORT "\t.value\t"
60 #define ASM_LONG "\t.long\t"
63 #define TYPE_ASM_OP "\t.type\t"
66 #define SIZE_ASM_OP "\t.size\t"
69 #define STRING_ASM_OP "\t.string\t"
72 #define SKIP_ASM_OP "\t.zero\t"
75 #define GLOBAL_ASM_OP "\t.globl\t"
77 #undef EH_FRAME_SECTION_ASM_OP
78 #define EH_FRAME_SECTION_NAME_COFF ".ehfram"
79 #define EH_FRAME_SECTION_NAME_ELF ".eh_frame"
80 #define EH_FRAME_SECTION_NAME \
81 ((TARGET_ELF) ? EH_FRAME_SECTION_NAME_ELF : EH_FRAME_SECTION_NAME_COFF)
83 /* Avoid problems (long sectino names, forward assembler refs) with DWARF
84 exception unwinding when we're generating COFF */
85 #define DWARF2_UNWIND_INFO \
86 ((TARGET_ELF) ? 1 : 0 )
88 #undef CONST_SECTION_ASM_OP
89 #define CONST_SECTION_ASM_OP_COFF "\t.section\t.rodata, \"x\""
90 #define CONST_SECTION_ASM_OP_ELF "\t.section\t.rodata"
91 #define CONST_SECTION_ASM_OP \
92 ((TARGET_ELF) ? CONST_SECTION_ASM_OP_ELF : CONST_SECTION_ASM_OP_COFF)
94 #undef USE_CONST_SECTION
95 #define USE_CONST_SECTION_ELF 1
96 #define USE_CONST_SECTION_COFF 0
97 #define USE_CONST_SECTION \
98 ((TARGET_ELF) ? USE_CONST_SECTION_ELF : USE_CONST_SECTION_COFF)
100 #undef INIT_SECTION_ASM_OP
101 #define INIT_SECTION_ASM_OP_ELF "\t.section\t.init"
102 /* Rename these for COFF becuase crt1.o will try to run them. */
103 #define INIT_SECTION_ASM_OP_COFF "\t.section\t.ctor ,\"x\""
104 #define INIT_SECTION_ASM_OP \
105 ((TARGET_ELF) ? INIT_SECTION_ASM_OP_ELF : INIT_SECTION_ASM_OP_COFF)
107 #undef CTORS_SECTION_ASM_OP
108 #define CTORS_SECTION_ASM_OP_ELF "\t.section\t.ctors,\"aw\""
109 #define CTORS_SECTION_ASM_OP_COFF INIT_SECTION_ASM_OP_COFF
110 #define CTORS_SECTION_ASM_OP \
111 ((TARGET_ELF) ? CTORS_SECTION_ASM_OP_ELF : CTORS_SECTION_ASM_OP_COFF)
113 #undef DTORS_SECTION_ASM_OP
114 #define DTORS_SECTION_ASM_OP_ELF "\t.section\t.dtors, \"aw\""
115 #define DTORS_SECTION_ASM_OP_COFF FINI_SECTION_ASM_OP_COFF
116 #define DTORS_SECTION_ASM_OP \
117 ((TARGET_ELF) ? DTORS_SECTION_ASM_OP_ELF : DTORS_SECTION_ASM_OP_COFF)
119 #undef FINI_SECTION_ASM_OP
120 #define FINI_SECTION_ASM_OP_ELF "\t.section\t.fini"
121 #define FINI_SECTION_ASM_OP_COFF "\t.section\t.dtor, \"x\""
122 #define FINI_SECTION_ASM_OP \
123 ((TARGET_ELF) ? FINI_SECTION_ASM_OP_ELF : FINI_SECTION_ASM_OP_COFF)
125 #undef BSS_SECTION_ASM_OP
126 #define BSS_SECTION_ASM_OP "\t.data"
128 #undef TEXT_SECTION_ASM_OP
129 #define TEXT_SECTION_ASM_OP "\t.text"
131 #undef DATA_SECTION_ASM_OP
132 #define DATA_SECTION_ASM_OP "\t.data"
134 #undef TYPE_OPERAND_FMT
135 #define TYPE_OPERAND_FMT "@%s"
137 #undef APPLY_RESULT_SIZE
138 #define APPLY_RESULT_SIZE \
139 (TARGET_ELF) ? size : 116
141 #ifndef ASM_DECLARE_RESULT
142 #define ASM_DECLARE_RESULT(FILE, RESULT)
145 #define SCO_DEFAULT_ASM_COFF(FILE,NAME) \
147 ASM_OUTPUT_LABEL (FILE, NAME); \
150 #undef ASM_DECLARE_FUNCTION_NAME
151 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
154 fprintf (FILE, "%s", TYPE_ASM_OP); \
155 assemble_name (FILE, NAME); \
157 fprintf (FILE, TYPE_OPERAND_FMT, "function"); \
159 ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
160 ASM_OUTPUT_LABEL(FILE, NAME); \
162 SCO_DEFAULT_ASM_COFF(FILE, NAME); \
165 #undef ASM_DECLARE_FUNCTION_SIZE
166 #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
168 if (TARGET_ELF) { if (!flag_inhibit_size_directive) \
170 fprintf (FILE, "%s", SIZE_ASM_OP); \
171 assemble_name (FILE, (FNAME)); \
172 fprintf (FILE, ",.-"); \
173 assemble_name (FILE, (FNAME)); \
178 #undef ASM_DECLARE_OBJECT_NAME
179 #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
182 fprintf (FILE, "%s", TYPE_ASM_OP); \
183 assemble_name (FILE, NAME); \
185 fprintf (FILE, TYPE_OPERAND_FMT, "object"); \
187 size_directive_output = 0; \
188 if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
190 size_directive_output = 1; \
191 fprintf (FILE, "%s", SIZE_ASM_OP); \
192 assemble_name (FILE, NAME); \
193 fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
195 ASM_OUTPUT_LABEL(FILE, NAME); \
197 SCO_DEFAULT_ASM_COFF(FILE, NAME); \
200 #undef ASM_FILE_START_1
201 #define ASM_FILE_START_1(FILE)
203 #undef ASM_FILE_START
204 #define ASM_FILE_START(FILE) \
206 output_file_directive((FILE),main_input_filename); \
207 fprintf ((FILE), "\t.version\t\"01.01\"\n"); \
210 #undef ASM_FINISH_DECLARE_OBJECT
211 #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
214 const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
215 if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \
216 && ! AT_END && TOP_LEVEL \
217 && DECL_INITIAL (DECL) == error_mark_node \
218 && !size_directive_output) \
220 size_directive_output = 1; \
221 fprintf (FILE, "%s", SIZE_ASM_OP); \
222 assemble_name (FILE, name); \
223 fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
228 #undef ASM_GENERATE_INTERNAL_LABEL
229 #define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) \
232 sprintf (LABEL, "*.%s%d", (PREFIX), (NUM)); \
234 sprintf (LABEL, ".%s%d", (PREFIX), (NUM)); \
237 #undef ASM_OUTPUT_ADDR_DIFF_ELT
238 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
241 fprintf (FILE, "%s_GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", ASM_LONG, LPREFIX, VALUE); \
243 fprintf (FILE, "%s%s%d-%s%d\n", ASM_LONG, LPREFIX,VALUE,LPREFIX,REL); \
246 #undef ASM_OUTPUT_ALIGNED_COMMON
247 #define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
249 fprintf ((FILE), "%s", COMMON_ASM_OP); \
250 assemble_name ((FILE), (NAME)); \
252 fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
254 fprintf ((FILE), ",%u\n", (SIZE)); \
257 #undef ASM_OUTPUT_ALIGNED_LOCAL
258 #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
261 fprintf ((FILE), "%s", LOCAL_ASM_OP); \
262 assemble_name ((FILE), (NAME)); \
263 fprintf ((FILE), "\n"); \
264 ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \
266 int align = exact_log2 (ALIGN); \
267 if (align > 2) align = 2; \
268 if (TARGET_SVR3_SHLIB) \
272 ASM_OUTPUT_ALIGN ((FILE), align == -1 ? 2 : align); \
273 fprintf ((FILE), "%s\t", "\t.lcomm"); \
274 assemble_name ((FILE), (NAME)); \
275 fprintf ((FILE), ",%u\n", (SIZE)); \
279 /* A C statement (sans semicolon) to output to the stdio stream
280 FILE the assembler definition of uninitialized global DECL named
281 NAME whose size is SIZE bytes and alignment is ALIGN bytes.
282 Try to use asm_output_aligned_bss to implement this macro. */
284 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
285 asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
289 "\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\
290 \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\
291 \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\
292 \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\
293 \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\
294 \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\
295 \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\
296 \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"
299 #define STRING_LIMIT ((unsigned) 256)
301 #undef ASM_OUTPUT_LIMITED_STRING
302 #define ASM_OUTPUT_LIMITED_STRING(FILE, STR) \
305 register const unsigned char *_limited_str = \
306 (const unsigned char *) (STR); \
307 register unsigned ch; \
308 fprintf ((FILE), "%s\"", STRING_ASM_OP); \
309 for (; (ch = *_limited_str); _limited_str++) \
311 register int escape; \
312 switch (escape = ESCAPES[ch]) \
318 fprintf ((FILE), "\\%03o", ch); \
321 putc ('\\', (FILE)); \
322 putc (escape, (FILE)); \
326 fprintf ((FILE), "\"\n"); \
331 #undef ASM_OUTPUT_ASCII
332 #define ASM_OUTPUT_ASCII(FILE, STR, LENGTH) \
334 register const unsigned char *_ascii_bytes = \
335 (const unsigned char *) (STR); \
336 register const unsigned char *limit = _ascii_bytes + (LENGTH); \
337 register unsigned bytes_in_chunk = 0; \
338 for (; _ascii_bytes < limit; _ascii_bytes++) \
340 register unsigned const char *p; \
341 if (bytes_in_chunk >= 64) \
343 fputc ('\n', (FILE)); \
344 bytes_in_chunk = 0; \
346 for (p = _ascii_bytes; p < limit && *p != '\0'; p++) \
348 if (p < limit && (p - _ascii_bytes) <= STRING_LIMIT) \
350 if (bytes_in_chunk > 0) \
352 fputc ('\n', (FILE)); \
353 bytes_in_chunk = 0; \
355 ASM_OUTPUT_LIMITED_STRING ((FILE), _ascii_bytes); \
360 if (bytes_in_chunk == 0) \
361 fprintf ((FILE), "%s", ASM_BYTE_OP); \
363 fputc (',', (FILE)); \
364 fprintf ((FILE), "0x%02x", *_ascii_bytes); \
365 bytes_in_chunk += 5; \
368 if (bytes_in_chunk > 0) \
369 fprintf ((FILE), "\n"); \
372 /* Must use data section for relocatable constants when pic. */
373 #undef SELECT_RTX_SECTION
374 #define SELECT_RTX_SECTION(MODE,RTX,ALIGN) \
377 if (flag_pic && symbolic_operand (RTX, VOIDmode)) \
382 readonly_data_section(); \
385 #undef ASM_OUTPUT_CASE_LABEL
386 #define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,JUMPTABLE) \
389 ASM_OUTPUT_ALIGN ((FILE), 2); \
390 ASM_OUTPUT_INTERNAL_LABEL((FILE),(PREFIX),(NUM)); \
393 #undef TARGET_ASM_CONSTRUCTOR
394 #define TARGET_ASM_CONSTRUCTOR sco_asm_out_constructor
396 #undef ASM_OUTPUT_IDENT
397 #define ASM_OUTPUT_IDENT(FILE, NAME) \
398 fprintf (FILE, "%s\"%s\"\n", IDENT_ASM_OP, NAME);
400 #undef ASM_GLOBALIZE_LABEL
401 #define ASM_GLOBALIZE_LABEL(FILE,NAME) \
402 (fprintf ((FILE), "%s", GLOBAL_ASM_OP), assemble_name (FILE, NAME), fputs ("\n", FILE))
404 #undef ASM_OUTPUT_EXTERNAL_LIBCALL
405 #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
406 if (TARGET_ELF) ASM_GLOBALIZE_LABEL (FILE, XSTR (FUN, 0))
408 #undef ASM_OUTPUT_INTERNAL_LABEL
409 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
410 fprintf (FILE, ".%s%d:\n", PREFIX, NUM)
412 /* The prefix to add to user-visible assembler symbols. */
414 #undef USER_LABEL_PREFIX
415 #define USER_LABEL_PREFIX ""
418 * We rename 'gcc_except_table' to the shorter name in preparation
419 * for the day when we're ready to do DWARF2 eh unwinding under COFF.
421 #define EXCEPTION_SECTION() named_section (NULL, ".gccexc", 1)
423 /* Switch into a generic section. */
424 #undef TARGET_ASM_NAMED_SECTION
425 #define TARGET_ASM_NAMED_SECTION sco_asm_named_section
427 #undef ASM_OUTPUT_SKIP
428 #define ASM_OUTPUT_SKIP(FILE,SIZE) \
431 fprintf (FILE, "%s%u\n", SKIP_ASM_OP, (SIZE)); \
433 fprintf ((FILE), "%s.,.+%u\n", SET_ASM_OP, (SIZE)); \
437 #undef CTOR_LIST_BEGIN
438 #define CTOR_LIST_BEGIN \
440 asm (CTORS_SECTION_ASM_OP); \
442 STATIC func_ptr __CTOR_LIST__[1] = { (func_ptr) (-1) }; \
448 #define CTOR_LIST_END \
451 asm (CTORS_SECTION_ASM_OP); \
452 STATIC func_ptr __CTOR_LIST__[1] = { (func_ptr) (0) }; \
458 #undef DBX_BLOCKS_FUNCTION_RELATIVE
459 #define DBX_BLOCKS_FUNCTION_RELATIVE 1
461 #undef DBX_FUNCTION_FIRST
462 #define DBX_FUNCTION_FIRST 1
464 #undef DBX_REGISTER_NUMBER
465 #define DBX_REGISTER_NUMBER(n) \
466 ((TARGET_ELF) ? svr4_dbx_register_map[n] : dbx_register_map[n])
468 #undef DWARF2_DEBUGGING_INFO
469 #undef DWARF_DEBUGGING_INFO
470 #undef SDB_DEBUGGING_INFO
471 #undef DBX_DEBUGGING_INFO
472 #undef PREFERRED_DEBUGGING_TYPE
474 #define DWARF2_DEBUGGING_INFO 1
475 #define DWARF_DEBUGGING_INFO 1
476 #define SDB_DEBUGGING_INFO 1
477 #define DBX_DEBUGGING_INFO 1
478 #define PREFERRED_DEBUGGING_TYPE \
479 ((TARGET_ELF) ? DWARF2_DEBUG: SDB_DEBUG)
481 #undef EXTRA_SECTIONS
482 #define EXTRA_SECTIONS in_const, in_init, in_fini
484 #undef EXTRA_SECTION_FUNCTIONS
485 #define EXTRA_SECTION_FUNCTIONS \
486 CONST_SECTION_FUNCTION \
487 INIT_SECTION_FUNCTION \
488 FINI_SECTION_FUNCTION
490 #undef CONST_SECTION_FUNCTION
491 #define CONST_SECTION_FUNCTION \
495 if (!USE_CONST_SECTION) \
497 else if (in_section != in_const) \
499 fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
500 in_section = in_const; \
504 #undef FINI_SECTION_FUNCTION
505 #define FINI_SECTION_FUNCTION \
509 if ((!TARGET_ELF) && in_section != in_fini) \
511 fprintf (asm_out_file, "%s\n", FINI_SECTION_ASM_OP); \
512 in_section = in_fini; \
516 #undef INIT_SECTION_FUNCTION
517 #define INIT_SECTION_FUNCTION \
521 if ((!TARGET_ELF) && in_section != in_init) \
523 fprintf (asm_out_file, "%s\n", INIT_SECTION_ASM_OP); \
524 in_section = in_init; \
528 #undef SUBTARGET_FRAME_POINTER_REQUIRED
529 #define SUBTARGET_FRAME_POINTER_REQUIRED \
530 ((TARGET_ELF) ? 0 : \
531 (current_function_calls_setjmp || current_function_calls_longjmp))
533 #undef JUMP_TABLES_IN_TEXT_SECTION
534 #define JUMP_TABLES_IN_TEXT_SECTION (TARGET_ELF && flag_pic)
536 #undef LOCAL_LABEL_PREFIX
537 #define LOCAL_LABEL_PREFIX \
538 ((TARGET_ELF) ? "" : ".")
540 #undef MD_EXEC_PREFIX
541 #undef MD_STARTFILE_PREFIX
542 #define MD_EXEC_PREFIX "/usr/ccs/bin/"
543 #define MD_STARTFILE_PREFIX "/usr/ccs/lib/"
545 #undef NON_SAVING_SETJMP
546 #define NON_SAVING_SETJMP \
547 ((TARGET_ELF) ? 0 : \
548 (current_function_calls_setjmp && current_function_calls_longjmp))
550 #undef NO_IMPLICIT_EXTERN_C
551 #define NO_IMPLICIT_EXTERN_C 1
553 /* JKJ FIXME - examine the ramifications of RETURN_IN_MEMORY and
556 #undef RETURN_POPS_ARGS
557 #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \
559 (ix86_return_pops_args (FUNDECL, FUNTYPE, SIZE)) : \
560 (((FUNDECL) && (TREE_CODE (FUNDECL) == IDENTIFIER_NODE)) ? 0 \
562 && (TYPE_ARG_TYPES (FUNTYPE) == 0 \
563 || (TREE_VALUE (tree_last (TYPE_ARG_TYPES (FUNTYPE))) \
564 == void_type_node))) ? (SIZE) \
567 #undef SELECT_SECTION
568 #define SELECT_SECTION(DECL,RELOC,ALIGN) \
570 if (TARGET_ELF && flag_pic && RELOC) \
572 else if (TREE_CODE (DECL) == STRING_CST) \
574 if (! flag_writable_strings) \
579 else if (TREE_CODE (DECL) == VAR_DECL) \
581 if (! DECL_READONLY_SECTION (DECL, RELOC)) \
590 #undef SWITCH_TAKES_ARG
591 #define SWITCH_TAKES_ARG(CHAR) \
592 (DEFAULT_SWITCH_TAKES_ARG(CHAR) \
598 #undef WORD_SWITCH_TAKES_ARG
599 #define WORD_SWITCH_TAKES_ARG(STR) \
600 (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \
601 && strcmp (STR, "Tdata") && strcmp (STR, "Ttext") \
602 && strcmp (STR, "Tbss"))
604 #undef TARGET_SUBTARGET_DEFAULT
605 #define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS)
607 #undef HANDLE_SYSV_PRAGMA
608 #define HANDLE_SYSV_PRAGMA 1
610 /* Though OpenServer supports .weak in COFF, we don't use it.
611 * G++ will frequently emit a symol as .weak and then (in the same .s
612 * file) declare it global. The COFF assembler finds this unamusing.
614 #define SUPPORTS_WEAK (TARGET_ELF)
615 #define ASM_WEAKEN_LABEL(FILE,NAME) \
616 do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
617 fputc ('\n', FILE); } while (0)
619 #undef SCCS_DIRECTIVE
620 #define SCCS_DIRECTIVE 1
623 * Define sizes and types
628 #undef WCHAR_TYPE_SIZE
629 #undef LONG_DOUBLE_TYPE_SIZE
630 #define LONG_DOUBLE_TYPE_SIZE 96
631 #define SIZE_TYPE "unsigned int"
632 #define PTRDIFF_TYPE "int"
633 #define WCHAR_TYPE "long int"
634 #define WCHAR_TYPE_SIZE BITS_PER_WORD
637 * New for multilib support. Set the default switches for multilib,
640 #define MULTILIB_DEFAULTS { "melf" }
643 /* Please note that these specs may look messy but they are required in
644 order to emulate the SCO Development system as closely as possible.
645 With SCO Open Server 5.0, you now get the linker and assembler free,
646 so that is what these specs are targeted for. These utilities are
647 very argument sensitive: a space in the wrong place breaks everything.
648 So RMS, please forgive this mess. It works.
650 Parameters which can be passed to gcc, and their SCO equivalents:
651 GCC Parameter SCO Equivalent
655 -Xpg4plus -a xpg4plus
658 As with SCO, the default is XPG4 plus mode. SCO also allows you to
659 specify a C dialect with -Xt, -Xa, -Xc, -Xk and -Xm. These are passed
660 on to the assembler and linker in the same way that the SCO compiler
663 SCO also allows you to compile, link and generate either ELF or COFF
664 binaries. With gcc, unlike the SCO compiler, the default is ELF.
665 Specify -mcoff to gcc to produce COFF binaries. -fpic will get the
666 assembler and linker to produce PIC code.
669 /* Set up assembler flags for PIC and ELF compilations */
673 /* Leave ASM_SPEC undefined so we pick up the master copy from gcc.c
674 * Undef MD_EXEC_PREFIX becuase we don't know where GAS is, but it's not
675 * likely in /usr/ccs/bin/
677 #undef MD_EXEC_PREFIX
681 "-b %{!mcoff:elf}%{mcoff:coff \
682 %{static:%e-static not valid with -mcoff} \
683 %{shared:%e-shared not valid with -mcoff} \
684 %{symbolic:%e-symbolic not valid with -mcoff}} \
685 %{Ym,*} %{Yd,*} %{Wa,*:%*} \
686 %{!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}}"
689 /* Use crt1.o as a startup file and crtn.o as a closing file. */
691 #undef STARTFILE_SPEC
692 #define STARTFILE_SPEC \
693 "%{shared: %{!mcoff: crti.o%s}} \
696 %{pg:gcrt.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}}}} \
697 %{ansi:values-Xc.o%s} \
699 %{traditional:values-Xt.o%s} \
701 %{Xa:values-Xa.o%s} \
702 %{!Xa:%{Xc:values-Xc.o%s} \
703 %{!Xc:%{Xk:values-Xk.o%s} \
704 %{!Xk:%{Xt:values-Xt.o%s} \
705 %{!Xt:values-Xa.o%s}}}}}} \
706 %{mcoff:crtbeginS.o%s} %{!mcoff:crtbegin.o%s}"
709 #define ENDFILE_SPEC \
710 "%{!mcoff:crtend.o%s} \
711 %{mcoff:crtendS.o%s} \
712 %{pg:gcrtn.o%s}%{!pg:crtn.o%s}"
714 #undef CPP_PREDEFINES
715 #define CPP_PREDEFINES \
718 /* You are in a maze of GCC specs ... all alike */
721 #define CPP_SPEC "%(cpp_cpu) \
722 %{fpic:%{mcoff:%e-fpic is not valid with -mcoff}} \
723 %{fPIC:%{mcoff:%e-fPIC is not valid with -mcoff}} \
724 -D__i386 -D__unix -D_SCO_DS=1 -D_M_I386 -D_M_XENIX -D_M_UNIX \
725 %{!Xods30:-D_STRICT_NAMES} \
726 %{!ansi:%{!posix:%{!Xods30:-D_SCO_XPG_VERS=4}}} \
727 %{ansi:-isystem include/ansi%s -isystem /usr/include/ansi -D_STRICT_ANSI} \
729 %{posix:-isystem include/posix%s -isystem /usr/include/posix \
730 -D_POSIX_C_SOURCE=2 -D_POSIX_SOURCE=1} \
731 %{!posix:%{Xpg4:-isystem include/xpg4%s -isystem /usr/include/xpg4 \
733 %{!Xpg4:-D_M_I86 -D_M_I86SM -D_M_INTERNAT -D_M_SDATA -D_M_STEXT \
734 -D_M_BITFIELDS -D_M_SYS5 -D_M_SYSV -D_M_SYSIII \
735 -D_M_WORDSWAP -Dunix -DM_I386 -DM_UNIX -DM_XENIX \
736 %{Xods30:-isystem include/ods_30_compat%s \
737 -isystem /usr/include/ods_30_compat \
738 -D_SCO_ODS_30 -DM_I86 -DM_I86SM -DM_SDATA -DM_STEXT \
739 -DM_BITFIELDS -DM_SYS5 -DM_SYSV -DM_INTERNAT -DM_SYSIII \
741 %{scointl:-DM_INTERNAT -D_M_INTERNAT} \
742 %{traditional:-D_KR -D_SVID -D_NO_PROTOTYPE} \
743 %{!mcoff:-D_SCO_ELF} \
744 %{mcoff:-D_M_COFF -D_SCO_COFF} \
745 %{!mcoff:%{fpic:-D__PIC__ -D__pic__} \
746 %{fPIC:%{!fpic:-D__PIC__ -D__pic__}}} \
747 %{Xa:-D_SCO_C_DIALECT=1} \
748 %{!Xa:%{Xc:-D_SCO_C_DIALECT=3} \
749 %{!Xc:%{Xk:-D_SCO_C_DIALECT=4} \
750 %{!Xk:%{Xt:-D_SCO_C_DIALECT=2} \
751 %{!Xt:-D_SCO_C_DIALECT=1}}}} \
752 %{traditional:-traditional -D_KR -D_NO_PROTOTYPE}"
756 "-b %{!mcoff:elf}%{mcoff:coff \
757 %{static:%e-static not valid with -mcoff} \
758 %{shared:%e-shared not valid with -mcoff} \
759 %{symbolic:%e-symbolic not valid with -mcoff} \
760 %{fpic:%e-fpic not valid with -mcoff} \
761 %{fPIC:%e-fPIC not valid with -mcoff}} \
762 -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} \
763 %{Wl,*%*} %{YP,*} %{YL,*} %{YU,*} \
764 %{!YP,*:%{p:-YP,/usr/ccs/libp:/lib/libp:/usr/lib/libp:/usr/ccs/lib:/lib:/usr/lib} \
765 %{!p:-YP,/usr/ccs/lib:/lib:/usr/lib}} \
766 %{h*} %{static:-dn -Bstatic} %{shared:-G -dy %{!z*:-z text}} \
767 %{symbolic:-Bsymbolic -G -dy %{!z*:-z text}} %{z*} %{R*} %{Y*} \
768 %{G:-G} %{!mcoff:%{Qn:} %{!Qy:-Qn}}"
770 /* The SCO COFF linker gets confused on the difference between "-ofoo"
771 and "-o foo". So we just always force a single space. */
773 #define SWITCHES_NEED_SPACES "o"
775 /* Library spec. If we are not building a shared library, provide the
776 standard libraries, as per the SCO compiler. */
780 "%{shared:pic/libgcc.a%s}%{!shared:%{!symbolic:-lcrypt -lgen -lc}}"
783 #define LIBGCC_SPEC \
786 #define MASK_COFF 010000000000 /* Mask for elf generation */
787 #define TARGET_COFF (target_flags & MASK_COFF)
788 #define TARGET_ELF (1) /* (!(target_flags & MASK_COFF)) */
790 #undef SUBTARGET_SWITCHES
791 #define SUBTARGET_SWITCHES \
792 { "elf", -MASK_COFF, N_("Generate ELF output") },
794 #define NO_DOLLAR_IN_LABEL
796 /* Implicit library calls should use memcpy, not bcopy, etc. They are
797 faster on OpenServer libraries. */
799 #define TARGET_MEM_FUNCTIONS
801 /* Biggest alignment supported by the object file format of this
802 machine. Use this macro to limit the alignment which can be
803 specified using the `__attribute__ ((aligned (N)))' construct. If
804 not defined, the default value is `BIGGEST_ALIGNMENT'. */
806 #define MAX_OFILE_ALIGNMENT (32768*8)
808 /* Define the `__builtin_va_list' type for the ABI. On OpenServer, this
810 #undef BUILD_VA_LIST_TYPE
811 #define BUILD_VA_LIST_TYPE(VALIST) \
812 (VALIST) = build_pointer_type (char_type_node)
816 Here comes some major hackery to get the crt stuff to compile properly.
817 Since we can (and do) compile for both COFF and ELF environments, we
818 set things up accordingly, based on the pre-processor defines for ELF
819 and COFF. This is insane, but then I guess having one compiler with a
820 single back-end supporting two vastly different file format types is
821 a little insane too. But it is not impossible and we get a useful
822 compiler at the end of the day. Onward we go ...
825 #if defined(CRT_BEGIN) || defined(CRT_END) || defined(IN_LIBGCC2)
826 # undef OBJECT_FORMAT_ELF
827 # undef INIT_SECTION_ASM_OP
828 # undef FINI_SECTION_ASM_OP
829 # undef CTORS_SECTION_ASM_OP
830 # undef DTORS_SECTION_ASM_OP
831 # undef EH_FRAME_SECTION_NAME
832 # undef CTOR_LIST_BEGIN
833 # undef CTOR_LIST_END
834 # undef DO_GLOBAL_CTORS_BODY
836 # if defined (_SCO_ELF)
837 # define OBJECT_FORMAT_ELF
838 # define INIT_SECTION_ASM_OP INIT_SECTION_ASM_OP_ELF
839 # define FINI_SECTION_ASM_OP FINI_SECTION_ASM_OP_ELF
840 # define DTORS_SECTION_ASM_OP DTORS_SECTION_ASM_OP_ELF
841 # define CTORS_SECTION_ASM_OP CTORS_SECTION_ASM_OP_ELF
842 # define EH_FRAME_SECTION_NAME EH_FRAME_SECTION_NAME_ELF
843 # else /* ! _SCO_ELF */
844 # define INIT_SECTION_ASM_OP INIT_SECTION_ASM_OP_COFF
845 # define FINI_SECTION_ASM_OP FINI_SECTION_ASM_OP_COFF
846 # define DTORS_SECTION_ASM_OP DTORS_SECTION_ASM_OP_COFF
847 # define CTORS_SECTION_ASM_OP CTORS_SECTION_ASM_OP_COFF
848 # define EH_FRAME_SECTION_NAME EH_FRAME_SECTION_NAME_COFF
849 # define CTOR_LIST_BEGIN asm (INIT_SECTION_ASM_OP); asm ("pushl $0")
850 # define CTOR_LIST_END CTOR_LIST_BEGIN
851 # define DO_GLOBAL_CTORS_BODY \
853 func_ptr *p, *beg = alloca(0); \
857 # endif /* ! _SCO_ELF */
858 #endif /* CRT_BEGIN !! CRT_END */
860 /* Handle special EH pointer encodings. Absolute, pc-relative, and
861 indirect are handled automatically. */
862 #define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(FILE, ENCODING, SIZE, ADDR, DONE) \
864 if ((SIZE) == 4 && ((ENCODING) & 0x70) == DW_EH_PE_datarel) \
866 fputs (UNALIGNED_INT_ASM_OP, FILE); \
867 assemble_name (FILE, XSTR (ADDR, 0)); \
868 fputs (((ENCODING) & DW_EH_PE_indirect ? "@GOT" : "@GOTOFF"), FILE); \
873 /* Used by crtstuff.c to initialize the base of data-relative relocations.
874 These are GOT relative on x86, so return the pic register. */
876 #define CRT_GET_RFIB_DATA(BASE) \
878 register void *ebx_ __asm__("ebx"); \
882 #define CRT_GET_RFIB_DATA(BASE) \
883 __asm__ ("call\t.LPR%=\n" \
886 /* Due to a GAS bug, this cannot use EAX. That encodes \
887 smaller than the traditional EBX, which results in the \
888 offset being off by one. */ \
889 "addl\t$_GLOBAL_OFFSET_TABLE_+[.-.LPR%=],%0" \
893 /* Select a format to encode pointers in exception handling data. CODE
894 is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
895 true if the symbol may be affected by dynamic relocations. */
896 #undef ASM_PREFERRED_EH_DATA_FORMAT
897 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
898 (flag_pic ? (GLOBAL ? DW_EH_PE_indirect : 0) | DW_EH_PE_datarel \