[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Ответ: Building i386 as target on amd64

On Tue, 2008-01-08 at 20:23 +0300, Max Dmitrichenko wrote:
> 2007/12/31, Neil Williams <codehelp@debian.org>:
> > On Thu, 2007-12-27 at 12:25 +0300, Max Dmitrichenko wrote:
> > > Hi!
> > >
> > > I use amd64 as host and want to build rootfs for i386 target.
> >
> > Use debootstrap to create an i386 chroot on your amd64 box. You do not
> > need a cross compiler or toolchain.
> debootstrap from what mirror?

From a normal Debian mirror. The chroot is a build chroot using normal
Debian packages, into which you download the packages to be built.

>  Is there any mirror hosting Emdebian
> packages for i386? 

No, because nobody has built any packages for i386.

> > Not explicitly because it doesn't involve cross building the packages so
> > most of the code in the scripts is simply not used. I have no idea if
> > the rootfs packages will build for i386 when using the current Emdebian
> > patches. emdebian-tools was improved during the Linz conference to have
> > better support for native building (which is what amd64<->i386 actually
> > is) but I've no idea if the built packages would work.
> I guess not. I see you've patched the emsetup and now it says that I
> don't need a cross toolchain. But when I tried to build glibc for i386
> with the help of emsource, I failed to do it. 

You do not need a cross building toolchain. You do not cross build glibc
or gcc or anything else. Create the chroot and build packages normally.
You don't need emdebian-tools for what you want to do.

> > I'll see if the emsetup script can be made more intelligent and detect
> > when a toolchain is a waste of time.
> Why do we need such exception cases like biarchs? Why not to do
> everything in a generic way? Why not to imagine that amd64 and i386
> have nothing in common?
> I've manually built an i386 toolchain on my amd64 box according to the
> instructions at the www.emdebian.org and then (with a couple of
> patches) successfuly managed to build glibc-2.7-4em1 for i386. I don't
> even imagine the expense of doing it with my host compiler  even it is
> possible in theory.

Waste of time - you don't need a toolchain for what you want. You are
not cross compiling. Build an i386 chroot and build normally.

amd64 *is* x86 which is i386 - all you need to do is isolate the 32bit
code from the 64bit code, hence the chroot. You install i386 packages
from Debian into that chroot and run them inside that chroot. You
install amd64 packages from Debian outside the chroot and run them
outside the chroot. No cross compiling involved.

> I am at the point when I have built only one package (glibc)

Then delete it and forget it. You don't need it because you simply use
the glibc for i386 already in Debian. If you want to tweak it, tweak it
but you build with normal Debian build scripts inside the 32bit chroot,
not emdebian-tools.

> So, another question that is closely related to the topic. Is it
> really needed to build amd64 and xen flavors of glibc on i386 when we
> are talking about embedded target? 


> Does the Emdebian pursue more
> fine-graned control of target packages? If so, how can it be controled
> with emdebuild tool?

It cannot because you are not cross compiling. i386 <-> amd64 is NOT
cross compiling.

>  I think, that I'm ready to develop such patches
> for the packages that I'll built, but I don't really know whether the
> emdebian-toolchain can use such features at the current stage of
> development.

It will never be able to support it because it is not cross compiling.


Neil Williams

Attachment: signature.asc
Description: This is a digitally signed message part

Reply to: