I have installed FC6 x86_64 on my new system. I would like to know how I can compile a 32 bit freetype package. The following didn't work:
rpmbuild -bb freetype.spec -bb --target i386
It fails with these errors:
checking build system type... x86_64-redhat-linux-gnu checking host system type... x86_64-redhat-linux-gnu checking target system type... i386-redhat-linux-gnu checking for x86_64-redhat-linux-gnu-gcc... no checking for gcc... gcc checking for C compiler default output file name... configure: error: C compiler cannot create executables See `config.log' for more details. make: *** [setup] Error 77 error: Bad exit status from /var/tmp/rpm-tmp.65705 (%build)
Thanks.
Philippe A. writes:
« HTML content follows » I have installed FC6 x86_64 on my new system. I would like to know how I can compile a 32 bit freetype package. The following didn't work:
rpmbuild -bb freetype.spec -bb --target i386
It fails with these errors:
checking build system type... x86_64-redhat-linux-gnu checking host system type... x86_64-redhat-linux-gnu checking target system type... i386-redhat-linux-gnu
I do not believe that rpm's stock configuration supports cross-building to a different architecture. The --target parameter only sets the architecture label on the resulting rpms, and not much more.
Cross-compilation is not trivial to set up. You must install, beforehand, the i386 build of every library that your software compiles against, and you must know, beforehand, what they are. Then, you'll need to arrange, somehow, for the software's configuration script and makefile pass the -m32 option to gcc.
It's rather unlikely that freetype's rpm and configure script implements all of this.
On 2/25/07, Sam Varshavchik mrsam@courier-mta.com wrote:
Philippe A. writes:
I have installed FC6 x86_64 on my new system. I would like to know how I can compile a 32 bit freetype package. The following didn't work:
rpmbuild -bb freetype.spec -bb --target i386
It fails with these errors:
checking build system type... x86_64-redhat-linux-gnu checking host system type... x86_64-redhat-linux-gnu checking target system type... i386-redhat-linux-gnu
I do not believe that rpm's stock configuration supports cross-building to a different architecture. The --target parameter only sets the architecture label on the resulting rpms, and not much more.
Cross-compilation is not trivial to set up. You must install, beforehand, the i386 build of every library that your software compiles against, and you must know, beforehand, what they are. Then, you'll need to arrange, somehow, for the software's configuration script and makefile pass the -m32 option to gcc.
There is a program called "mock" (in extras) which builds SRPMs in a chroot, gathering all the needed dependecies and everything automatically. I think I remember correctly that it can be setup to build 32-bit packages on a 64-bit system. I played around with it once back a while ago. I don't remember the details.
Jonathan
2007/2/25, Sam Varshavchik mrsam@courier-mta.com:
Philippe A. writes:
« HTML content follows » I have installed FC6 x86_64 on my new system. I would like to know how I can compile a 32 bit freetype package. The following didn't work:
rpmbuild -bb freetype.spec -bb --target i386
It fails with these errors:
checking build system type... x86_64-redhat-linux-gnu checking host system type... x86_64-redhat-linux-gnu checking target system type... i386-redhat-linux-gnu
I do not believe that rpm's stock configuration supports cross-building to a different architecture. The --target parameter only sets the architecture label on the resulting rpms, and not much more.
Cross-compilation is not trivial to set up. You must install, beforehand, the i386 build of every library that your software compiles against, and you must know, beforehand, what they are. Then, you'll need to arrange, somehow, for the software's configuration script and makefile pass the -m32 option to gcc.
It's rather unlikely that freetype's rpm and configure script implements all of this.
Well when you install FC x86_64 you get all these 32 bit libs installed. If you rpm -qa you get a lot of lib packages in double. One is 32 bit, one is 64 bit.
rpm -qa --queryformat "%{name}-%{version}-%{release}.%{arch}\n"
zlib-1.2.3-3.i386 zlib-1.2.3-3.x86_64
So that obviously mean they have been compiled. Since I cannot find a separate SRPM for 32 bit and 64 bit, I have to assume the same was used.
I have found extra bits information here:
http://www.redhat.com/magazine/009jul05/features/multilib/
It's a nice article but not nearly technical.
Someone suggested the following to me. That didn't work.
setarch i386 rpmbuild -bb --target i386 freetype.spec
I don't see how mock can help solve this issue. It seems to be oriented towards spec file verification.
http://fedoraproject.org/wiki/Extras/MockTricks
I keep looking. If anyone else got a suggestion, thanks for letting me know!
If you think about it, it would be insane to package a distro with different sets of rpms. So there has to be a solution that's not so crazy. Maybe recompiling gcc? I seem to have seen some hints to that effect but haven't investigated further yet.
On 2/27/07, Philippe A. futhark77@gmail.com wrote: [snip]
Well when you install FC x86_64 you get all these 32 bit libs installed. If you rpm -qa you get a lot of lib packages in double. One is 32 bit, one is 64 bit.
rpm -qa --queryformat "%{name}-%{version}-%{release}.%{arch}\n"
zlib-1.2.3-3.i386 zlib-1.2.3-3.x86_64
Yes, but that doesn't mean you have all the libs you need, necessarily.
So that obviously mean they have been compiled. Since I cannot find a separate SRPM for 32 bit and 64 bit, I have to assume the same was used.
Yes, there is only one SRPM. Remember you are wanting to compile 32-bit on a 64-bit system. By default, it wants to build 64-bit. A 32-bit system, on the other hand, wants to build 32-bit by default. In actuality, though, I believe mock is used for building packages.
[snip]
I don't see how mock can help solve this issue. It seems to be oriented towards spec file verification.
It can be used for that, but I don't see how you got that to be the main purpose.
I guess you missed this part: "In addition. if building i386 packages on x86_64, prepend setarch i386 to the mock command line: setarch i386 mock -r <configfile> package-1.2-3.src.rpm"
And the <configfile> will be an i386 one (installed in /etc/mock/ when you install it). This looks like what I remember doing last time I tinkered with it.
I keep looking. If anyone else got a suggestion, thanks for letting me know!
If you think about it, it would be insane to package a distro with different sets of rpms. So there has to be a solution that's not so crazy. Maybe recompiling gcc? I seem to have seen some hints to that effect but haven't investigated further yet.
I'll say it again: check out mock :-). "yum install mock"
Jonathan
So yes, mock does the trick. Here are quick pointers for those interested.
It compiles srpms only, so you have to rpmbuild -bs specfile first.
If you don't want it to always fetch packages from a repository (very slow), install a local image:
mock --autocache --rebuildcache -r fedora-6-i386-core.cfg init mock --autocache -r fedora-6-i386-core.cfg clean
Don't forget to add yourself to the "mock" group.
Since I will only be compiling i386 packages with mock, I changed the default config:
cd /etc/mock rm default.cfg ln -s fedora-6-i386-core.cfg default.cfg
Then you can compile:
mock --no-clean --debug /phil/src/rpm/SRPMS/freetype-2.2.1-16bci.src.rpm
Here the command omits -r, so mock will assume it should use our default.cfg .
If you omit --no-clean, the chroot gets recreated everytime and makes compilation take much longer. If you omit --debug, you won't see much output at all.
Cheers!