PDA

View Full Version : Building i386 binaries from source on x86-64 Fedora


Toccata
21st November 2007, 04:53 PM
I installed an i386 RPM package onto my x86-64 system today. The new program starts up and runs just fine, but unfortunately yum also installed the i386 version of freetype as a dependency. So now I would like to get the bytecode interpreter enabled on the i386 version of freetype just as I did for the x86-64 version. No problem, I thought, just rebuild from the source with my modified spec file to an i386 target as follows:

rpmbuild -bb --target i386-fedora-linux rpmbuild/SPECS/freetype.spec

Toward the end of the process, I get an ld segmentation fault

collect2: ld terminated with signal 11 [Segmentation fault]

followed by a slew of compatibility errors like this:

/usr/bin/ld: i386 architecture of input file `/home/Jim/rpmbuild/BUILD/freetype-2.3.5/objs/.libs/ftsystem.o' is incompatible with i386:x86-64 output

and finally a make error:

make: *** [/home/Jim/rpmbuild/BUILD/freetype-2.3.5/objs/libfreetype.la] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.48102 (%build)

I'm still pretty new at this. These error messages have me stumped. Is there something simple I have missed?

leigh123linux
21st November 2007, 05:24 PM
Try


rpmbuild -bb --target=i386 rpmbuild/SPECS/freetype.spec

Toccata
21st November 2007, 06:09 PM

Leigh123,

I actually tried that first (without the equal sign). Same result. I just tried it with the equal sign, but again, same output. It's definitely getting the message that I want i386. The first screen message is "Building for target i386". The command line option is supposed to be an override, but maybe there is a conflict somewhere.

leigh123linux
21st November 2007, 06:50 PM
Ok try building it using mock instead

yum install mock

then add the group mock to your user group , after this logout and back in

then build a modified srpm and build it using mock ( change the path for the srpm )

rpmbuild -bs --with withhout_bytecode_interpreter=0 freetype.spec
mock -r fedora-8-i386 rebuild /home/leigh/rpmbuild/SRPMS/freetype-2.3.5-3.fc8.src.rpm


P.S I got the same error using rpmbuild :( but mock worked OK :cool:

Toccata
21st November 2007, 10:13 PM
Thanks for investigating this. I tried your method, but when I run mock, it hangs at "State Changed: enabling root cache" - no cpu usage, nothing for several minutes.

I must admit that I didn't quite understand your instructions about adding the group mock to my user group. I don't know how to add a group to a group. I just added myself as a user to the mock group. Is that what you meant?

leigh123linux
21st November 2007, 10:21 PM
Thanks for investigating this. I tried your method, but when I run mock, it hangs at "State Changed: enabling root cache" - no cpu usage, nothing for several minutes.

I must admit that I didn't quite understand your instructions about adding the group mock to my user group. I don't know how to add a group to a group. I just added myself as a user to the mock group. Is that what you meant?

Mock will download the required packages to build the package , when the download is complete these are installed in a chroot environment this can take sometime depending on download speed.

I just added myself as a user to the mock group. Is that what you meant?

yes

Toccata
21st November 2007, 11:22 PM
You were right! I didn't wait long enough. Freetype i386 with bytecodes is now installed on my system and my 32 bit app is looking good. :) Thank you very much for your help.