Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 36663

Summary: Add the _build_arch macro for cross-build.
Product: [Retired] Red Hat Linux Reporter: hjl
Component: rpm-buildAssignee: Jeff Johnson <jbj>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-07-17 17:21:45 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:
Attachments:
Description Flags
Add _build_arch none

Description hjl 2001-04-19 15:12:11 UTC
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}
...
%endif

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}
...
%endif

Comment 1 hjl 2001-04-19 15:12:54 UTC
Created attachment 15785 [details]
Add _build_arch

Comment 2 Jeff Johnson 2001-07-17 17:21:40 UTC
These are rpm-build, not rpm, issues ...

Comment 3 Jeff Johnson 2001-07-28 13:06:01 UTC
Fixed in my next checkin, should be in rpm-4.0.3-0.84.

Comment 4 hjl 2001-07-28 14:52:07 UTC
I have added 

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

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