Re: CVS link error

Ian Lance Taylor
2005-09-27T00:32:10Z

Bob Rossi <bob@brasko.net> writes:

> I did updated a fairly recent tree like this,
> cvs -d ':ext:bobbybrasko@sources.redhat.com:/cvs/src' co gdb+dejagnu
> from the directory that contains the src/ directory.
>
> When I do a build, I get this link error now,
>
> gcc -g -O2 \
> -o gdb gdb.o libgdb.a \
> ../readline/libreadline.a ../opcodes/libopcodes.a ../bfd/libbfd.a ../libiberty/libiberty.a -lncurses -lm ../libiberty/libiberty.a -ldl -rdynamic
> ../libiberty/libiberty.a(xmalloc.o): In function `xmalloc':
> ../../src/libiberty/xmalloc.c:142: multiple definition of `xmalloc'
> libgdb.a(utils.o):../../src/gdb/utils.c:968: first defined here
> ../libiberty/libiberty.a(xmalloc.o): In function `xcalloc':
> ../../src/libiberty/xmalloc.c:156: multiple definition of `xcalloc'
> libgdb.a(utils.o):../../src/gdb/utils.c:1011: first defined here
> ../libiberty/libiberty.a(xmalloc.o): In function `xrealloc':
> ../../src/libiberty/xmalloc.c:171: multiple definition of `xrealloc'
> libgdb.a(utils.o):../../src/gdb/utils.c:991: first defined here
> collect2: ld returned 1 exit status
> make[1]: *** [gdb] Error 1
> make[1]: Leaving directory `/home/bob/cvs/gdb/original/objdir/gdb'
> make: *** [all-gdb] Error 2

I think this is happening because expandargv in libiberty/argv.c now
calls xmalloc_failed. That is provided by libiberty/xmalloc.c but not
by gdb/utils.c.

Is there any reason for gdb/utils.c to continue to define xmalloc and
friends?

Ian