Possible bug with cross compiling (i386 on amd64 host).
Joe Marcus Clarke
marcus at freebsd.org
Wed Oct 20 17:26:16 EDT 2010
On 10/20/10 11:02 AM, Tom Judge wrote:
> On 10/20/2010 12:47 AM, Ade Lovett wrote:
>> On Oct 19, 2010, at 13:56 , Tom Judge wrote:
>>> Is there a way to fix this when the jail is created?
>> Cross compiling anything but src/ (in tinderbox parlance, jails) is fraught with issues.
>>
>> The way I do things, with decent enough success (the few edge cases really aren't worth mentioning), is to set up a full i386 chroot (you can probably get away with just the 'bin' set, but I choose to add 'dict' and 'proflibs' since those are needed within the tinderbox-environment, and I like to keep things relatively sane).
>>
>> nullfs mount whatever you need inside the chroot from the actual amd64 host, add devfs, then add the following lines to /local/i386/.cshrc (and /local/i386/root/.cshrc) -- substitute /local/i386 for wherever you have your chroot.
>>
>> setenv UNAME_m i386
>> setenv UNAME_p i386
>>
>> You can then "chroot /local/i386" and uname will do the right thing. Add the mysql/pgsql client libraries of your choice, along with everything else that tinderbox needs (not the UI bits, since that runs on the amd64 iron), tweak resolv.conf and the mail system (if you want notifications), then run i386 builds from within the chroot.
>>
>> You can also do this with a (FreeBSD) jail along similar lines, or even a virtualbox host (I also have those for testing things out in a "clean" environment), but the latter does come with a significant performance hit.
>>
>> If there's sufficient interest, I can probably clean up the above and make an actual i386-chroot-on-amd64-host installation guide.
>>
>> Now excuse me whilst I wander off and do a global replace of "jail" to "bindist" (or something) within the ports tinderbox code. :)
>
> The /jail/ in question was created with:
>
> ./tc createJail -j 8.1.i386 -u SVN -t releng/8.1 -d "FreeBSD 8.1-RELENG
> i386" -a i386
>
> This seems to setup the build environment correctly, i.e. chrooting to
> it and using uname -p and uname -m both report i386. The problem that I
> am seeing is that when the build is running then ARCH (in the build
> environment) is set to amd64 not i386 and cdrtools seems to use ARCH in
> its do-install target but uname -[mp] in its compile target. This was
> causing it to try to install the compiled code from OBJ/amd64-freebsd-cc
> but it was compiled in OBJ/i386-freebsd-cc.
>
> To resolve this I set ARCH=amd64 in scripts/etc/env/jail.8.1.i386 which
> resolved the issue. This post was about the posibility of pre-creating
> scripts/etc/env/jail.{jail name} with ARCH set in it when the jail arch
> does not match the hosts.
>
> I will be doing extensive testing with i386 builds on amd64 hosts in
> tinderbox this week and next and will report on any other issues I find.
As Ade said, cross-building ports is not something that one typically
does. Any reports of success would make good howtos for other users.
Joe
--
Joe Marcus Clarke
FreeBSD GNOME Team :: gnome at FreeBSD.org
FreeNode / #freebsd-gnome
http://www.FreeBSD.org/gnome
More information about the tinderbox-list
mailing list