Subject: Re: Mozilla on NetBSD/arm32 1.5
To: David Brownlee <abs@netbsd.org>
From: Richard Earnshaw <rearnsha@arm.com>
List: tech-toolchain
Date: 12/12/2000 15:06:28
This sounds like a linker bug to me.  An object file from within an 
archive file should only be added to the final link list if it resolves an 
undefined symbol from the existing undefined symbol list.  In doing this, 
all the symbols in that object file are added to the executable.  Once an 
object has been added, the symbols it contains become defined, so a second 
search should never cause the object to be added a second time.

try compiling the following:

cat << EOF > foo.c
foo() {}
EOF
gcc -c foo.c
ar cr libfoo.a foo.o
ld -r -o xx.o -L. -lfoo -lfoo

Do you get any link errors?

> 	It looks like the issue is a double inclusion of -lgcc in the link
> 	line. Manually running collect2 with the first -lgcc then
> 	rerunning the make gave me a working binary.
> 
> 	Details at:
> 	http://www.NetBSD.org/cgi-bin/query-pr-single.pl?number=11703
> 
> 	I don't know how to make the toolchain do the right thing here
> 	- gcc/toolchain expert appreciated...
> 
> 	Expect to see an updated mozilla binary package for arm32 on
> 	ftp.netbsd.org soon :)
> 
> 		David/absolute		-- www.netbsd.org: No hype required --
> 
> 
> On Tue, 12 Dec 2000, Izumi Tsutsui wrote:
> 
> > In <Pine.NEB.4.30.0012111700290.393-100000@odysseus.int.purplei.com>
> > abs@netbsd.org wrote:
> >
> > > 	Trying to build the latest pkgsrc mozilla on a fresh NetBSD
> > > 	1.5/arm32 box, libtool-1.3.5nb9, and its choking with:
> >  :
> > > /usr/lib/libgcc.a(_bb.o): Definition of symbol `___bb_init_func' (multiply defin
> >
> > > [... continues for some time ...]
> > > 	Anyone have any thoughts on this - anything I need to pullup from
> > > 	-current?
> >
> > I got the same errors on news68k. I guess old ld has some problem..
> > ---
> > Izumi Tsutsui
> > tsutsui@ceres.dti.ne.jp
> >
>