aboutsummaryrefslogtreecommitdiffstats
path: root/community/firefox-esr/rust1.78-qcms-stdsimd.patch
blob: 2c86aa14a0b905e8f99c3c2cc09298078b8013ce (plain)
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
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