linux.h revision 60967
1/* Definitions for Linux-based GNU systems with ELF format
2   Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
3   Contributed by Eric Youngdale.
4   Modified for stabs-in-ELF by H.J. Lu (hjl@lucon.org).
5
6This file is part of GNU CC.
7
8GNU CC is free software; you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
10the Free Software Foundation; either version 2, or (at your option)
11any later version.
12
13GNU CC is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License
19along with GNU CC; see the file COPYING.  If not, write to
20the Free Software Foundation, 59 Temple Place - Suite 330,
21Boston, MA 02111-1307, USA.  */
22
23/* Don't assume anything about the header files. */
24#define NO_IMPLICIT_EXTERN_C
25
26#undef HAVE_ATEXIT
27#define HAVE_ATEXIT
28
29/* GNU/Linux uses ctype from glibc.a. I am not sure how complete it is.
30   For now, we play safe. It may change later. */
31
32#if 0
33#undef MULTIBYTE_CHARS
34#define MULTIBYTE_CHARS 1
35#endif
36
37#undef ASM_APP_ON
38#define ASM_APP_ON "#APP\n"
39
40#undef ASM_APP_OFF
41#define ASM_APP_OFF "#NO_APP\n"
42
43#define SET_ASM_OP	".set"
44
45/* Use stabs instead of DWARF debug format.  */
46#undef PREFERRED_DEBUGGING_TYPE
47#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
48#include "svr4.h"
49
50#undef MD_EXEC_PREFIX
51#undef MD_STARTFILE_PREFIX
52
53/* Output at beginning of assembler file.  */
54/* The .file command should always begin the output.  */
55#undef ASM_FILE_START
56#define ASM_FILE_START(FILE)						\
57  do {									\
58	output_file_directive (FILE, main_input_filename);		\
59	fprintf (FILE, "\t.version\t\"01.01\"\n");			\
60  } while (0)
61
62/* Provide a STARTFILE_SPEC appropriate for GNU/Linux.  Here we add
63   the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
64   provides part of the support for getting C++ file-scope static
65   object constructed before entering `main'. */
66
67#undef	STARTFILE_SPEC
68#define STARTFILE_SPEC \
69  "%{!shared: \
70     %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
71		       %{!p:%{profile:gcrt1.o%s} \
72			 %{!profile:crt1.o%s}}}} \
73   crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
74
75/* Provide a ENDFILE_SPEC appropriate for GNU/Linux.  Here we tack on
76   the GNU/Linux magical crtend.o file (see crtstuff.c) which
77   provides part of the support for getting C++ file-scope static
78   object constructed before entering `main', followed by a normal
79   GNU/Linux "finalizer" file, `crtn.o'.  */
80
81#undef	ENDFILE_SPEC
82#define ENDFILE_SPEC \
83  "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
84
85/* This is for -profile to use -lc_p instead of -lc. */
86#ifndef CC1_SPEC
87#define CC1_SPEC "%{profile:-p}"
88#endif
89
90#ifndef USE_GNULIBC_1
91#undef DEFAULT_VTABLE_THUNKS
92#define DEFAULT_VTABLE_THUNKS 2
93#endif
94
95#undef	LIB_SPEC
96/* We no longer link with libc_p.a or libg.a by default. If you
97   want to profile or debug the GNU/Linux C library, please add
98   -profile or -ggdb to LDFLAGS at the link time, respectively. */
99#if 1
100#ifdef USE_GNULIBC_1
101#define LIB_SPEC \
102  "%{!shared: %{p:-lgmon} %{pg:-lgmon} %{profile:-lgmon -lc_p} \
103     %{!profile:%{!ggdb:-lc} %{ggdb:-lg}}}"
104#else
105#define LIB_SPEC \
106  "%{shared: -lc} \
107   %{!shared: %{mieee-fp:-lieee} %{pthread:-lpthread} \
108	%{profile:-lc_p} %{!profile: -lc}}"
109#endif
110#else
111#define LIB_SPEC \
112  "%{!shared: \
113     %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
114       %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
115#endif
116