Bug 2281056

Summary: Request to add bpf-unknown-none as another cross-binutils target
Product: [Fedora] Fedora Reporter: Elena Zannoni <elena.zannoni>
Component: cross-binutilsAssignee: David Howells <dhowells>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: dan, dhowells, elena.zannoni, epel-packagers-sig, ezannoni, jose.marchesi, lkundrak, mbrown, ngompa13, sam
Target Milestone: ---Keywords: RFE
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: cross-binutils-2.41-3.fc42 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-08-20 12:07:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2281043    

Description Elena Zannoni 2024-05-17 21:07:41 UTC
See the companion bugzilla for cross-gcc:
https://bugzilla.redhat.com/show_bug.cgi?id=2281043

The gcc bpf port in gcc 14 and binutils 2.42 is in good shape and usable. 
The GNU toolchain can build the bpf self tests and pass a large number of these tests.

The project wiki page is here:
https://gcc.gnu.org/wiki/BPFBackEnd

The cross-binutils bpf target (and cross-gcc bpf target) has been added to debian and also gentoo.

Would it be possible to add it to Fedora? No additional patches should be needed, aside from the specfile changes if you update to binutils 2.42. Some patches would be needed if you stay at binutils 2.41. (We can provide the list of patches)


Reproducible: Always




Something like the following patch (totally untested!) should work:

--- /home/ezannoni/cross-binutils-fedora/cross-binutils/cross-binutils.spec     2024-05-17 14:49:37.329845547 -0600
+++ cross-binutils.spec 2024-05-17 14:53:01.711034041 -0600
@@ -8,6 +13,7 @@
 %global build_arm              %{build_all}
 %global build_avr32            %{build_all}
 %global build_blackfin         %{build_all}
+%global build_bpf              %{build_all}
 %global build_c6x              %{build_all}
 %global build_cris             %{build_all}
 %global build_frv              %{build_all}

@@ -313,6 +315,7 @@
 %do_package arm-linux-gnu      %{build_arm}
 %do_package avr32-linux-gnu    %{build_avr32}
 %do_package bfin-linux-gnu     %{build_blackfin}
+%do_package bpf-unknown-none    %{build_bpf}
 %do_package c6x-linux-gnu      %{build_c6x}
 %do_package cris-linux-gnu     %{build_cris}
 %do_package frv-linux-gnu      %{build_frv}
@@ -447,6 +444,7 @@
     prep_target arm-linux-gnu          %{build_arm}
     prep_target avr32-linux-gnu                %{build_avr32}
     prep_target bfin-linux-gnu         %{build_blackfin}
+    prep_target bpf-unknown-none       %{build_bpf}
     prep_target c6x-linux-gnu          %{build_c6x}
     prep_target cris-linux-gnu         %{build_cris}
     prep_target frv-linux-gnu          %{build_frv}
@@ -841,6 +834,7 @@
 %do_files arm-linux-gnu                %{build_arm}
 %do_files avr32-linux-gnu      %{build_avr32}
 %do_files bfin-linux-gnu       %{build_blackfin}
+%do_files bpf-unknown-none     %{build_bpf}
 %do_files c6x-linux-gnu                %{build_c6x}
 %do_files cris-linux-gnu       %{build_cris}
 %do_files frv-linux-gnu                %{build_frv}

Comment 1 Elena Zannoni 2024-05-17 22:23:12 UTC
I want to reiterate that if Rawhide doesn't update to binutils 2.42 for this cross, there would be the need for some patches/backports.
(Don't have the list handy, but let us know if you need the commit IDs).

Comment 2 Ezannoni 2024-08-16 22:57:37 UTC
I was wondering where this request is at.. and if there is anything that can be done to help.
Having this cross and the companion cross for gcc-bpf would allow to switch back to gcc to build systemd, for instance.

Comment 3 Dan Horák 2024-08-19 08:43:20 UTC
Providing a tested patch would definitely help. Ideally via a PR at https://src.fedoraproject.org/rpms/cross-binutils.

Comment 4 Jose E. Marchesi 2024-08-19 18:27:34 UTC
Hello Dan.

I have used fedpkg in order to fork the rpms/cross-binutils repo into https://src.fedoraproject.org/fork/jemarch/rpms/cross-binutils and did some testing.

However, when it comes to push a branch to my jemarch/rpms/cross-binutils it doesn't work.  Looking at the verbose ssh output, the ssh key registered in my Fedora account is recognized, but then:

  Enter passphrase for key '/home/jemarch/.ssh/id_rsa':
  Connection closed by 38.145.60.17 port 22
  fatal: Could not read from remote repository.
  
  Please make sure you have the correct access rights
  and the repository exists.

Do I need to belong to some user group in order to be able to clone and push via ssh to my own forks?  Looking at https://src.fedoraproject.org/user/jemarch/groups I see I am no member to no group.

Thanks!

Comment 5 Dan Horák 2024-08-19 19:12:02 UTC
per https://docs.fedoraproject.org/en-US/ci/pull-requests/ you should be able to push to your fork using a https URL

Comment 6 Jose E. Marchesi 2024-08-20 07:41:35 UTC
It worked.  Thanks.

Comment 8 Fedora Update System 2024-08-20 12:01:51 UTC
FEDORA-2024-779a0f32a7 (cross-binutils-2.41-3.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-779a0f32a7

Comment 9 Fedora Update System 2024-08-20 12:07:24 UTC
FEDORA-2024-779a0f32a7 (cross-binutils-2.41-3.fc42) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.