Subject: Re: cross compiler for vax-netbsd
To: Stephen Bell <steve@discus.lincoln.ac.nz>
From: Clint Wolff (VAX collector) <vaxman@uswest.net>
List: port-vax
Date: 10/19/2000 20:41:17
Hi Stephen,

I've played around with various cross-compilers and linkers built
from GCC, and my recollection is the linker is complete endian
dependant. Since the x86 is the opposite (big,wrong) endian from the
VAX (little,right :), you have a major exercise to fix them. IIRC,
'ld' doesn't even handle foreign archives (ie libraries) correctly,
and possibly 'ar' doesn't either.

One possibility is to 'ar x' the library on a VAX, convert all the
multiword fields in the '.o' files to x86 big-endian, then 'ar c'
the files back into a new library on the PC. Then you only have
to worry about 'ld' putting addresses into the executable correctly...

clint

PS Of course, the correct solution is to fix 'ar' and 'ld' so they
can be built to work on opposite endian machines. Please do :)


On Fri, 20 Oct 2000, Stephen Bell wrote:

> Hi all,
>     I'm trying to set up a cross compiler for a vax-netbsd target
>     on a i586-linux host but have run into a few problems.
>     [I've sucessfully built gcc cross compilers for other machines]
> =20
>     I'm not sure I'm building from the correct sources.
>     The cross-linker is the only thing not working, any help/pointers wou=
ld be=20
>     appreciated.=20
>=20
>     here's the picture..
>=20
>     I had binutils-2.9 but couldn't=A0configure the vax-netbsd target
>     so downloaded binutils-2.10 (I noticed the 1.4.2 GENERIC release
>     was using GNU as 2.9.1 )
>=20
>     I couldn't configure binutils vax-netbsd but after a few simple mods
>     vax-bsd works and builds a working cross assembler.=20
>     (there was a problem with TRAD_HEADERS)
>     =20
>     I did have a "vax-netbsd" cross compiler on another machine (I set=20
>     this up in may 1999) but it has missing parts and doesn't look like =
=20
>     it was ever setup with the correct cross assembler.. unless i was usi=
ng chroot.
>     [I was using an egcs (egcs 1.1.2, 2.9.1 binutils)snapshot to build an=
=20
>      alpha-linux cross compiler last year and may have used those sources=
=20
>      to build the vax-netbsd cross compiler, the alpha cross compiler=20
>      worked great but i'm not sure about the vax one]
>=20
>     I'm using an nfs root mounted filesystem on the vax (1.4.2 GENERIC)
>     so I can get the vax headers from there..
>=20
>     so here where I'm at..
>=20
>      the old cross compiler works (-S produces valid asm files which can=
=20
>      be built the rest of the way on the vax ) (egcs-1.1.2??)
>  =20
>      The new vax-bsd cross assembler works and produces object files
>      which I can link on the vax..  so far so good.
>=20
>      the cross linker is the bit i'm having trouble with.
>      I'm still working on figuring out how to run it manually & feed it l=
ibs=20
>      from the nfs root, but it doesn't seem to recognise the vax=20
>      binformat.
> Cheers,
>      Steve
>=20
>=20
>=20