Bug 167834 - can't cross-build RPMs with "BuildArch: i586" on an AMD64 machine
can't cross-build RPMs with "BuildArch: i586" on an AMD64 machine
Status: CLOSED DUPLICATE of bug 158221
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
4
x86_64 Linux
medium Severity low
: ---
: ---
Assigned To: Paul Nasrat
Mike McLean
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-09-08 13:43 EDT by Vadim Nasardinov
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-02-12 10:47:25 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
pared down testcase (2.20 KB, application/octet-stream)
2005-09-08 13:43 EDT, Vadim Nasardinov
no flags Details
output of "setarch i586 ./test" with /etc/rpm/platform present (22.99 KB, text/plain)
2005-09-12 13:02 EDT, Vadim Nasardinov
no flags Details
output of "setarch i586 ./test" with /etc/rpm/platform removed (22.65 KB, text/plain)
2005-09-12 13:04 EDT, Vadim Nasardinov
no flags Details

  None (edit)
Description Vadim Nasardinov 2005-09-08 13:43:12 EDT
I'm not sure if it's an rpmbuild bug or a setarch bug.  I'm not even
sure if it's a bug -- may I'm doing something wrong (in which case,
the man page may need some work).

Although this came up when I tried building a real RPM, for the
purposes of this ticket, I pared it down to a simple artificial
testcase.  See setarch-test-0.1-1.src.rpm attached.

I can rebuild the attached setarch-test RPM on an x86 box just fine.

When I try building it on my AMD64 box, here's what happens:

| $ uname -m
| x86_64
| $ rpmbuild -ba setarch-test.spec
| error: No compatible architectures found for build
| $ setarch i586 uname -m
| i686
| $ setarch i586 rpmbuild -ba setarch-test.spec
| error: No compatible architectures found for build
| $ setarch i586 rpmbuild -ba --target=i586 setarch-test.spec
| Building target platforms: i586
| Building for target i586
| error: No compatible architectures found for build
Comment 1 Vadim Nasardinov 2005-09-08 13:43:13 EDT
Created attachment 118604 [details]
pared down testcase
Comment 2 Jindrich Novy 2005-09-09 03:03:32 EDT
Right, this is not a setarch bug at all. From the list I see setarch works as it
should. It's likely a problem on rpm side as you're unable to build the rpm on
the original arch.

Reassigning to rpm.
Comment 3 Paul Nasrat 2005-09-09 07:13:35 EDT
Vadim - for kicks does

setarch i686 rpmbuild -ba setarch-test.spec

work
Comment 4 Vadim Nasardinov 2005-09-09 10:04:38 EDT
Paul,

That doesn't work, either.  Here's what I get:

| $ rpm -qf $(which rpmbuild)
| rpm-build-4.4.1-22
| $ rpm -qf $(which setarch)
| setarch-1.8-1.FC4
| $ uname -m
| x86_64
| $ setarch i686 uname -m
| i686
| $ setarch i686 rpmbuild -ba setarch-test.spec
| error: No compatible architectures found for build
Comment 5 Paul Nasrat 2005-09-09 11:53:36 EDT
Can you

mv /etc/rpm/platform /etc/rpm/platform.old
Then retry
Comment 6 Vadim Nasardinov 2005-09-09 12:03:31 EDT
That works: 
 
| $ sudo mv /etc/rpm/platform /etc/rpm/platform.old 
| Password: 
| $ setarch i586 rpmbuild -ba setarch-test.spec 2>&1 | grep '^Wrote' 
| Wrote: /var/vadim/scratch/rpm-topdir/SRPMS/setarch-test-0.1-1.src.rpm 
| Wrote: /var/vadim/scratch/rpm-topdir/RPMS/i586/setarch-test-0.1-1.i586.rpm 
| Wrote: /var/vadim/scratch/rpm-topdir/RPMS/i586/setarch-test-debuginfo-0.1-1.i586.rpm 
 
Comment 7 Paul Nasrat 2005-09-12 11:34:54 EDT
Can you create, build ( gcc -lrpm -o test test.c) and run the following test,
running with and without /etc/rpm/platform present within setarch attaching
individually the output for both with/without platform file cases:

#include <stdio.h>
#include <stdlib.h>

#include <rpm/rpmlib.h>

int main ( int argc, char ** argv) {
    int rc;
    const char * arch = "i586";

    rpmReadConfigFiles(NULL, NULL);
    rc = rpmMachineScore(RPM_MACHTABLE_BUILDARCH, arch);
    rpmShowRC(stdout);
    printf("i586 score: %d\n" , rc);
    return rc;
}


Comment 8 Vadim Nasardinov 2005-09-12 13:02:47 EDT
Created attachment 118724 [details]
output of "setarch i586 ./test" with /etc/rpm/platform present
Comment 9 Vadim Nasardinov 2005-09-12 13:04:53 EDT
Created attachment 118725 [details]
output of "setarch i586 ./test" with /etc/rpm/platform removed

See also comment #8, attachment #118724 [details].
Comment 10 Jeff Johnson 2006-02-12 10:47:25 EST

*** This bug has been marked as a duplicate of 158221 ***

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