Bug 36663 - Add the _build_arch macro for cross-build.
Add the _build_arch macro for cross-build.
Product: Red Hat Linux
Classification: Retired
Component: rpm-build (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2001-04-19 11:12 EDT by hjl
Modified: 2007-04-18 12:32 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-07-17 13:21:45 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Add _build_arch (354 bytes, patch)
2001-04-19 11:12 EDT, hjl
no flags Details | Diff

  None (edit)
Description hjl 2001-04-19 11:12:11 EDT
There is no easy to tell from a spec file if we are cross-building
a rpm. You can use

%if %{_target_cpu} != %{_build_cpu}

But it doesn't work with

# rpm --target=i686 ...

on ia32. I think we need _build_arch so that we can do

%if %{_arch} != %{_build_arch}
Comment 1 hjl 2001-04-19 11:12:54 EDT
Created attachment 15785 [details]
Add _build_arch
Comment 2 Jeff Johnson 2001-07-17 13:21:40 EDT
These are rpm-build, not rpm, issues ...
Comment 3 Jeff Johnson 2001-07-28 09:06:01 EDT
Fixed in my next checkin, should be in rpm-4.0.3-0.84.
Comment 4 hjl 2001-07-28 10:52:07 EDT
I have added 

%if %{_arch} != %{_build_arch}
%define cross_compile 1
%define cross_compile 0
%{?do_cross_compile:%define cross_compile 1}

to many spec files. It will be nice for rpm to define
%{cross_compile} automatically.

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