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]

PATCH for multiply defined symbols with recent libiberty change


The following change

Mon Sep 21 00:52:12 1998  Per Bothner  <bothner@cygnus.com>

	* Makefile.in (LIBS):  Link in libiberty.a.

broke egcs on hppa1.1-hp-hpux10.20:

gcc  -DIN_GCC    -g  -DHAVE_CONFIG_H -DHAIFA  obstack.o alloca.o     ../libiberty/libiberty.a -o c++filt \
  cxxmain.o underscore.o getopt.o getopt1.o
/usr/ccs/bin/ld: Duplicate symbol "xmalloc" in files ../libiberty/libiberty.a(xmalloc.o) and cxxmain.o
/usr/ccs/bin/ld: Duplicate symbol "xrealloc" in files ../libiberty/libiberty.a(xmalloc.o) and cxxmain.o
/usr/ccs/bin/ld: Found 2 duplicate symbol(s)
collect2: ld returned 1 exit status

If we intend to use libiberty in gcc, we should remove those definitions in
cplus-dem.c.

manfred


1998-09-21  Manfred Hollstein  <manfred@s-direktnet.de>

	* cplus-dem.c (xmalloc): Remove definition here.
	(xrealloc): Likewise.

diff -rup -x CVS -x RCS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el egcs-19980921.orig/libiberty/cplus-dem.c egcs-19980921/libiberty/cplus-dem.c
--- egcs-19980921.orig/libiberty/cplus-dem.c	Wed Sep  9 19:33:13 1998
+++ egcs-19980921/libiberty/cplus-dem.c	Mon Sep 21 13:25:05 1998
@@ -3864,25 +3864,4 @@ fatal (str)
   fprintf (stderr, "%s: %s\n", program_name, str);
   exit (1);
 }
-
-char *
-xmalloc (size)
-     unsigned size;
-{
-  register char *value = (char *) malloc (size);
-  if (value == 0)
-    fatal ("virtual memory exhausted");
-  return value;
-}
-
-char *
-xrealloc (ptr, size)
-     char *ptr;
-     unsigned size;
-{
-  register char *value = (char *) realloc (ptr, size);
-  if (value == 0)
-    fatal ("virtual memory exhausted");
-  return value;
-}
 #endif	/* main */


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