1 /* Target independent definitions for LynxOS.
2 Copyright (C) 1993, 1994 Free Software Foundation, Inc.
4 This file is part of GNU CC.
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING. If not, write to
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
20 /* LynxOS is a multi-platform Unix, similar to SVR3, but not identical.
21 We can get quite a bit from generic svr3, but have to do some overrides. */
25 /* Define various macros, depending on the combination of flags. */
28 #define CPP_SPEC "%{mthreads:-D_MULTITHREADED} \
29 %{mposix:-D_POSIX_SOURCE} \
30 %{msystem-v:-I/usr/include_v}"
32 /* No asm spec needed, since using GNU assembler always. */
34 /* No linker spec needed, since using GNU linker always. */
37 #define LIB_SPEC "%{mthreads:-L/lib/thread/} \
39 %{!msystem-v:%{mposix:-lc_p} -lc}"
41 /* Set the appropriate names for the Lynx startfiles. */
44 #define STARTFILE_SPEC "%{p:pinit1.o%s}%{!p:%{msystem-v:vinit1.o%s}%{!msystem-v:init1.o%s}}"
47 #define ENDFILE_SPEC "%{p:_etext.o%s}%{!p:initn.o%s}"
49 /* Override the svr3 versions. */
52 #define WCHAR_TYPE "int"
55 #define PTRDIFF_TYPE "long int"
57 /* We want to output DBX (stabs) debugging information normally. */
59 #define DBX_DEBUGGING_INFO
60 #undef PREFERRED_DEBUGGING_TYPE
61 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
63 /* It is convenient to be able to generate standard coff debugging
64 if requested via -gcoff. */
66 #define SDB_DEBUGGING_INFO
68 /* Be function-relative for block and source line stab directives. */
70 #define DBX_BLOCKS_FUNCTION_RELATIVE 1
72 /* but, to make this work, functions must appear prior to line info */
74 #define DBX_FUNCTION_FIRST
76 /* Generate a blank trailing N_SO to mark the end of the .o file, since
77 we can't depend upon the linker to mark .o file boundaries with
80 #define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \
82 "\t.text\n\t.stabs \"\",%d,0,0,Letext\nLetext:\n", N_SO)
84 #undef ASM_OUTPUT_SOURCE_LINE
85 #define ASM_OUTPUT_SOURCE_LINE(file, line) \
86 { static int sym_lineno = 1; \
87 fprintf (file, ".stabn 68,0,%d,.LM%d-", \
89 assemble_name (file, \
90 XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \
91 fprintf (file, "\n.LM%d:\n", sym_lineno); \
94 /* Handle #pragma pack and sometimes #pragma weak. */
96 #define HANDLE_SYSV_PRAGMA
98 /* Some additional command-line options. */
100 #define TARGET_THREADS (target_flags & MASK_THREADS)
101 #define MASK_THREADS 0x40000000
103 #define TARGET_POSIX (target_flags & MASK_POSIX)
104 #define MASK_POSIX 0x20000000
106 #define TARGET_SYSTEM_V (target_flags & MASK_SYSTEM_V)
107 #define MASK_SYSTEM_V 0x10000000
109 #undef SUBTARGET_SWITCHES
110 #define SUBTARGET_SWITCHES \
111 {"threads", MASK_THREADS}, \
112 {"posix", MASK_POSIX}, \
113 {"system-v", MASK_SYSTEM_V},
115 #undef SUBTARGET_OVERRIDE_OPTIONS
116 #define SUBTARGET_OVERRIDE_OPTIONS \
117 { if (TARGET_SYSTEM_V && profile_flag) \
118 warning ("-msystem-v and -p are incompatible"); \
119 if (TARGET_SYSTEM_V && TARGET_THREADS) \
120 warning ("-msystem-v and -mthreads are incompatible"); }
122 /* Define this so that C++ destructors will use atexit, since LynxOS
123 calls exit after main returns. */
127 /* Since init.o et al put all sorts of stuff into the init section,
128 we can't use the standard init section support in crtbegin.o. */
130 #undef INIT_SECTION_ASM_OP
132 #undef EXTRA_SECTIONS
133 #define EXTRA_SECTIONS in_const, in_bss, in_ctors, in_dtors, in_fini,
135 #undef EXTRA_SECTION_FUNCTIONS
136 #define EXTRA_SECTION_FUNCTIONS \
137 CONST_SECTION_FUNCTION \
138 BSS_SECTION_FUNCTION \
139 CTORS_SECTION_FUNCTION \
140 DTORS_SECTION_FUNCTION \
141 FINI_SECTION_FUNCTION
143 #undef CTORS_SECTION_ASM_OP
144 #define CTORS_SECTION_ASM_OP ".section\t.ctors"
145 #undef DTORS_SECTION_ASM_OP
146 #define DTORS_SECTION_ASM_OP ".section\t.dtors"
148 #define INT_ASM_OP ".long"
150 /* A C statement (sans semicolon) to output an element in the table of
151 global constructors. */
152 #undef ASM_OUTPUT_CONSTRUCTOR
153 #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
156 fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
157 assemble_name (FILE, NAME); \
158 fprintf (FILE, "\n"); \
161 /* A C statement (sans semicolon) to output an element in the table of
162 global destructors. */
163 #undef ASM_OUTPUT_DESTRUCTOR
164 #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
167 fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
168 assemble_name (FILE, NAME); \
169 fprintf (FILE, "\n"); \
172 #undef DO_GLOBAL_CTORS_BODY
173 #undef DO_GLOBAL_DTORS_BODY