Bug 2096361

Summary: openrisc-gcc uses system-wide /usr/bin/as to build assemblies
Product: [Fedora] Fedora Reporter: vr5 <vr5>
Component: cross-gccAssignee: David Howells <dhowells>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 36CC: dan, dhowells, lkundrak, pbrobinson
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
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 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-01-12 01:51:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Change target to match the one in cross-binutils none

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.