== Cross building i386 RPMs on an [[x86_64|]] Fedora Core 5 machine The more I do stuff on my [[x86_64|]] Fedora Core 5 machine, the more I come to understand that people must not have actually tried to use this stuff. The latest adventure was trying to build an i386 RPM. The best tool for this is [[mock Software/MockMach]], a tool for rebuilding RPMs in distribution environments, like (in theory) 'Fedora Core 5 for i386'. In practice, it needs some clubbing. The main problem is that when _mock_ sets up its build area, it winds up installing [[x86_64|]] packages instead of i386 packages, which means that compiling anything in the build area fails (it tries to build i386 binaries without necessary bits like _crt1.o_, or even shared libraries). The chain of events seems to be that _mock_ defers to _yum_, which defers to RPM stuff, which defaults to using whatever it finds in the host's _/etc/rpm/platform_ if such a file exists. To get around this, you have to: # temporarily rename _/etc/rpm/platform_ to something else, and then # run _mock_ as '_linux32 mock ..._', so that mock and everything it runs thinks it's in a 32-bit environment. (I got this from [[a Fedora Extras mailing list post http://www.redhat.com/archives/fedora-extras-list/2006-August/msg00563.html]].) [[Mach Software/MockMach]], the alternative to mock, does not suffer from this problem but has a number of its own that probably make it a worse choice for cross-building RPMs. (It's a better choice if you want a general compilation environment, but still not a great one.) I can't really call this a [[mock]] bug, because it never actually claims to support cross-building. It just comes with tantalizing configuration files that make it look like it does. ~~Update, November 17th~~: this [[mock]] problem has been fixed in recent updates on at least Fedora Core 5 and FC6, making me happy and making cross-building much easier.