Cross building i386 RPMs on an x86_64 Fedora Core 5 machine

October 10, 2006

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, 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:

  1. temporarily rename /etc/rpm/platform to something else, and then
  2. 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.)

Mach, 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.

Comments on this page:

From at 2006-10-12 03:02:14:

How stable is your 64-bit Linux kernel? I have had horrible results with the 64-bit Linux kernel (systems hangs and various oops conditions), and am curious if others are seeing issues? My machine has an AMD X2 processor, and I decided to migrate back to a 32-bit kernel to bring some stability back to my desktop.

- Ryan

By cks at 2006-10-12 15:03:48:

The stability answer got too long for a comment, so I put it in AMD64Stability.

(Software wise it has been more of a wash, but I'm stubborn and x86_64 is clearly the future, so I'm going to stick with it. Besides, the software problems will get better with time.)

Written on 10 October 2006.
« A trivial script: wcat
A spectacular web spammer failure »

Page tools: View Source, View Normal, Add Comment.
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Tue Oct 10 23:33:31 2006
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.