Bug 344941 - SRPM build fails : Multilib issue with libdmraid.a
SRPM build fails : Multilib issue with libdmraid.a
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: dmraid (Show other bugs)
4.5
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: Bryn M. Reeves
Corey Marthaler
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-10-22 04:27 EDT by Chris Ward
Modified: 2008-03-17 12:08 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-03-17 12:08:08 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Chris Ward 2007-10-22 04:27:51 EDT
Description of problem:
When building SRPM on x86_64, the build fails with the following error:

BUILD: FAIL for dmraid-1.0.0.rc14-6_RHEL4_U5.src.rpm
BUILDLOG: dmraid-1.0.0.rc14-6_RHEL4_U5.src.rpm-i386-rebuild.log contains full
details.  Last 20 lines:
      -L/var/tmp/dmraid-1.0.0.rc14-6_RHEL4_U5-buildroot/lib -ldmraid -ldevmapper
-lselinux -lsepol
/usr/bin/ld: skipping incompatible ../lib/libdmraid.a when searching for
-ldmraid
/usr/bin/ld: skipping incompatible
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../libdmraid.a when searching for
-ldmraid
/usr/bin/ld: skipping incompatible /usr/lib/libdmraid.a when searching for
-ldmraid
/usr/bin/ld: cannot find -ldmraid
collect2: ld returned 1 exit status
make[1]: *** [dmraid] Error 1
make[1]: Leaving directory `/usr/src/redhat/BUILD/dmraid/1.0.0.rc14/tools'
make: *** [tools] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.14399 (%build)

----------------
Here are my setup, and thoughts. 

Installed : 
%> rpm -q dmraid
dmraid-1.0.0.rc14-6_RHEL4_U5.i386

%> rpm -q dmraid-devel
dmraid-devel-1.0.0.rc14-6_RHEL4_U5.i386

Build for target x86_64 just to check...

%> rpmbuild --target x86_64 -ba /usr/src/redhat/SPECS/dmraid.spec
-> Builds no problem. But currently x86_64 machines have i386 pkgs installed,
and according to the pkg summary, x86_64 machines should be getting the i386
pkgs. So I don't believe the solution should be to build for x86_64 instead of
i386.

Moving on...building for target i386

%> rpmbuild --target i386 -ba /usr/src/redhat/SPECS/dmraid.spec
[SNIP]
BUILD: FAIL for dmraid-1.0.0.rc14-6_RHEL4_U5.src.rpm
BUILDLOG: dmraid-1.0.0.rc14-6_RHEL4_U5.src.rpm-i386-rebuild.log contains full
details.  Last 20 lines:
      -L/var/tmp/dmraid-1.0.0.rc14-6_RHEL4_U5-buildroot/lib -ldmraid
-ldevmapper
-lselinux -lsepol
/usr/bin/ld: skipping incompatible ../lib/libdmraid.a when searching for
-ldmraid
/usr/bin/ld: skipping incompatible
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../libdmraid.a when searching for 
-ldmraid
/usr/bin/ld: skipping incompatible /usr/lib/libdmraid.a when searching for
-ldmraid
/usr/bin/ld: cannot find -ldmraid
collect2: ld returned 1 exit status
make[1]: *** [dmraid] Error 1
make[1]: Leaving directory `/usr/src/redhat/BUILD/dmraid/1.0.0.rc14/tools'
make: *** [tools] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.14399 (%build)
[SNIP]

Okay, so what's up with libmdraid.a? I imagine it's probably a multilib issue...

%> rpm -q --whatprovides /usr/lib/libdmraid.a 
dmraid-devel-1.0.0.rc14-6_RHEL4_U5.i386

%> eu-readelf -h /usr/lib64/libdmraid.a |grep Class
  Class:                             ELF64
[SNIP]

Okay, so, as expected, libdmraid.a is built for i386.

Things look up though if I install the devel pkg that was built for target
x86_64, (i.e. dmraid-devel-1.0.0.rc14-6_RHEL4_U5.x86_64), and run rpmbuild
again. The pkg now builds no problem.

Wouldn't that mean that we should also be including the x86_64 dmraid-devel pkg
with the pkg set for x86_64 archs?? Or is something else going wrong somewhere
else?

Version-Release number of selected component (if applicable):
dmraid-1.0.0.rc14-6_RHEL4_U5

How reproducible:
Always

Steps to Reproduce:
1. See Above
  
Actual results:
Build Fails

Expected results:
Build to Pass

Additional info:
Comment 1 Chris Ward 2008-03-11 06:00:41 EDT
Any updates on this issue?
Comment 2 Bryn M. Reeves 2008-03-13 18:50:28 EDT
We don't support cross-compiling via RPM - never have. If you want to do this,
you need to create a 32-bit chroot on your x86_64 system and carry out the build
in there using the 32-bit toolchain, rpmbuild & libraries.

You can use mock to set these chroots up:

http://fedoraproject.org/wiki/Projects/Mock

It's part of koji and is used on the build hosts to set up the buildroots used
for building packages going through the buildsystem.
Comment 3 Chris Ward 2008-03-14 03:49:33 EDT
Alright. I'm a bit confused as to why it took 4 months to answer this bug...but
anyway, I really appreciate the detailed reply! I'll check up more on those
resources you provided.

Note You need to log in before you can comment on or make changes to this bug.