Bug 2096361 - openrisc-gcc uses system-wide /usr/bin/as to build assemblies
Summary: openrisc-gcc uses system-wide /usr/bin/as to build assemblies
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: cross-gcc
Version: 36
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: David Howells
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-06-13 15:43 UTC by vr5
Modified: 2024-08-13 16:09 UTC (History)
4 users (show)

Fixed In Version: cross-gcc-12.2.1-2.fc38 cross-gcc-12.2.1-2.fc37 cross-gcc-14.1.1-1.el10_0.1
Clone Of:
Environment:
Last Closed: 2023-01-12 01:51:24 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Change target to match the one in cross-binutils (405 bytes, patch)
2022-12-31 09:58 UTC, vr5
no flags Details | Diff

Description vr5 2022-06-13 15:43:37 UTC
Description of problem:


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

gcc-openrisc-linux-gnu-12.1.1-1.fc36.x86_64


How reproducible:

Always


Steps to Reproduce:

trying to compile ex.c:

ex.c:
int main() { return 0; }

$ openrisc-linux-gnu-gcc ex.c -o ex


Actual results:

$ openrisc-linux-gnu-gcc ex.c -o ex
/tmp/ccVfqw7T.s: Assembler messages:
/tmp/ccVfqw7T.s:7: Error: no such instruction: `l.addi r1,r1,-8'
/tmp/ccVfqw7T.s:8: Error: no such instruction: `l.sw 0(r1),r2'
/tmp/ccVfqw7T.s:9: Error: no such instruction: `l.addi r2,r1,8'
/tmp/ccVfqw7T.s:10: Error: no such instruction: `l.sw 4(r1),r9'
/tmp/ccVfqw7T.s:11: Error: no such instruction: `l.movhi r17,hi(0)'
/tmp/ccVfqw7T.s:12: Error: no such instruction: `l.or r11,r17,r17'
/tmp/ccVfqw7T.s:13: Error: no such instruction: `l.lwz r2,0(r1)'
/tmp/ccVfqw7T.s:14: Error: no such instruction: `l.lwz r9,4(r1)'
/tmp/ccVfqw7T.s:15: Error: no such instruction: `l.addi r1,r1,8'
/tmp/ccVfqw7T.s:16: Error: no such instruction: `l.jr r9'
/tmp/ccVfqw7T.s:17: Error: no such instruction: `l.nop'


Expected results:

Compilations without errors from assembler


Additional info:

$ openrisc-linux-gnu-gcc -print-prog-name=as
as

$ openrisc-linux-gnu-gcc -print-prog-name=ld
/usr/bin/openrisc-linux-gnu-ld

So gcc is configured to use correct ld and wrong as.

Comment 1 Dan Horák 2022-06-15 11:00:31 UTC
Unlikely this is a problem with the cross-gcc package, the openrisc assembler is detected correctly during the build and the openrisc target is configured the same way as any other cross-gcc and they behave correctly. Please report the issue to the upstream gcc project, I believe the problem is there.

Comment 2 vr5 2022-12-30 23:06:06 UTC
Also reproduced in Fedora 37

Comment 3 vr5 2022-12-31 09:56:37 UTC
Alright, I found the reason why it does not work.
Target for which cross-binutils built does not match with target of cross-gcc.

cross-binutils.spec:
...
       openrisc-*)     target=or1k-linux-gnu;;
...

cross-gcc.spec:
...
       openrisc-*)     target=or1k-linux;;
...

Changed target in cross-gcc.spec to or1k-linux-gnu and it fixed that for me, now it works as it should.

Comment 4 vr5 2022-12-31 09:58:33 UTC
Created attachment 1935065 [details]
Change target to match the one in cross-binutils

Comment 5 vr5 2022-12-31 10:05:19 UTC
$ openrisc-linux-gnu-gcc --print-prog as
/usr/lib/gcc/or1k-linux-gnu/12/../../../../or1k-linux-gnu/bin/as

Comment 7 Fedora Update System 2023-01-01 19:44:51 UTC
FEDORA-2023-d8ac7cf371 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-d8ac7cf371

Comment 8 Fedora Update System 2023-01-01 20:00:48 UTC
FEDORA-2023-d8ac7cf371 has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 9 Fedora Update System 2023-01-03 13:49:13 UTC
FEDORA-2023-9e8ff693d2 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2023-9e8ff693d2

Comment 10 Fedora Update System 2023-01-04 02:19:50 UTC
FEDORA-2023-9e8ff693d2 has been pushed to the Fedora 37 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-9e8ff693d2`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-9e8ff693d2

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

Comment 11 Fedora Update System 2023-01-12 01:51:24 UTC
FEDORA-2023-9e8ff693d2 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 12 Fedora Update System 2024-08-13 11:38:08 UTC
FEDORA-EPEL-2024-009d6cd3eb (cross-gcc-14.1.1-1.el10_0.1) has been submitted as an update to Fedora EPEL 10.0.
https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2024-009d6cd3eb

Comment 13 Fedora Update System 2024-08-13 16:09:07 UTC
FEDORA-EPEL-2024-009d6cd3eb (cross-gcc-14.1.1-1.el10_0.1) has been pushed to the Fedora EPEL 10.0 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.