Subject: Re: Mozilla on NetBSD/arm32 1.5
To: Richard Earnshaw <>
From: David Brownlee <>
List: tech-toolchain
Date: 12/12/2000 15:16:59
On Tue, 12 Dec 2000, Richard Earnshaw wrote:

> 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() {}
> gcc -c foo.c
> ar cr libfoo.a foo.o
> ld -r -o xx.o -L. -lfoo -lfoo
> Do you get any link errors?

	No - all looks OK.

	The collect2 line was:

/usr/libexec/collect2 -e start -dc -dp -o mozilla-bin /usr/lib/crt0.o \
    -L/usr/X11R6/lib -L/usr/pkg/lib -L/usr/X11R6/lib -L/usr/pkg/lib \
    -L../../dist/bin -L../../dist/lib -L../../dist/bin -L/usr/libexec \
    nsAppRunner.o nsSetupRegistry.o nsSigHandlers.o -R/usr/X11R6/lib/mozilla \
    -R/usr/X11R6/lib -R/usr/pkg/lib -R/usr/X11R6/lib/mozilla -R/usr/X11R6/lib \
    -R/usr/pkg/lib --whole-archive -lxpfelocation_s -lmpfilelocprovider_s \
    --no-whole-archive -lgkgfx -lxpcom -lmozjs -ljsj -lplds4 -lplc4 -lnspr4 \
    -lintl -lutil -lstdc++ -lm -lgcc -lc -lgcc