From a23390bf0893f599fbcf95431814f1914c5a0be1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fabian=20Gr=C3=BCnbichler?= Date: Sat, 30 Nov 2024 12:24:03 +0100 Subject: [PATCH] blake3: skip embedded C code, use pure implementation MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Forwarded: not-needed Signed-off-by: Fabian Grünbichler Gbp-Pq: Topic vendor Gbp-Pq: Name blake3-skip-embedded-C-code-use-pure-implementation.patch --- vendor/blake3-1.5.5/Cargo.toml | 2 +- vendor/blake3-1.5.5/build.rs | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/vendor/blake3-1.5.5/Cargo.toml b/vendor/blake3-1.5.5/Cargo.toml index b30c1fd600..2744571f42 100644 --- a/vendor/blake3-1.5.5/Cargo.toml +++ b/vendor/blake3-1.5.5/Cargo.toml @@ -110,7 +110,7 @@ version = "3.8.0" version = "1.1.12" [features] -default = ["std"] +default = ["std", "pure"] digest = ["dep:digest"] mmap = [ "std", diff --git a/vendor/blake3-1.5.5/build.rs b/vendor/blake3-1.5.5/build.rs index 57f72b7643..952b864ca3 100644 --- a/vendor/blake3-1.5.5/build.rs +++ b/vendor/blake3-1.5.5/build.rs @@ -275,7 +275,11 @@ fn main() -> Result<(), Box> { } if is_x86_64() || is_x86_32() { - let support = c_compiler_support(); + let support = if is_pure() { + NoCompiler + } else { + c_compiler_support() + }; if is_x86_32() || should_prefer_intrinsics() || is_pure() || support == NoCompiler { build_sse2_sse41_avx2_rust_intrinsics(); } else { @@ -312,11 +316,13 @@ fn main() -> Result<(), Box> { println!("cargo:rerun-if-env-changed=CFLAGS"); // Ditto for source files, though these shouldn't change as often. - for file in std::fs::read_dir("c")? { - println!( - "cargo:rerun-if-changed={}", - file?.path().to_str().expect("utf-8") - ); + if !is_pure() { + for file in std::fs::read_dir("c")? { + println!( + "cargo:rerun-if-changed={}", + file?.path().to_str().expect("utf-8") + ); + } } Ok(()) -- 2.30.2