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

Re: how to cross architecture build a package

Alex Samad <alex@samad.com.au> writes:

> On Sat, Nov 24, 2007 at 01:17:52AM +0100, Pierre Habouzit wrote:

>>   and when you build a package in there, wrap the
>> debuild/dpkg-buildpackage/... call inside linux32.
> why do i need linux32, I have build my package and used schroot. all seems to 
> be well. note I am not doing any compiling !

As Brian said, schroot does set the personality internally, so linux32
is not required.  Just to explain what's going on, see the manual page
for personality(2).

All linux32 does is basically this:

main (int argc, char *argv[])
  execve(argv[0], argv, environ);

It sets the personality to 32-bit Linux, and then execs your desired
command, so it runs in a process with the personality set to

OTOH, schroot also does this, but additionally also chroot()s into a
build chroot, which should obviously be a debootstrapped i386 chroot
in your case, plus some other useful stuff (PAM security checks and so
on).  This is *not* cross compiling; it's in a 32-bit chroot with a
32-bit kernel personality, i.e. effectively a 32-bit system.

If you combine this schroot setup with sbuild, and use the newish
--arch option for sbuild, you can transparently build 32-bit packages
on a 64-bit system.  Just name your chroot name (or alias) as
unstable-i386-sbuild or unstable-i386 (for example) and it will be
used in preference to unstable when --arch=i386 is used.

For extra "fun", you could make a 32-bit Xenix, ISC, SCOSVR3 or SVR4
chroot, but I'm not sure if anyone has actually tested those "options"


  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.

Attachment: pgpSibyVjRK3j.pgp
Description: PGP signature

Reply to: