aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2000-02-01 21:30:52 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2000-02-01 21:30:52 +0000
commit2e39bdbe4b92cea918f54624604e241cd1672a52 (patch)
treebd349f655e668c3f79a4ea423341713cac116e61
parented672cd0e9fe098b273c2dfd2dcac08b59e4a381 (diff)
downloadgcc-2e39bdbe4b92cea918f54624604e241cd1672a52.zip
gcc-2e39bdbe4b92cea918f54624604e241cd1672a52.tar.gz
gcc-2e39bdbe4b92cea918f54624604e241cd1672a52.tar.bz2
tsystem.h: New file.
* tsystem.h: New file. * Makefile.in (libgcc2.a, stmp-multilib, crtbegin.o, crtend.o, s-crtS): Depend on tsystem.h. * crtstuff.c: Include tsystem.h. * frame.c: Likewise. * libgcc2.c: Likewise. From-SVN: r31741
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/Makefile.in11
-rw-r--r--gcc/crtstuff.c18
-rw-r--r--gcc/frame.c23
-rw-r--r--gcc/libgcc2.c28
-rw-r--r--gcc/tsystem.h86
6 files changed, 108 insertions, 69 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0152ec6..2e16915 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,14 @@
+2000-02-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * tsystem.h: New file.
+
+ * Makefile.in (libgcc2.a, stmp-multilib, crtbegin.o, crtend.o,
+ s-crtS): Depend on tsystem.h.
+
+ * crtstuff.c: Include tsystem.h.
+ * frame.c: Likewise.
+ * libgcc2.c: Likewise.
+
Tue Feb 1 19:53:27 CET 2000 Jan Hubicka <jh@suse.cz>
* builtins.c (expand_builtin_memset): Expand for variable sized
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 328611a..2a61aa8 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -1054,7 +1054,8 @@ libgcc2.ready: $(GCC_PASSES) $(LIBGCC2_DEPS) stmp-int-hdrs $(STMP_FIXPROTO)
LIB2ADD = $(srcdir)/frame.c $(LIB2FUNCS_EXTRA) $(LANG_LIB2FUNCS)
libgcc2.a: libgcc2.c libgcc2.ready $(CONFIG_H) $(FPBIT) $(DPBIT) $(LIB2ADD) \
- $(MACHMODE_H) longlong.h frame.h gbl-ctors.h config.status stmp-int-hdrs
+ $(MACHMODE_H) longlong.h frame.h gbl-ctors.h config.status stmp-int-hdrs \
+ tsystem.h
# Actually build it in tmplibgcc2.a, then rename at end,
# so that libgcc2.a itself remains nonexistent if compilation is aborted.
-rm -f tmplibgcc2.a
@@ -1186,7 +1187,7 @@ s-mlib: $(srcdir)/genmultilib Makefile
# Build multiple copies of libgcc.a, one for each target switch.
stmp-multilib: $(LIBGCC1) libgcc2.c libgcc2.ready $(CONFIG_H) \
- frame.h \
+ frame.h tsystem.h \
$(LIB2ADD) $(MACHMODE_H) longlong.h gbl-ctors.h config.status
for i in `$(GCC_FOR_TARGET) --print-multi-lib`; do \
dir=`echo $$i | sed -e 's/;.*$$//'`; \
@@ -1272,14 +1273,14 @@ stmp-multilib-sub:
# linked using GCC on systems using COFF or ELF, for the sake of C++
# constructors.
$(T)crtbegin.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \
- defaults.h frame.h gbl-ctors.h stmp-int-hdrs
+ defaults.h frame.h gbl-ctors.h stmp-int-hdrs tsystem.h
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
-finhibit-size-directive -fno-inline-functions \
-fno-exceptions $(CRTSTUFF_T_CFLAGS) @inhibit_libc@ \
-c $(srcdir)/crtstuff.c -DCRT_BEGIN -o $(T)crtbegin$(objext)
$(T)crtend.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \
- defaults.h frame.h gbl-ctors.h stmp-int-hdrs
+ defaults.h frame.h gbl-ctors.h stmp-int-hdrs tsystem.h
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
-finhibit-size-directive -fno-inline-functions \
-fno-exceptions $(CRTSTUFF_T_CFLAGS) @inhibit_libc@ \
@@ -1290,7 +1291,7 @@ $(T)crtend.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \
crtbeginS.o crtendS.o: s-crtS ; @true
s-crtS: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \
- defaults.h frame.h gbl-ctors.h stmp-int-hdrs
+ defaults.h frame.h gbl-ctors.h stmp-int-hdrs tsystem.h
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS_S) \
-DCRT_BEGIN -DCRTSTUFFS_O -finhibit-size-directive \
-fno-inline-functions -fno-exceptions @inhibit_libc@ -g0 \
diff --git a/gcc/crtstuff.c b/gcc/crtstuff.c
index 98e0779..c2d4fac 100644
--- a/gcc/crtstuff.c
+++ b/gcc/crtstuff.c
@@ -1,6 +1,6 @@
/* Specialized bits of code needed to support construction and
destruction of file-scope objects in C++ code.
- Copyright (C) 1991, 1994-1999 Free Software Foundation, Inc.
+ Copyright (C) 1991, 1994-1999, 2000 Free Software Foundation, Inc.
Contributed by Ron Guilmette (rfg@monkeys.com).
This file is part of GNU CC.
@@ -52,23 +52,9 @@ Boston, MA 02111-1307, USA. */
do not apply. */
#include "tm.h"
-
-/* We disable this when inhibit_libc, so that gcc can still be built without
- needing header files first. */
-/* ??? This is not a good solution, since prototypes may be required in
- some cases for correct code. See also libgcc2.c/frame.c. */
-#ifndef inhibit_libc
-/* fixproto guarantees these system headers exist. */
-#include <stdlib.h>
-#include <unistd.h>
-#else
-# ifndef atexit
-extern int atexit(void (*)(void));
-# endif
-#endif
+#include "tsystem.h"
#include "defaults.h"
-#include <stddef.h>
#include "frame.h"
/* We do not want to add the weak attribute to the declarations of these
diff --git a/gcc/frame.c b/gcc/frame.c
index 697d3f4..717849f 100644
--- a/gcc/frame.c
+++ b/gcc/frame.c
@@ -1,6 +1,6 @@
/* Subroutines needed for unwinding stack frames for exception handling. */
/* Compile this one with gcc. */
-/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
Contributed by Jason Merrill <jason@cygnus.com>.
This file is part of GNU CC.
@@ -32,31 +32,12 @@ Boston, MA 02111-1307, USA. */
do not apply. */
#include "tconfig.h"
-
-/* We disable this when inhibit_libc, so that gcc can still be built without
- needing header files first. */
-/* ??? This is not a good solution, since prototypes may be required in
- some cases for correct code. See also libgcc2.c/crtstuff.c. */
-#ifndef inhibit_libc
-/* fixproto guarantees these system headers exist. */
-#include <stdlib.h>
-#include <unistd.h>
-
-#else
-#include <stddef.h>
-#ifndef malloc
-extern void *malloc (size_t);
-#endif
-#ifndef free
-extern void free (void *);
-#endif
-#endif
+#include "tsystem.h"
#include "defaults.h"
#ifdef DWARF2_UNWIND_INFO
#include "dwarf2.h"
-#include <stddef.h>
#include "frame.h"
#include "gthr.h"
diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c
index de14051..2775751 100644
--- a/gcc/libgcc2.c
+++ b/gcc/libgcc2.c
@@ -32,36 +32,10 @@ Boston, MA 02111-1307, USA. */
do not apply. */
#include "tconfig.h"
-
-/* We disable this when inhibit_libc, so that gcc can still be built without
- needing header files first. */
-/* ??? This is not a good solution, since prototypes may be required in
- some cases for correct code. See also frame.c/crtstuff.c. */
-#ifndef inhibit_libc
-/* fixproto guarantees these system headers exist. */
-#include <stdlib.h>
-#include <unistd.h>
-
-#else
-#ifndef L_trampoline
-#include <stddef.h>
-#ifndef malloc
-extern void *malloc (size_t);
-#endif
-#ifndef free
-extern void free (void *);
-#endif
-#ifndef atexit
-extern int atexit(void (*)(void));
-#endif
-#endif
-#endif
+#include "tsystem.h"
#include "machmode.h"
#include "defaults.h"
-#ifndef L_trampoline
-#include <stddef.h>
-#endif
/* Don't use `fancy_abort' here even if config.h says to use it. */
#ifdef abort
diff --git a/gcc/tsystem.h b/gcc/tsystem.h
new file mode 100644
index 0000000..244e5c0
--- /dev/null
+++ b/gcc/tsystem.h
@@ -0,0 +1,86 @@
+/* Get common system includes and various definitions and declarations
+ based on target macros.
+ Copyright (C) 2000 Free Software Foundation, Inc.
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+#ifndef __GCC_TSYSTEM_H__
+#define __GCC_TSYSTEM_H__
+
+/* GCC supplies this header. */
+#include <stddef.h>
+
+#ifdef inhibit_libc
+
+#ifndef malloc
+extern void *malloc (size_t);
+#endif
+
+#ifndef free
+extern void free (void *);
+#endif
+
+#ifndef atexit
+extern int atexit (void (*)(void));
+#endif
+
+#else /* ! inhibit_libc */
+/* We disable this when inhibit_libc, so that gcc can still be built without
+ needing header files first. */
+/* ??? This is not a good solution, since prototypes may be required in
+ some cases for correct code. */
+
+/* GCC supplies this header. */
+#include <stdarg.h>
+
+/* All systems have this header. */
+#include <stdio.h>
+
+/* All systems have this header. */
+#include <sys/types.h>
+
+/* All systems have this header. */
+#include <errno.h>
+
+#ifndef errno
+extern int errno;
+#endif
+
+#if defined(POSIX) || defined(USG)
+#include <string.h>
+#endif
+
+/* GCC (fixproto) guarantees these system headers exist. */
+#include <stdlib.h>
+#include <unistd.h>
+
+/* GCC supplies this header. */
+#include <limits.h>
+
+#if defined(POSIX) || defined(USG)
+#include <time.h>
+#endif
+
+#endif /* inhibit_libc */
+
+/* Define a generic NULL if one hasn't already been defined. */
+#ifndef NULL
+#define NULL 0
+#endif
+
+#endif /* __GCC_TSYSTEM_H__ */