--enable-c-cpplib build is broken

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Mon Dec 7 11:41:00 GMT 1998


 > From: Dave Brolley <brolley@cygnus.com>
 > 
 > Kaveh R. Ghazi wrote:
 > 
 > >         I just did an --enable-c-cpplib bootstrap and saw the link
 > > failure.
 > >         I'm testing a small patch to correct this.  But before
 > > installing it I'd like to do some test bootstraps both with and
 > > without --enable-c-cpplib.  Can you wait a day or two, or will it
 > > interrupt your work?  (I can send you my untested patch if you want.)
 > 
 > Hi Kaveh,
 > 
 > How is this coming along?
 > 
 > Dave

	Sorry, I got distracted by testing the 1.1.1 release.

I have a patch which I've partly completed testing on.  Let me know if
it works for you. 

		--Kaveh




Tue Dec  1 12:50:13 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* c-aux-info.c (concat): Wrap function definition in !USE_CPPLIB.

	* cppalloc.c: Move function `xcalloc' from cpplib.c to here.
	* cpplib.c: Move function `xcalloc' from here to cppalloc.c.

diff -rup orig/egcs-CVS19981201/gcc/c-aux-info.c egcs-CVS19981201/gcc/c-aux-info.c
--- orig/egcs-CVS19981201/gcc/c-aux-info.c	Tue Dec  1 09:35:15 1998
+++ egcs-CVS19981201/gcc/c-aux-info.c	Tue Dec  1 10:56:38 1998
@@ -48,6 +48,10 @@ static char *gen_decl			PROTO((tree, int
 
    This function is based on the one in libiberty.  */
 
+/* This definition will conflict with the one from prefix.c in
+   libcpp.a when linking cc1 and cc1obj.  So only provide it if we are
+   not using libcpp.a */
+#ifndef USE_CPPLIB
 char *
 concat VPROTO((const char *first, ...))
 {
@@ -99,6 +103,7 @@ concat VPROTO((const char *first, ...))
 
   return (newstr);
 }
+#endif /* ! USE_CPPLIB */
 
 /* Given a string representing an entire type or an entire declaration
    which only lacks the actual "data-type" specifier (at its left end),
diff -rup orig/egcs-CVS19981201/gcc/cppalloc.c egcs-CVS19981201/gcc/cppalloc.c
--- orig/egcs-CVS19981201/gcc/cppalloc.c	Tue Dec  1 09:35:23 1998
+++ egcs-CVS19981201/gcc/cppalloc.c	Tue Dec  1 11:08:08 1998
@@ -46,6 +46,16 @@ xmalloc (size)
 }
 
 PTR
+xcalloc (number, size)
+  size_t number, size;
+{
+  register PTR ptr = (PTR) calloc (number, size);
+  if (ptr == 0)
+    memory_full ();
+  return ptr;
+}
+
+PTR
 xrealloc (old, size)
   PTR old;
   size_t size;
diff -rup orig/egcs-CVS19981201/gcc/cpplib.c egcs-CVS19981201/gcc/cpplib.c
--- orig/egcs-CVS19981201/gcc/cpplib.c	Tue Dec  1 09:35:24 1998
+++ egcs-CVS19981201/gcc/cpplib.c	Tue Dec  1 11:08:26 1998
@@ -6429,20 +6429,10 @@ free_token_list (tokens)
   }
 }
 
-/* FIXME: savestring() should be renamed strdup() and both should
+/* FIXME: savestring() should be renamed strdup() and should
    be moved into cppalloc.c.  We can't do that right now because
    then we'd get multiple-symbol clashes with toplev.c and several
    other people. */
-PTR
-xcalloc (number, size)
-  size_t number, size;
-{
-  register unsigned total = number * size;
-  register PTR ptr = (PTR) xmalloc (total);
-  bzero (ptr, total);
-  return ptr;
-}
-
 char *
 savestring (input)
      char *input;



More information about the Gcc-bugs mailing list