Fix ARM compilation: vendor libhackrf with c_char portability fix

The upstream libhackrf v0.1.1 crate fails to compile on ARM because
c_char is u8 on ARM (not i8 like on x86). The transmute at lib.rs:102
explicitly casts &[i8] -> &[u8], but on ARM the source is already &[u8],
causing a type mismatch.

Vendored the crate at vendor/libhackrf/ with the transmute replaced by
slice::from_raw_parts with a pointer cast, which works on both
architectures. Also cleaned up transmute calls in transfer.rs.

Fixes #1
This commit is contained in:
KaraZajac
2026-03-22 11:14:41 -04:00
parent 295e4c4d4a
commit 84b75ee6b5
9 changed files with 473 additions and 2 deletions
+4
View File
@@ -54,6 +54,10 @@ atty = "0.2"
[build-dependencies]
pkg-config = "0.3"
[patch.crates-io]
# Vendored with ARM fix: c_char is u8 on ARM, so the upstream transmute fails
libhackrf = { path = "vendor/libhackrf" }
[profile.release]
opt-level = 3
lto = true