ayaports/user/zotero/rust1.78-qcms-stdsimd.patch

65 lines
1.8 KiB
Diff
Raw Normal View History

2024-06-03 17:43:01 +00:00
Relevant bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=1882291
diff --git a/Cargo.lock b/Cargo.lock
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4274,10 +4274,11 @@
[[package]]
name = "qcms"
version = "0.2.0"
dependencies = [
"libc",
+ "version_check",
]
[[package]]
name = "qlog"
version = "0.4.0"
diff --git a/gfx/qcms/Cargo.toml b/gfx/qcms/Cargo.toml
--- a/gfx/qcms/Cargo.toml
+++ b/gfx/qcms/Cargo.toml
@@ -18,5 +18,8 @@
iccv4-enabled = []
cmyk = []
[dependencies]
libc = {version = "0.2", optional = true }
+
+[build-dependencies]
+version_check = "0.9"
diff --git a/gfx/qcms/build.rs b/gfx/qcms/build.rs
new file mode 100644
--- /dev/null
+++ b/gfx/qcms/build.rs
@@ -0,0 +1,7 @@
+extern crate version_check as rustc;
+
+fn main() {
+ if rustc::is_min_version("1.78.0").unwrap_or(false) {
+ println!("cargo:rustc-cfg=stdsimd_split");
+ }
+}
diff --git a/gfx/qcms/src/lib.rs b/gfx/qcms/src/lib.rs
--- a/gfx/qcms/src/lib.rs
+++ b/gfx/qcms/src/lib.rs
@@ -5,13 +5,15 @@
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]
// These are needed for the neon SIMD code and can be removed once the MSRV supports the
// instrinsics we use
-#![cfg_attr(feature = "neon", feature(stdsimd))]
+#![cfg_attr(all(stdsimd_split, target_arch = "arm", feature = "neon"), feature(stdarch_arm_neon_intrinsics))]
+#![cfg_attr(all(stdsimd_split, target_arch = "arm", feature = "neon"), feature(stdarch_arm_feature_detection))]
+#![cfg_attr(all(not(stdsimd_split), target_arch = "arm", feature = "neon"), feature(stdsimd))]
#![cfg_attr(
- feature = "neon",
+ all(target_arch = "arm", feature = "neon"),
feature(arm_target_feature, raw_ref_op)
)]
/// These values match the Rendering Intent values from the ICC spec