From: meissner Date: Tue, 5 Oct 1999 19:41:35 +0000 (+0000) Subject: Declare malloc, free, and atexit if inhibit_libc is defined. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=98b95f69f98d527873f0097d9c5ca8ead64d79c6;p=platform%2Fupstream%2Flinaro-gcc.git Declare malloc, free, and atexit if inhibit_libc is defined. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29829 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0da5b3a..46dec8b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +Tue Oct 5 15:37:04 1999 Michael Meissner + + * libgcc2.c (toplevel): If inhibit_libc is defined, declare + malloc, free, and atexit. Don't include stddef.h twice. + + * frame.c (toplevel): If inhibit_libc is defined, declare + malloc and free. + Tue Oct 5 12:00:32 1999 Richard Henderson * flow.c (make_edge): Accept an optional 2D bitmap in which diff --git a/gcc/frame.c b/gcc/frame.c index b5f643e..d153960 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 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. Contributed by Jason Merrill . This file is part of GNU CC. @@ -41,6 +41,15 @@ Boston, MA 02111-1307, USA. */ /* fixproto guarantees these system headers exist. */ #include #include + +#else +#include +#ifndef malloc +extern void *malloc (size_t); +#endif +#ifndef free +extern void free (void *); +#endif #endif #include "defaults.h" diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c index 777112c..0cf8c5c 100644 --- a/gcc/libgcc2.c +++ b/gcc/libgcc2.c @@ -40,11 +40,23 @@ Boston, MA 02111-1307, USA. */ /* fixproto guarantees these system headers exist. */ #include #include + +#else +#include +#ifndef malloc +extern void *malloc (size_t); +#endif +#ifndef free +extern void free (void *); +#endif +#ifndef atexit +extern int atexit(void (*)(void)); +#endif #endif #include "machmode.h" #include "defaults.h" -#ifndef L_trampoline +#if !defined(L_trampoline) && !defined(inhibit_libc) #include #endif