Re: Moving along Pure64
On Thu, Apr 01, 2004 at 02:13:37PM -0600, John Goerzen wrote:
> On Thu, Apr 01, 2004 at 01:09:08PM -0700, Greg Johnson wrote:
> > On Thu, Apr 01, 2004 at 10:38:21AM -0600, John Goerzen wrote:
> > > Hi,
> > >
> > > We need a few things to happen to get pure64 going better.
> > >
> > > At the top of the list is a gcc that can build 32- and 64-bit binaries
> > > but defaults to 64-bit mode. This is more difficult than it may appear
> > > at first.
> > I was able to build a working cross compiler for building 32bit binaries
> > on x64-64. The existing binutils are already biarch. Unfortunately,
> > the harddrive my cross compiler was on failed. If anybody's interested,
> > I might be able to recreate it.
> That would be excellent.
Ok, I'll give it a shot. As I remember, I needed some 32bit libraries
to build the cross compiler which I copied from my chroot.
> > With the cross compiler, I could build a 64 bit kernel with 32 bit support.
> > The kernel (2.6.x) actually only has one C file that needs to be
> > compiled in 32bit mode. That file is arch/x86_64/boot/compressed/misc.c
> Does that hold if one wants to run 32-bit binaries also?
Yes. Actually, the support for running 32-bit binaries depends only on
a 32-bit arch/x86_64/ia32/vsyscall.o which can be generated from
arch/x86_64/ia32/vsyscall.S with our as.
It is actually possible to build a complete kernel capable of running 32-bit
binaries with our current tools. The problem is that there are also
some 32-bit components needed to boot the kernel. The misc.c file I
mentioned contains some gzip decompression stuff needed for booting
I think that with a little work, the dependance on a 32-bit gcc could be
removed from the kernel. I had patches to eliminate it for everything
but misc.c, which I unfortunately lost. Shouldn't be too hard to
recreate, though. Maybe misc.c counld be shipped as an assembly file.
> > All the other 32bit objects are generated from assembly files which our
> > as can already handle. The kernel makefiles have to be fixed, though to
> > call as rather than gcc for the .S files.
> Ah, that could be an issue to.
> > BTW, is the biarch gcc necessary for anything other than the kernel?
> No, unless it requires a 32-bit libc.
Not unless what requires a 32-bit libc?