Re: gcc on a biarch system
On Saturday 05 July 2003 19:44, Bart Trojanowski wrote:
> On amd64, we currently have a biarch-gcc that builds 32bit binaries by
> default, and 64bit ones with a -m64 option. Coding debian/rules for this
> is pretty trivial but still requires some ugly architecture specific
> hacks in each debian/rules.
> I propose obtaining the gcc specific options from a dpkg-libinfo
> (introduced by Gerhard Tonn's lib64 patches) or dpkg-architecture.
> debian/rules can query for said options, and use them in order to build
> for a given host architecture.
No, that's exactly the wrong way around. dpkg-libinfo (at least the
current proposal) uses dpkg-architecture to find the target
architecture and dpkg-architecture in turn calls gcc to get that.
It makes sense this way, although dpkg-libinfo might also call gcc
There is a patch for gcc so that it calls uname(2) to find out if it
should build 32 or 64 bit binaries. You can then use the personality
system call when you want to change to building 32 bit packages, e.g.
'do32bit fakeroot dpkg-buildpackage' (I don't know if there is
already a tool that changes the personality, but do32bit is probably
not the best name for such a tool).