This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH for multiply defined symbols with recent libiberty change
- To: bothner at cygnus dot com
- Subject: PATCH for multiply defined symbols with recent libiberty change
- From: Manfred Hollstein <manfred at s-direktnet dot de>
- Date: Mon, 21 Sep 1998 14:07:08 +0200 (MET DST)
- Cc: egcs-patches at cygnus dot com
- Reply-To: manfred at s-direktnet dot de, Manfred dot Hollstein at ks dot sel dot alcatel dot de
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 */