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?

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

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

| 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
  • 1
    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
  • @Gnanam Mock also uses a cleanly built chroot environment to build your RPMs, so it doesn't accidentally pull in artifacts from the server it's being built on which might result in a build that differs from that you would get on a freshly installed server. I wouldn't build RPMs for production with anything else. – Michael Hampton Aug 27 '13 at 13:36

Install missing 32bit lib:

$ sudo yum install glibc-devel.i386
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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