1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
From: =?utf-8?q?Fabian_Gr=C3=BCnbichler?= <git@fabian.gruenbichler.email>
Date: Sat, 30 Nov 2024 12:24:03 +0100
Subject: blake3: skip embedded C code, use pure implementation
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Forwarded: not-needed
Signed-off-by: Fabian Grünbichler <git@fabian.gruenbichler.email>
---
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 b30c1fd..2744571 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 57f72b7..952b864 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<dyn std::error::Error>> {
}
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<dyn std::error::Error>> {
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(())
|