Building a 32bit RPM on 64bit Linux: Wrong dependencies auto-generated

Greg_Swift at aotx.uscourts.gov Greg_Swift at aotx.uscourts.gov
Thu Sep 16 18:28:53 UTC 2010


rpm-list-bounces at lists.rpm.org wrote on 09/14/2010 05:53:47 PM:

> rpm-list-bounces at lists.rpm.org wrote on 07/29/2010 04:57:26 AM:
> >
> > This is the problem: I made a SPEC file for building an application in
> > 32bit mode on a 64bit Linux. I got around all the stuff regarding
> > compiler flags, 32bit libraries and so on.
> > The RPM generated ends up in the i586 folder and it has i586 in its
> > name. When I unpack it using rpm2cpio it has a 32bit application
inside.
> > When I ldd the application, it says it links to the 32bit libraries.
> > Everything as it should be. But when I try to install this rpm on a
> > 32bit Linux, I get unsatisfied depenedencies to lib64's like libgcc64
> > and so on. When I try to install with --nodeps and --force it says
"this
> > RPM is for x86_64" architecture.
> > Again, when I unpack it manually, it has 32bit software linking to
32bit
> > libs inside.
> >
> > I didn't specify any dependencies in the spec manually, because I rely
> > on dependency auto-generation by ldd (ldd correctly points to the 32bit
> > libraries, as mentioned).
>
> You need to tell the system you are building a 32bit target.
>
> I believe when you are doing the rpmbuild you need to go '--target i586'.
> I saw something earlier today that hinted you might need to prefix the
> whole command with 'setarch i586'
>
> so:
>
> setarch i586 rpmbuila -ba --target=i586 package.spec
>
> I've not tried it this way (althought its much better than the way I've
> done it), so let me know how it goes.
>
> -greg

so humorously enough I ended up in a situation today where I actually
needed to build a package this way.  And it fails.  This could just be the
specific package I'm working on but I thought I'd see if anyone had any
suggestions:

# setarch i386 rpmbuild --target=i386 -ba SPECS/package.spec

..snip..

Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.31095
+ umask 022
+ cd /home/JUNGLE/swiftg/rpmbuild/BUILD
+ cd zabbix-1.8.3
+ LANG=C
+ export LANG
+ unset DISPLAY
+ common_flags='
    --enable-dependency-tracking
    --enable-server
    --enable-agent
    --enable-proxy
    --with-net-snmp
    --with-ldap
    --with-jabber
    --with-unixodbc
'
+ CFLAGS='-O2 -g -pipe -m32 -march=i386 -mtune=pentium4'
+ export CFLAGS
+ CXXFLAGS='-O2 -g -pipe -m32 -march=i386 -mtune=pentium4'
+ export CXXFLAGS
+ FFLAGS='-O2 -g -pipe -m32 -march=i386 -mtune=pentium4'
+ export FFLAGS
++ find . -name config.guess -o -name config.sub
+ for i in '$(find . -name config.guess -o -name config.sub)'
++ basename ./config.guess
+ '[' -f /usr/lib/rpm/redhat/config.guess ']'
+ /bin/rm -f ./config.guess
++ basename ./config.guess
+ /bin/cp -fv /usr/lib/rpm/redhat/config.guess ./config.guess
`/usr/lib/rpm/redhat/config.guess' -> `./config.guess'
+ for i in '$(find . -name config.guess -o -name config.sub)'
++ basename ./config.sub
+ '[' -f /usr/lib/rpm/redhat/config.sub ']'
+ /bin/rm -f ./config.sub
++ basename ./config.sub
+ /bin/cp -fv /usr/lib/rpm/redhat/config.sub ./config.sub
`/usr/lib/rpm/redhat/config.sub' -> `./config.sub'
+ ./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-dependency-tracking --enable-server
--enable-agent --enable-proxy --with-net-snmp --with-ldap --with-jabber
--with-unixodbc --with-mysql
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
configure: Configuring
checking whether make sets $(MAKE)... (cached) yes
checking build system type... x86_64-redhat-linux-gnu
checking host system type... x86_64-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.
error: Bad exit status from /var/tmp/rpm-tmp.31095 (%build)


It seems to still be saying that its a 64bit system for some of the bits.
Am I missing something?


-greg



More information about the Rpm-list mailing list