Bug 1265700 - rpm gets %{_host} incorrect on arm
Summary: rpm gets %{_host} incorrect on arm
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-09-23 13:49 UTC by Dennis Gilmore
Modified: 2016-02-03 10:13 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-02-03 10:13:07 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Dennis Gilmore 2015-09-23 13:49:43 UTC
Description of problem:

[root@hathor ~]# uname -a
Linux hathor.ausil.us 4.2.0-300.fc23.armv7hl+lpae #1 SMP Fri Sep 4 13:35:21 UTC 2015 armv7l armv7l armv7l GNU/Linux
[root@hathor ~]# rpm -E %{_host}
armv7hl-redhat-linux-gnueabi


the triplet is supposed to be armv7hl-redhat-linux-gnu

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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Florian Festi 2015-10-23 12:43:08 UTC
This is set by the auto tools. macros.in reads

%_host                  @host@

So what ever autoconf thinks is the right is put there. Please check your tool chain and reassign to autoconf/automake if necessary.

Comment 2 Nicolas Chauvet (kwizart) 2015-10-29 14:44:54 UTC
@Florian,
I wonder if there isn't a circle dependency with the way the packages are built wrongly. Because usually %configure resolves the %{_host} macros that is coded to the following file in the rpm package.

/var/lib/rpm/macros shows:
%_host                  armv7hl-redhat-linux-gnueabi
%_host_alias            armv7hl-redhat-linux-gnueabi%{nil}

So the previous macro is wrong in rpm, but to have it changed to something right, we need to pass it right in ./configure rpm spec file which is currently resolved as --build=armv7hl-redhat-linux-gnueabi --host=armv7hl-redhat-linux-gnueabi --with-vendor=redhat (again, which is wrong in resolving _target_platform):

platform/armv7hl-linux/macros:%_target_platform  %{_target_cpu}-%{_vendor}-%{_target_os}
macros:%_target_os              %{_host_os}
macros:%_host_os                linux

So I don't know where is fetched the -gnueabi in target...

I will have a look on gcc side and do some local tests to see if it's possible to bootstrap a local "fixed" rpm package...

Comment 3 Ľuboš Kardoš 2016-02-02 10:02:25 UTC
> platform/armv7hl-linux/macros:%_target_platform 
> %{_target_cpu}-%{_vendor}-%{_target_os}
> macros:%_target_os              %{_host_os}
> macros:%_host_os                linux
> 
> So I don't know where is fetched the -gnueabi in target...
>
It is fetched from /usr/lib/rpm/redhat/macros (redhat-rpm-config):
%_target_platform	%{_target_cpu}-%{_vendor}-%{_target_os}%{?_gnu}

> I will have a look on gcc side and do some local tests to see if it's
> possible to bootstrap a local "fixed" rpm package...

I created kind of that "fixed" rpm package by mistake and it caused some problems, see #1303265

Comment 4 Ľuboš Kardoš 2016-02-03 10:13:07 UTC
> I wonder if there isn't a circle dependency with the way the packages are
> built wrongly. Because usually %configure resolves the %{_host} macros that
> is coded to the following file in the rpm package.

Yes, now it is a circular dependency but the initial value for @host@ was got from the script config.guess in times when rpm.spec contained calling of configure script without parameter "--host %{_host}". 

The script config.guess is part of autotools so if this is a bug then it should be fixed in autotools at first. But I think this is intentional and when suffix is -gnu instead of -gnueabi on arm then problems arise (bug 1303265). I am closing this as not a bug.


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