Bug 159557 - Crossbuild: arch should use _build_cpu, not _target_cpu
Crossbuild: arch should use _build_cpu, not _target_cpu
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
4
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Paul Nasrat
Mike McLean
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-06-03 22:13 EDT by Jan Kratochvil
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-08-26 22:14:05 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Jan Kratochvil 2005-06-03 22:13:44 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Galeon/1.3.21

Description of problem:
Currently if you define:
%define _target_cpu arm
%define _build_cpu i386
%define _host_cpu i386

the final .rpm gets built in RPMS/arm/... with the .rpm architecture set to "arm".
It should be set to "i386" - you should use "_build_cpu", not "_target_cpu".


Version-Release number of selected component (if applicable):
rpm-4.4.1-18.1

How reproducible:
Always

Steps to Reproduce:
1. Define keywords in .spec like above.
2. Type rpmbuild -bb x.spec
  

Actual Results:  .rpm in RPMS/arm


Expected Results:  .rpm in RPMS/i386


Additional info:
Comment 1 Jeff Johnson 2005-08-26 22:14:05 EDT
I disagree; I expect packages built for an arm architecture to appear in RPMS/arm, not RPMS/i386,
even if cross-compiled.

The path to the directory where rpms are written is entirely configurable, override if you disagree.
Thhe following macro should write to %{_build_cpu}, not the %{_target_cpu}, directory:

#       The output binary package file name template used when building
#       binary packages.
#
# XXX   Note: escaped %% for use in headerSprintf()
%_build_name_fmt        %{_build_cpu}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm

Comment 2 Jan Kratochvil 2005-08-26 22:31:47 EDT
> I disagree; I expect packages built for an arm architecture to appear in
> RPMS/arm, not RPMS/i386, even if cross-compiled.

I agree with this. But currently if you build binutils/gcc .rpm package to be
used on my PC (i686) producing binaries for arm it is called .arm.rpm while
it should be called .i386.rpm as I install the rpm to my PC (i686).

When checking again and the autoconf doc:
# If you want to _use_ a cross compiler, that generates code for a platform
# different from the build platform, you should specify the "host" platform
# (i.e., that on which the generated programs will eventually be run) with
# `--host=TYPE'.

, therefore this Bug name was wrong, it should have been:
% Crossbuild: arch should use _host_cpu, not _target_cpu

but anyway it is no longer an issue for me (I sold the arm device).


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