Subject: Re: Assembler problem with -fpic
To: None <crvich@us.ibm.com>
From: Frederick Bruckman <fb@enteract.com>
List: port-i386
Date: 12/15/1999 13:14:31
On Tue, 14 Dec 1999 crvich@us.ibm.com wrote:

> Is there any way to upgrade the assembler and/or linker (as and ld) on
> NetBSD 1.3.3?  I've tried the generic GNU binutils sources (both 2.8 and
> 2.9), but they produce "Error: Cannot represent relocation type
> BFD_RELOC_386_PLT32" errors during assembly if I compile with -fpic or
> -fPIC (we can build our library statically, but would obviously prefer to
> create a shared lib).
> 
> When I try to use the assembler that comes with NetBSD 1.3.3 (gas 1.9x I
> think), it doesn't recognize some symbols that gcc/g++ 2.95 produces (like
> p2align).  I'm also concerned that ld may have similar problems.  Someone
> told me that some of these low-level tools won't work right if compiled
> from the generic GNU source, and I can't seem to find source code for as or
> ld at the NetBSD site.

"as" is usually built under /usr/src/gnu/usr.bin/gas or gas.new, "ld"
under /usr/src/gnu/usr.bin/{ld,ld.new}, but the bulk of the source is
actually under /usr/src/gnu/dist. You can simply download a whole
gnusrc.tar.gz from a tar_balls directory under a release or current
snapshot.

> What are my options (besides upgrading to NetBSD 1.4.1, which is a last
> resort)?

It should be possible to build the entire 1.4.1 gnusrc module against
the 1.3.3 libs. I did a source upgrade from 1.3.3 to 1.4, but it was a
while ago and I don't remember the exact steps. The general plan is to
start with gnu/libs/libs/libbfd, then gnu/usr.bin/binutils, ld, egcs,
eventually all of gnu; also make, flex, yacc, and share/mk as
necessary. It helps to have another set of binaries around to fall
back on.

If that doesn't sound like fun (to each his own :-)), 1.4.2 should be
out in a couple of weeks. In fact, the NetBSD-release directory has
already the almost-1.4.2 sources, and should see some binary snapshots
very soon. This will give you the same user base as 1.4.1, plus quite
a few updates and bug fixes.