How to create RPM for 32-bit arch from a 64-bit arch server?

13,860

Solution 1

mock -r fedora-14-i386 --rebuild foo.srpm

Solution 2

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

Solution 3

Install missing 32bit lib:

$ sudo yum install glibc-devel.i386
Share:
13,860

Related videos on Youtube

Gnanam
Author by

Gnanam

Updated on September 17, 2022

Comments

  • Gnanam
    Gnanam almost 2 years

    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?

  • Gnanam
    Gnanam over 13 years
    @Ignacio: Since rpmbuild is very new for me, I couldn't able to understand your comment. Can you explain/expand it little bit?
  • Ignacio Vazquez-Abrams
    Ignacio Vazquez-Abrams over 13 years
    rpmbuild -bs sqlite.spec ; yum install mock ; mock .... path/to/sqlite....src.rpm fedoraproject.org/wiki/Projects/Mock
  • Gnanam
    Gnanam over 13 years
    @Ignacio: So, in general, 32-bit arch RPM cannot be created from a server running 64-bit arch, without having mock installed?
  • Ignacio Vazquez-Abrams
    Ignacio Vazquez-Abrams over 13 years
    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.
  • Michael Hampton
    Michael Hampton almost 11 years
    @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.