Bug 344941

Summary: SRPM build fails : Multilib issue with libdmraid.a
Product: Red Hat Enterprise Linux 4 Reporter: Chris Ward <cward>
Component: dmraidAssignee: Bryn M. Reeves <bmr>
Status: CLOSED NOTABUG QA Contact: Corey Marthaler <cmarthal>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.5CC: agk, dwysocha, heinzm, mbroz, prockai
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-03-17 16:08:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Chris Ward 2007-10-22 08:27:51 UTC
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 10:00:41 UTC
Any updates on this issue?

Comment 2 Bryn M. Reeves 2008-03-13 22:50:28 UTC
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 07:49:33 UTC
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.