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
This commit is contained in:
Kaveh R. Ghazi 2000-02-01 21:30:52 +00:00 committed by Kaveh Ghazi
parent ed672cd0e9
commit 2e39bdbe4b
6 changed files with 108 additions and 69 deletions

View File

@ -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

View File

@ -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 \

View File

@ -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

View File

@ -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"

View File

@ -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

86
gcc/tsystem.h Normal file
View File

@ -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__ */