2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / config / lynx.h
bloba2366d106da3df539ac8b1634748d79798e2c75e
1 /* Target independent definitions for LynxOS using gas and gnu ld.
2 Copyright (C) 1993, 1994, 1995, 1996, 1999, 2000, 2002, 2003
3 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 2, 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 COPYING. If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
22 /* LynxOS is a multi-platform Unix, similar to SVR3, but not identical. */
24 /* Define various macros, depending on the combination of flags. */
26 #undef CPP_SPEC
27 #define CPP_SPEC "%{mthreads:-D_MULTITHREADED} \
28 %{mposix:-D_POSIX_SOURCE} \
29 %{msystem-v:-I/usr/include_v}"
31 /* No asm spec needed, since using GNU assembler always. */
33 /* No linker spec needed, since using GNU linker always. */
35 #undef LIB_SPEC
36 #define LIB_SPEC "%{mthreads:-L/lib/thread/} \
37 %{msystem-v:-lc_v} \
38 %{!msystem-v:%{mposix:-lc_p} -lc -lm}"
40 /* Set the appropriate names for the Lynx startfiles. */
42 #undef STARTFILE_SPEC
43 #define STARTFILE_SPEC "%{p:%{mthreads:thread/pinit1.o%s}%{!mthreads:pinit1.o%s}}%{!p:%{msystem-v:vinit1.o%s -e_start}%{!msystem-v:%{mthreads:thread/init1.o%s}%{!mthreads:init1.o%s}}}"
45 #undef ENDFILE_SPEC
46 #define ENDFILE_SPEC "%{p:_etext.o%s}%{!p:initn.o%s}"
48 /* Override the svr3 versions. */
50 #undef WCHAR_TYPE
51 #define WCHAR_TYPE "int"
53 #undef PTRDIFF_TYPE
54 #define PTRDIFF_TYPE "long int"
56 /* We want to output DBX (stabs) debugging information normally. */
58 #define DBX_DEBUGGING_INFO 1
59 #undef PREFERRED_DEBUGGING_TYPE
60 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
62 /* It is convenient to be able to generate standard coff debugging
63 if requested via -gcoff. */
65 #define SDB_DEBUGGING_INFO 1
67 /* Be function-relative for block and source line stab directives. */
69 #define DBX_BLOCKS_FUNCTION_RELATIVE 1
71 /* but, to make this work, functions must appear prior to line info */
73 #define DBX_FUNCTION_FIRST
75 /* Generate a blank trailing N_SO to mark the end of the .o file, since
76 we can't depend upon the linker to mark .o file boundaries with
77 embedded stabs. */
79 #define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \
80 fprintf (FILE, \
81 "\t.text\n\t.stabs \"\",%d,0,0,Letext\nLetext:\n", N_SO)
83 #undef ASM_OUTPUT_SOURCE_LINE
84 #define ASM_OUTPUT_SOURCE_LINE(file, line, counter) \
85 { fprintf (file, ".stabn 68,0,%d,.LM%d-", \
86 line, counter); \
87 assemble_name (file, \
88 XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \
89 fprintf (file, "\n.LM%d:\n", counter); }
91 /* Handle #pragma pack and sometimes #pragma weak. */
93 #define HANDLE_SYSV_PRAGMA 1
95 /* Some additional command-line options. */
97 #define TARGET_THREADS (target_flags & MASK_THREADS)
98 #define MASK_THREADS 0x40000000
100 #define TARGET_POSIX (target_flags & MASK_POSIX)
101 #define MASK_POSIX 0x20000000
103 #define TARGET_SYSTEM_V (target_flags & MASK_SYSTEM_V)
104 #define MASK_SYSTEM_V 0x10000000
106 #undef SUBTARGET_SWITCHES
107 #define SUBTARGET_SWITCHES \
108 {"threads", MASK_THREADS}, \
109 {"posix", MASK_POSIX}, \
110 {"system-v", MASK_SYSTEM_V},
112 #undef SUBTARGET_OVERRIDE_OPTIONS
113 #define SUBTARGET_OVERRIDE_OPTIONS \
114 do { \
115 if (TARGET_SYSTEM_V && profile_flag) \
116 warning ("-msystem-v and -p are incompatible"); \
117 if (TARGET_SYSTEM_V && TARGET_THREADS) \
118 warning ("-msystem-v and -mthreads are incompatible"); \
119 } while (0)
121 /* Since init.o et al put all sorts of stuff into the init section,
122 we can't use the standard init section support in crtbegin.o. */
124 #undef INIT_SECTION_ASM_OP
126 #undef EXTRA_SECTIONS
127 #define EXTRA_SECTIONS in_fini
129 #undef EXTRA_SECTION_FUNCTIONS
130 #define EXTRA_SECTION_FUNCTIONS \
131 FINI_SECTION_FUNCTION
133 #undef CTORS_SECTION_ASM_OP
134 #define CTORS_SECTION_ASM_OP "\t.section\t.ctors"
135 #undef DTORS_SECTION_ASM_OP
136 #define DTORS_SECTION_ASM_OP "\t.section\t.dtors"
138 #undef DO_GLOBAL_CTORS_BODY
139 #undef DO_GLOBAL_DTORS_BODY
141 /* LynxOS doesn't have mcount. */
142 #undef FUNCTION_PROFILER
143 #define FUNCTION_PROFILER(file, profile_label_no)