Re: [OS-BUILD PATCHv2] Fix binutils breakage

2024-02-16 Thread Tony Camuso (via Email Bridge)
From: Tony Camuso on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2749#note_1777360893

For ...
ipmi
input
i2c
leds

Approve
--
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [OS-BUILD PATCHv2] Fix binutils breakage

2023-11-06 Thread Viktor Malik (via Email Bridge)
From: Viktor Malik on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2749#note_1636610702

There's still one change necessary. Closing this thread and opening another
one.
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [OS-BUILD PATCHv2] Fix binutils breakage

2023-11-06 Thread Viktor Malik (via Email Bridge)
From: Viktor Malik on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2749#note_1636610086

I believe that we decided to replace the `EXTRA_` flags by a custom bpftool,
otherwise there were errors:

```suggestion:-0+0
%{make} %{?_smp_mflags} TPROGS_USER_CFLAGS="%{?build_hostcflags}"
TPROGS_USER_LDFLAGS="%{?build_hostldflags}"
BPFTOOL="$(pwd)/tools/bpf/bpftool/bpftool" ARCH=$Arch V=1 M=samples/bpf/
VMLINUX_H="${RPM_VMLINUX_H}" || true
```

With this, samples/bpf should compile with PIE.

FWIW, it should suffice to move the below lines

```plaintext
2774 # Prevent bpf selftests to build bpftool repeatedly:
2775 export BPFTOOL=$(pwd)/tools/bpf/bpftool/bpftool
```

above this command, but when I tried that, the bpftool in samples still
attempted to build and errors occurred.
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [OS-BUILD PATCHv2] Fix binutils breakage

2023-11-06 Thread Don Zickus (via Email Bridge)
From: Don Zickus on gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2749#note_1636180680

@vmalikrh - i just pushed v3, can you double check it matches your
expectations?
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


[OS-BUILD PATCHv2] Fix binutils breakage

2023-11-06 Thread Don Zickus (via Email Bridge)
From: Don Zickus 

Fix binutils breakage

The binutils package in Rawhide has stricter checks about PIE/PIC code
and will start reporting errors if it detects mixing and matching no-PIE
with PIE binaries (especially around bpf binaries).

Example errors look like:

/usr/bin/ld: /tmp/ccL7dkfR.o: relocation R_X86_64_32S against `.rodata'
can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status

Fix this by adding more CFLAGS to force PIE/PIC generated binaries to
bpf releated selftests, tools and samples.

This patch was provided by Carlos O'Donell and understands how it works.
I am just the middle man.

All -fPIE errors are resolved except for one about libbpf.a.  The static
version of the library doesn't take CFLAGS so it can't be forced to
build with PIE/PIC.  This error is ignored by the spec file, so it is
ignored by this patch too.

Signed-off-by: Don Zickus 

diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100644
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -2769,7 +2769,7 @@ if [ ! -f include/generated/autoconf.h ]; then
%{make} %{?_smp_mflags} modules_prepare
 fi
 
-%{make} %{?_smp_mflags} ARCH=$Arch V=1 M=samples/bpf/ 
VMLINUX_H="${RPM_VMLINUX_H}" || true
+%{make} %{?_smp_mflags} TPROGS_USER_CFLAGS="%{?build_hostcflags}" 
TPROGS_USER_LDFLAGS="%{?build_hostldflags}" EXTRA_CFLAGS="%{?build_hostcflags}" 
EXTRA_LDFLAGS="%{?build_hostldflags}" ARCH=$Arch V=1 M=samples/bpf/ 
VMLINUX_H="${RPM_VMLINUX_H}" || true
 
 # Prevent bpf selftests to build bpftool repeatedly:
 export BPFTOOL=$(pwd)/tools/bpf/bpftool/bpftool
@@ -2783,7 +2783,7 @@ pushd tools/testing/selftests
   force_targets=""
 %endif
 
-%{make} %{?_smp_mflags} ARCH=$Arch V=1 TARGETS="bpf mm livepatch net 
net/forwarding net/mptcp netfilter tc-testing memfd drivers/net/bonding" 
SKIP_TARGETS="" $force_targets 
INSTALL_PATH=%{buildroot}%{_libexecdir}/kselftests VMLINUX_H="${RPM_VMLINUX_H}" 
install
+%{make} %{?_smp_mflags} USERCFLAGS="%{?build_hostcflags}" 
USERLDFLAGS="%{?build_hostldflags}" ARCH=$Arch V=1 TARGETS="bpf mm livepatch 
net net/forwarding net/mptcp netfilter tc-testing memfd drivers/net/bonding" 
SKIP_TARGETS="" $force_targets 
INSTALL_PATH=%{buildroot}%{_libexecdir}/kselftests VMLINUX_H="${RPM_VMLINUX_H}" 
install
 
 # 'make install' for bpf is broken and upstream refuses to fix it.
 # Install the needed files manually.

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2749
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue