From 963572d96a0ed4c49082b034811a380f93f432a6 Mon Sep 17 00:00:00 2001 From: K4sum1 Date: Mon, 22 Jan 2024 03:31:39 -0800 Subject: [PATCH] 7 SP0/Vista AVX fix --- security/manager/ssl/crypto_hash/Cargo.toml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/security/manager/ssl/crypto_hash/Cargo.toml b/security/manager/ssl/crypto_hash/Cargo.toml index f842368d4b5f2..7b7cfa2ef48dd 100644 --- a/security/manager/ssl/crypto_hash/Cargo.toml +++ b/security/manager/ssl/crypto_hash/Cargo.toml @@ -11,5 +11,13 @@ md-5 = "0.10.2" nserror = { path = "../../../../xpcom/rust/nserror" } nsstring = { path = "../../../../xpcom/rust/nsstring" } sha1 = "0.10.2" -sha2 = "0.10.2" xpcom = { path = "../../../../xpcom/rust/xpcom" } + +# bug 1838108: on Windows 7 pre-SP1, AVX instructions are disabled, even though +# they might be supported by the processor. cpufeatures doesn't take this into +# account, so the assembly implementation causes illegal instruction crashes. +# As a workaround for now, use the non-assembly implementation. +[target.'cfg(windows)'.dependencies] +sha2 = { version = "0.10.2", features = ["force-soft"]} +[target.'cfg(not(windows))'.dependencies] +sha2 = "0.10.2" \ No newline at end of file