commit:     8007493abaf9d9af06aa6c72463c2942532a5e57
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 11 10:07:42 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Sep 11 13:09:27 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8007493a

dev-util/bpf-linker: Fix building with rust 1.88.0

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-util/bpf-linker/Manifest                       |  1 +
 dev-util/bpf-linker/bpf-linker-0.9.14-r1.ebuild    |  3 ++
 .../files/bpf-linker-0.9.14-rust-1.88.patch        | 39 ++++++++++++++++++++++
 3 files changed, 43 insertions(+)

diff --git a/dev-util/bpf-linker/Manifest b/dev-util/bpf-linker/Manifest
index 9d9cf4ba9fde..4358509f0075 100644
--- a/dev-util/bpf-linker/Manifest
+++ b/dev-util/bpf-linker/Manifest
@@ -2,4 +2,5 @@ DIST bpf-linker-0.9.14-crates.tar.xz 14190616 BLAKE2B 
5384062cb678ef2ec19401fddb
 DIST bpf-linker-0.9.14.gh.tar.gz 47526 BLAKE2B 
cb6a9d1fadff1554d9ad69934e3d22ef325f38ea3c97410e1c155e8d88835aaeb485e9c06c6ada3e975881190fe8c50fc0ecdf2921dbc83abd0f7873e1a08001
 SHA512 
0c5e530f8b94dbd4a290a92c11a4a99c4b92c8ee6b6dc6f00c25d5dcb43fa44c7a62d12e8a10edae2078b78cf7141363060b08cb6b98a5026dbaeb60d7c95bf1
 DIST compiler_builtins-0.1.146.crate 212475 BLAKE2B 
9036a9e643ad310932c7943ce5e41c53029f08e604e8ed0a6255d49cf98ecea832dd19ffd109c34a83873880f1c281dc5991bf3f34b9e04f6e9562d40926fd48
 SHA512 
51db04a4e2b7fbc8a7b7407d57a9c82884f9950f5937cf422d14d4c53bc6b942d90e443857cf0c363b0365202713ecbaea3977e9c1cf534c54b041a1f6efd409
 DIST compiler_builtins-0.1.152.crate 224321 BLAKE2B 
232cbc3afb4de5f9ed401df8dce40a1ba56e392f5d5d9b52314abd2c93255859fcb271bd066ca4f23b7879cc787688eedd1dc78eb559ed08aa9fd0d802397fae
 SHA512 
4053d17f667f36e1b06f30b252825e578f42f5dd5dbd4000c8e8742df2787964a9f198c052b6563d09db3d18cd1408be3d9a59b6c366b5c6198ee5581dbc7265
+DIST compiler_builtins-0.1.158.crate 245300 BLAKE2B 
2f0c6281af04eab6d8b2d819e3169ec384beda8b2326a41bfef77fcea24b2fe20d83ed5e2cc0a2c1635dd2f4a4b42fba161a1d6305451e767c8f79c501065d8b
 SHA512 
8b440293d8fb3184b665cddd25dfcc8c65f216dfe5e353db0e867f0346b1aff48e3af82ed3e77aee0ff1a1767e6f35ce348048d3aabc168feb6ab633f19214e5
 DIST compiletest-rs-cb121796a041255ae0afcd9c2766bee4ebfd54f0.gh.tar.gz 60800 
BLAKE2B 
30ca17a8420b6dc19e299e7d18a536b480c19bfdc5bc8237107f8ce2d9f009cfe73bda11f9f0cda009f0608d2259a83333470e5d9bb00b7aeafbaa85454a725a
 SHA512 
5d5ca47a712dd5e6593e6debba272f35da220ec3411e504d1dcac0162f5dfb209068f1465e7bc7e1ffe9c3a2f6d2cb4e5b00b33d43536e3dcd2b6622d8f69361

diff --git a/dev-util/bpf-linker/bpf-linker-0.9.14-r1.ebuild 
b/dev-util/bpf-linker/bpf-linker-0.9.14-r1.ebuild
index aec93a4d288e..91bc378e0207 100644
--- a/dev-util/bpf-linker/bpf-linker-0.9.14-r1.ebuild
+++ b/dev-util/bpf-linker/bpf-linker-0.9.14-r1.ebuild
@@ -8,6 +8,7 @@ EAPI=8
 CRATES="
        [email protected]
        [email protected]
+       [email protected]
 "
 
 # Implied by crates above.
@@ -68,6 +69,8 @@ src_prepare() {
        local PATCHES=(
                # https://github.com/aya-rs/bpf-linker/pull/289
                "${FILESDIR}/${P}-llvm-21.patch"
+               # https://github.com/aya-rs/bpf-linker/pull/265
+               "${FILESDIR}/${P}-rust-1.88.patch"
        )
 
        default

diff --git a/dev-util/bpf-linker/files/bpf-linker-0.9.14-rust-1.88.patch 
b/dev-util/bpf-linker/files/bpf-linker-0.9.14-rust-1.88.patch
new file mode 100644
index 000000000000..c9d5e7521df0
--- /dev/null
+++ b/dev-util/bpf-linker/files/bpf-linker-0.9.14-rust-1.88.patch
@@ -0,0 +1,39 @@
+From 223f8540e80c75730d95d925d6ab9e03cfbfa011 Mon Sep 17 00:00:00 2001
+From: Tamir Duberstein <[email protected]>
+Date: Tue, 1 Apr 2025 10:19:23 -0400
+Subject: [PATCH] Appease `invalid_null_arguments`
+
+This was promoted from a clippy lint in nightly.
+
+Link: https://github.com/rust-lang/rust/pull/119220
+---
+ tests/assembly/auxiliary/dep-exports.rs     | 2 +-
+ tests/btf/assembly/auxiliary/dep-exports.rs | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tests/assembly/auxiliary/dep-exports.rs 
b/tests/assembly/auxiliary/dep-exports.rs
+index 35e003cf..a3dcd682 100644
+--- a/tests/assembly/auxiliary/dep-exports.rs
++++ b/tests/assembly/auxiliary/dep-exports.rs
+@@ -4,7 +4,7 @@
+ 
+ pub fn dep_public_symbol() -> u8 {
+     // read_volatile stops LTO inlining the function in the calling crate
+-    unsafe { core::ptr::read_volatile(0 as *const u8) }
++    unsafe { core::ptr::read_volatile(core::ptr::dangling()) }
+ }
+ 
+ #[no_mangle]
+diff --git a/tests/btf/assembly/auxiliary/dep-exports.rs 
b/tests/btf/assembly/auxiliary/dep-exports.rs
+index 6adcdc03..3a95ecde 100644
+--- a/tests/btf/assembly/auxiliary/dep-exports.rs
++++ b/tests/btf/assembly/auxiliary/dep-exports.rs
+@@ -5,7 +5,7 @@
+ #[inline(never)]
+ pub fn dep_public_symbol() -> u8 {
+     // read_volatile stops LTO inlining the function in the calling crate
+-    unsafe { core::ptr::read_volatile(0 as *const u8) }
++    unsafe { core::ptr::read_volatile(core::ptr::dangling()) }
+ }
+ 
+ #[no_mangle]

Reply via email to