Re: Is AMD64 a native 32 bit architecture?
Mattias Wadenstein wrote:
I was imprecise (and no doubt incorrect) in my previous use of the term
biarch. By monoarch, I intended that the packaging tools considered
amd64 as a single architecture. The underlying compiler and tools in
sid are already 32/64 bit capable.
This is a somewhat interesting idea actually. It would be a bit of work
though, since I think that the port should be reasonably close to sid.
I took your advice and started with sid. Well actually I started with
pulling down non-debian source to convince myself that I could actually
build a tool chain and then went on to see if I could apply what I
learned to debian sources with debian options. I spent some time
stumbling in the dark before happening onto
http://linuxppc64.org/toolchain.shtml which provided the needed clues.
The web archive of x86-64.org build instructions that's been mentioned
on this list was more misdirection than helpful.
The tool chain in sid is already close. I've manually applied an unwind
patch to gcc so that it will compile . The resulting gcc-3.3-3.3.2ds5
cross compiler will compile itself -m32 successfully but fails with an
internal compiler error trying to build glibc. The resulting
gcc-3.2-3.2.3ds9 cross compiler is better behaved. It successfully
recompiles itself -m32 as well as builds glibc-2.3.2.ds1 both -m32 and -m64.
I've also added two lines to dpkg so that it maps amd64->x86_64-linux
and x86_64-linux-gnu->amd64. It seems more than willing to both cross
compile from i386 to amd64 as well as believe that it is already an
amd64 system either by setting CC or by linking /usr/bin/gcc to
x86_64-linux-gcc. That gives me "dpkg-buildpackage -aamd64" capability
and along with that sbuild. I haven't actually loaded any 64 bit
libraries yet so I've just been playing with CC="x86_64-linux-gcc -m32".
Even if useless, I've learned a lot in the process.