7 Oct 15:32
How to package code compiled with 'gcc -m32'?
From: Richard W.M. Jones <rjones <at> redhat.com>
Subject: How to package code compiled with 'gcc -m32'?
Newsgroups: gmane.linux.redhat.fedora.devel
Date: 2008-10-07 13:35:18 GMT
Subject: How to package code compiled with 'gcc -m32'?
Newsgroups: gmane.linux.redhat.fedora.devel
Date: 2008-10-07 13:35:18 GMT
I've got a nasty program I'm trying to package for Fedora. To cut a very long story short, this C/C++ mixed program started out on Windows and makes lots of 32 bit assumptions. So it's compiled with 'gcc -m32'. Expressing the build requirements so it can build on a 64 bit platform is proving troublesome. (It builds fine on i386). First problem is that it uses <gnu/stubs.h> which includes <gnu/stubs-[WORDSIZE].h> (ie. <gnu/stubs-32.h>). That file isn't in glibc-devel.x86_64, but only in glibc-devel.i386. I've expressed that with a file dependency which breaks Fedora packaging guidelines: BuildRequires: /usr/include/gnu/stubs-32.h The second and much larger problem is that the code uses wxGTK-devel, and (because it's being compiled with gcc -m32) it has to have the 32 bit version. This should work (on x86-64 at least, not ppc64): BuildRequires: wxGTK-devel.i386 but in fact even with the latest version of rpmbuild in Rawhide it doesn't work. So I have to write: BuildRequires: wxGTK-devel which doesn't express the dependency correctly, or:(Continue reading)
It turns out that it's not just built for 32 bit because of the
general hideousness of the code, but because it builds Windows 32 bit
plugins. Somehow -- and I've no idea how it does this -- the Windows
plugins get loaded into the native Fedora binary at runtime. Even
though the main binary is Fedora native, it still has to be built as
32 bit to achieve this minor miracle.
The package is NSIS, in case you were wondering ...
The patch you used, on the other hand, is outdated, it was for a version before
upstream added the -m32, so it doesn't remove the -m32.
Try the 64bit-fixes patch in:
RSS Feed