]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/lynx.h
1 /* Target independent definitions for LynxOS.
2 Copyright (C) 1993 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 #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
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
79 #define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \
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) \
85 { static int sym_lineno = 1; \
86 fprintf (file, ".stabn 68,0,%d,.LM%d-%s\n.LM%d:\n", \
88 XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0), \
92 /* Handle #pragma pack and sometimes #pragma weak. */
94 #define HANDLE_SYSV_PRAGMA
96 /* Some additional command-line options. */
98 #define TARGET_THREADS (target_flags & MASK_THREADS)
99 #define MASK_THREADS 0x40000000
101 #define TARGET_POSIX (target_flags & MASK_POSIX)
102 #define MASK_POSIX 0x20000000
104 #define TARGET_SYSTEM_V (target_flags & MASK_SYSTEM_V)
105 #define MASK_SYSTEM_V 0x10000000
107 #undef SUBTARGET_SWITCHES
108 #define SUBTARGET_SWITCHES \
109 {"threads", MASK_THREADS}, \
110 {"posix", MASK_POSIX}, \
111 {"system-v", MASK_SYSTEM_V},
113 #undef SUBTARGET_OVERRIDE_OPTIONS
114 #define SUBTARGET_OVERRIDE_OPTIONS \
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"); }
120 /* Define this so that C++ destructors will use atexit, since LynxOS
121 calls exit after main returns. */
125 /* Since init.o et al put all sorts of stuff into the init section,
126 we can't use the standard init section support in crtbegin.o. */
128 #undef INIT_SECTION_ASM_OP
130 #undef EXTRA_SECTIONS
131 #define EXTRA_SECTIONS in_const, in_bss, in_ctors, in_dtors, in_fini,
133 #undef EXTRA_SECTION_FUNCTIONS
134 #define EXTRA_SECTION_FUNCTIONS \
135 CONST_SECTION_FUNCTION \
136 BSS_SECTION_FUNCTION \
137 CTORS_SECTION_FUNCTION \
138 DTORS_SECTION_FUNCTION \
139 FINI_SECTION_FUNCTION
141 #undef CTORS_SECTION_ASM_OP
142 #define CTORS_SECTION_ASM_OP ".section\t.ctors"
143 #undef DTORS_SECTION_ASM_OP
144 #define DTORS_SECTION_ASM_OP ".section\t.dtors"
146 #define INT_ASM_OP ".long"
148 /* A C statement (sans semicolon) to output an element in the table of
149 global constructors. */
150 #undef ASM_OUTPUT_CONSTRUCTOR
151 #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
154 fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
155 assemble_name (FILE, NAME); \
156 fprintf (FILE, "\n"); \
159 /* A C statement (sans semicolon) to output an element in the table of
160 global destructors. */
161 #undef ASM_OUTPUT_DESTRUCTOR
162 #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
165 fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
166 assemble_name (FILE, NAME); \
167 fprintf (FILE, "\n"); \
170 #undef DO_GLOBAL_CTORS_BODY
171 #undef DO_GLOBAL_DTORS_BODY