Bug 36663 - Add the _build_arch macro for cross-build.
Summary: Add the _build_arch macro for cross-build.
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rpm-build   
(Show other bugs)
Version: 7.1
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact: David Lawrence
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-04-19 15:12 UTC by hjl
Modified: 2007-04-18 16:32 UTC (History)
0 users

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: ---


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

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.



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