Our production server is running CentOS5 64-bit arch.

Because there are no RPM available currently for SQLite latest version (v3.7.3), I created RPM using rpmbuild the very first time by following the instructions given here. I was able to successfully create RPM for 64-bit (x86_64) architecture. But am not able to create RPM for 32-bit (i386) architecture. It failed with the following errors:

...
...
...
+ ./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --target=i386-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --enable-threadsafe
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... 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.
error: Bad exit status from /var/tmp/rpm-tmp.73141 (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.73141 (%build)

This is the command I called: rpmbuild --target i386 -ba sqlite.spec

My question is, how do I create RPM for 32-bit arch from a 64-bit arch server?

link|improve this question

68% accept rate
feedback

2 Answers

mock -r fedora-14-i386 --rebuild foo.srpm
link|improve this answer
feedback

mock will do a x86 build on a x86-64 system when you tell it to use a 32-bit root.

link|improve this answer
@Ignacio: Since rpmbuild is very new for me, I couldn't able to understand your comment. Can you explain/expand it little bit? – Gnanam Nov 11 '10 at 10:28
rpmbuild -bs sqlite.spec ; yum install mock ; mock .... path/to/sqlite....src.rpm fedoraproject.org/wiki/Projects/Mock – Ignacio Vazquez-Abrams Nov 11 '10 at 10:32
@Ignacio: So, in general, 32-bit arch RPM cannot be created from a server running 64-bit arch, without having mock installed? – Gnanam Nov 11 '10 at 10:44
Well... you can, but then you have to install 32-bit development tools and invoke it via setarch. It's much easier to just throw it at mock. – Ignacio Vazquez-Abrams Nov 11 '10 at 10:47
1  
No, I just refresh the main page(s) way too often. – Ignacio Vazquez-Abrams Nov 11 '10 at 10:55
show 1 more comment
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.