]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/lynx.h
dbxout.c (dbxout_source_line_counter): New global variable.
[thirdparty/gcc.git] / gcc / config / lynx.h
1 /* Target independent definitions for LynxOS using gas and gnu ld.
2 Copyright (C) 1993, 1994, 1995, 1996, 1999, 2000, 2002
3 Free Software Foundation, Inc.
4
5 This file is part of GCC.
6
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.
11
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.
16
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. */
21
22 /* LynxOS is a multi-platform Unix, similar to SVR3, but not identical.
23 We can get quite a bit from generic svr3, but have to do some overrides. */
24
25 #include "svr3.h"
26
27 /* Define various macros, depending on the combination of flags. */
28
29 #undef CPP_SPEC
30 #define CPP_SPEC "%{mthreads:-D_MULTITHREADED} \
31 %{mposix:-D_POSIX_SOURCE} \
32 %{msystem-v:-I/usr/include_v}"
33
34 /* No asm spec needed, since using GNU assembler always. */
35
36 /* No linker spec needed, since using GNU linker always. */
37
38 #undef LIB_SPEC
39 #define LIB_SPEC "%{mthreads:-L/lib/thread/} \
40 %{msystem-v:-lc_v} \
41 %{!msystem-v:%{mposix:-lc_p} -lc -lm}"
42
43 /* Set the appropriate names for the Lynx startfiles. */
44
45 #undef STARTFILE_SPEC
46 #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}}}"
47
48 #undef ENDFILE_SPEC
49 #define ENDFILE_SPEC "%{p:_etext.o%s}%{!p:initn.o%s}"
50
51 /* Override the svr3 versions. */
52
53 #undef WCHAR_TYPE
54 #define WCHAR_TYPE "int"
55
56 #undef PTRDIFF_TYPE
57 #define PTRDIFF_TYPE "long int"
58
59 /* We want to output DBX (stabs) debugging information normally. */
60
61 #define DBX_DEBUGGING_INFO 1
62 #undef PREFERRED_DEBUGGING_TYPE
63 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
64
65 /* It is convenient to be able to generate standard coff debugging
66 if requested via -gcoff. */
67
68 #define SDB_DEBUGGING_INFO 1
69
70 /* Be function-relative for block and source line stab directives. */
71
72 #define DBX_BLOCKS_FUNCTION_RELATIVE 1
73
74 /* but, to make this work, functions must appear prior to line info */
75
76 #define DBX_FUNCTION_FIRST
77
78 /* Generate a blank trailing N_SO to mark the end of the .o file, since
79 we can't depend upon the linker to mark .o file boundaries with
80 embedded stabs. */
81
82 #define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \
83 fprintf (FILE, \
84 "\t.text\n\t.stabs \"\",%d,0,0,Letext\nLetext:\n", N_SO)
85
86 #undef ASM_OUTPUT_SOURCE_LINE
87 #define ASM_OUTPUT_SOURCE_LINE(file, line, counter) \
88 { fprintf (file, ".stabn 68,0,%d,.LM%d-", \
89 line, counter); \
90 assemble_name (file, \
91 XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \
92 fprintf (file, "\n.LM%d:\n", counter); }
93
94 /* Handle #pragma pack and sometimes #pragma weak. */
95
96 #define HANDLE_SYSV_PRAGMA 1
97
98 /* Some additional command-line options. */
99
100 #define TARGET_THREADS (target_flags & MASK_THREADS)
101 #define MASK_THREADS 0x40000000
102
103 #define TARGET_POSIX (target_flags & MASK_POSIX)
104 #define MASK_POSIX 0x20000000
105
106 #define TARGET_SYSTEM_V (target_flags & MASK_SYSTEM_V)
107 #define MASK_SYSTEM_V 0x10000000
108
109 #undef SUBTARGET_SWITCHES
110 #define SUBTARGET_SWITCHES \
111 {"threads", MASK_THREADS}, \
112 {"posix", MASK_POSIX}, \
113 {"system-v", MASK_SYSTEM_V},
114
115 #undef SUBTARGET_OVERRIDE_OPTIONS
116 #define SUBTARGET_OVERRIDE_OPTIONS \
117 do { \
118 if (TARGET_SYSTEM_V && profile_flag) \
119 warning ("-msystem-v and -p are incompatible"); \
120 if (TARGET_SYSTEM_V && TARGET_THREADS) \
121 warning ("-msystem-v and -mthreads are incompatible"); \
122 } while (0)
123
124 /* Since init.o et al put all sorts of stuff into the init section,
125 we can't use the standard init section support in crtbegin.o. */
126
127 #undef INIT_SECTION_ASM_OP
128
129 #undef EXTRA_SECTIONS
130 #define EXTRA_SECTIONS in_fini
131
132 #undef EXTRA_SECTION_FUNCTIONS
133 #define EXTRA_SECTION_FUNCTIONS \
134 FINI_SECTION_FUNCTION
135
136 #undef CTORS_SECTION_ASM_OP
137 #define CTORS_SECTION_ASM_OP "\t.section\t.ctors"
138 #undef DTORS_SECTION_ASM_OP
139 #define DTORS_SECTION_ASM_OP "\t.section\t.dtors"
140
141 #undef DO_GLOBAL_CTORS_BODY
142 #undef DO_GLOBAL_DTORS_BODY
143
144 /* LynxOS doesn't have mcount. */
145 #undef FUNCTION_PROFILER
146 #define FUNCTION_PROFILER(file, profile_label_no)