This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PR 10957


Hello,

I've attached the patch. This fixes certain targets
which build with newlib, and need to include malloc.h
(where free() is defined) but don't. Tested by me on
i686-pc-linux-gnu, and by PR 10957's submitter on
m68k-elf (with newlib). Can someone take a look?
Thanks,

Dara

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
2003-06-04  Dara Hazeghi  <dhazeghi@yahoo.com>

	* configure.in: Add check for malloc.h needed by
	m68k for function free().
	* hashtab.c: include malloc.h were available for
	free().

diff -ur libiberty.old/configure.in libiberty/configure.in
--- libiberty.old/configure.in	Wed May  7 19:04:46 2003
+++ libiberty/configure.in	Tue Jun  3 21:54:51 2003
@@ -143,7 +143,7 @@
 # It's OK to check for header files.  Although the compiler may not be
 # able to link anything, it had better be able to at least compile
 # something.
-AC_CHECK_HEADERS(sys/file.h sys/param.h limits.h stdlib.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h alloca.h sys/pstat.h sys/sysmp.h sys/sysinfo.h machine/hal_sysinfo.h sys/table.h sys/sysctl.h sys/systemcfg.h)
+AC_CHECK_HEADERS(sys/file.h sys/param.h limits.h stdlib.h malloc.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h alloca.h sys/pstat.h sys/sysmp.h sys/sysinfo.h machine/hal_sysinfo.h sys/table.h sys/sysctl.h sys/systemcfg.h)
 AC_HEADER_SYS_WAIT
 AC_HEADER_TIME

diff -ur libiberty.old/hashtab.c libiberty/hashtab.c
--- libiberty.old/hashtab.c	Wed May  7 19:04:46 2003
+++ libiberty/hashtab.c	Tue Jun  3 21:58:56 2003
@@ -45,6 +45,10 @@
 #include <string.h>
 #endif
 
+#ifdef HAVE_MALLOC_H
+#include <malloc.h>
+#endif
+
 #include <stdio.h>
 
 #include "libiberty.h"

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]