From 5033f9994b1100d46265014c6243c07cd395789a Mon Sep 17 00:00:00 2001 From: Chris Fallin Date: Wed, 8 Jun 2022 13:48:41 -0700 Subject: [PATCH] cranelift-native flags detection: fix flags on SSE2-only systems. (#4231) In #4224 we saw that an SSE2-only x86-64 system somehow was still detecting SSE3/SSSE3/SSE4.1/SSE4.2. It turns out that we enabled these in the baseline `Flags` in #3816, because without that, a ton of other things break: default flags no longer produce a compiler backend that works with default Wasmtime settings. However the logic to set them when detected (via `CPUID`-using feature-test macros) only does an "if detected then set bit" step per feature; the bits are never *cleared*. This PR fixes that. --- cranelift/native/src/lib.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cranelift/native/src/lib.rs b/cranelift/native/src/lib.rs index 62df2c6c91..2bae5206c2 100644 --- a/cranelift/native/src/lib.rs +++ b/cranelift/native/src/lib.rs @@ -58,6 +58,19 @@ pub fn builder_with_options(infer_native_flags: bool) -> Result