加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
fix-rust-1.78-unknown-feature-stdsimd-error.patch 2.64 KB
一键复制 编辑 原始数据 按行查看 历史
wk333 提交于 2024-05-10 09:36 . fix rust-1.78 unknown feature stdsimd error
Origin: https://hg.mozilla.org/integration/autoland/rev/e9b01ce8e2fe
# HG changeset patch
# User Jeff Muizelaar <jmuizelaar@mozilla.com>
# Date 1709608348 0
# Node ID e9b01ce8e2fe053ffef77505f05cf18ed0b9fcd2
# Parent 171664703051d94e1be995b74ad97a9dff5beea5
Bug 1882291. Switch to stdarch_arm_neon_intrinsics feature on rust >=1.78. r=glandium
We only need this on ARM32 because the ARM64 intrinsics are stable.
stdarch_arm_neon_intrinsics was split out from stdsimd here:
https://github.com/rust-lang/stdarch/pull/1486
Differential Revision: https://phabricator.services.mozilla.com/D203039
diff --git a/Cargo.lock b/Cargo.lock
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4579,16 +4579,17 @@ dependencies = [
"libc",
]
[[package]]
name = "qcms"
version = "0.2.0"
dependencies = [
"libc",
+ "version_check",
]
[[package]]
name = "qlog"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8777d5490145d6907198d48b3a907447689ce80e071b3d8a16a9d9fb3df02bc1"
dependencies = [
diff --git a/gfx/qcms/Cargo.toml b/gfx/qcms/Cargo.toml
--- a/gfx/qcms/Cargo.toml
+++ b/gfx/qcms/Cargo.toml
@@ -15,8 +15,11 @@ categories = ["graphics"]
default = ["iccv4-enabled", "cmyk"]
c_bindings = ["libc"]
neon = []
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
@@ -2,19 +2,21 @@
*/
#![allow(dead_code)]
#![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
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub enum Intent {
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化