Bug 1876451 - -march=native fails on z15 s390x
Summary: -march=native fails on z15 s390x
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 31
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-09-07 09:01 UTC by Dave Love
Modified: 2020-10-05 08:31 UTC (History)
10 users (show)

Fixed In Version: binutils-2.32-33.fc31
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-09-23 18:10:04 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Dave Love 2020-09-07 09:01:29 UTC
Description of problem:

I don't know whether this is really a gcc or binutils issue, but I think gcc shouldn't pass args to gas that it will reject.  (This is on the Fedora s390x login system, which appears to have up-to-date packages.)

[loveshack@lfedora2 ~]$ echo >x.c 'int main() {return 0;}'
[loveshack@lfedora2 ~]$ gcc -march=native x.c
Assembler messages:
Error: invalid switch -march=z15
Error: unrecognized option -march=z15
[loveshack@lfedora2 ~]$ rpm -q gcc binutils
gcc-9.3.1-2.fc31.s390x
binutils-2.32-31.fc31.s390x

Comment 1 Jakub Jelinek 2020-09-07 09:20:40 UTC
This is something that differs between targets significantly, some targets perform assembler checks at configure time and don't allow options, instruction sets or even individual instructions if assembler doesn't support them, in others it will emit them and let the users choose what options to pass to gcc and what not given their assemblers (don't use too new ISAs if their assembler is too old).  Both solutions have advantages and disadvantages, there is no clear winner.

Comment 2 Nick Clifton 2020-09-07 11:31:01 UTC
(In reply to Dave Love from comment #0)
 
> I don't know whether this is really a gcc or binutils issue, but I think gcc
> shouldn't pass args to gas that it will reject.

The problem here is that the 2.32 binutils used by Fedora 31 does not support the z15
extensions to the s390 architecture, which is why the option is being rejected.

The extension is supported by the 2.34 binutils used by Fedora 32 (and of course later
versions too).

The simplest fix for the problem would be to patch gcc (for F31) to reject the -march=z15
option.  A more complicated fix would be to backport support for the z15 extensions to the
F31 binutils.  I am not sure which is the best choice.  Is z15 support something that has
been promised for F31 ?

Comment 3 Florian Weimer 2020-09-07 11:35:27 UTC
(In reply to Nick Clifton from comment #2)
> (In reply to Dave Love from comment #0)
>  
> > I don't know whether this is really a gcc or binutils issue, but I think gcc
> > shouldn't pass args to gas that it will reject.
> 
> The problem here is that the 2.32 binutils used by Fedora 31 does not
> support the z15
> extensions to the s390 architecture, which is why the option is being
> rejected.

I think the support is there, the instructions are just called arch13. So maybe the backport isn't too hard?

> Is z15 support something that has been promised for F31 ?

I think it's a bug that -march=native stops working after a hardware upgrade.

-- 
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill

Comment 4 Nick Clifton 2020-09-07 12:40:15 UTC
Hi Florian,

(In reply to Florian Weimer from comment #3)
> I think the support is there, the instructions are just called arch13. So
> maybe the backport isn't too hard? 

Ha! I had not spotted that.  Thanks for pointing it out.  Yes a patch should
be very simple.  Testing it now.

Cheers
  Nick

Comment 5 Nick Clifton 2020-09-07 13:29:50 UTC
Ok, I have applied the patch and built a new binutils.  I am now starting a Bodhi update to get the new build pushed out.

Comment 6 Fedora Update System 2020-09-07 13:34:37 UTC
FEDORA-2020-9c524230d8 has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2020-9c524230d8

Comment 7 Fedora Update System 2020-09-07 17:57:10 UTC
FEDORA-2020-9c524230d8 has been pushed to the Fedora 31 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-9c524230d8`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-9c524230d8

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 8 Fedora Update System 2020-09-23 18:10:04 UTC
FEDORA-2020-9c524230d8 has been pushed to the Fedora 31 stable repository.
If problem still persists, please make note of it in this bug report.


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