]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #103989 - arlosi:arm32-panic, r=Amanieu
authorMatthias Krüger <matthias.krueger@famsik.de>
Sat, 19 Nov 2022 14:35:20 +0000 (15:35 +0100)
committerGitHub <noreply@github.com>
Sat, 19 Nov 2022 14:35:20 +0000 (15:35 +0100)
Fix build of std for thumbv7a-pc-windows-msvc

Attempting to build std for the tier-3 target `thumbv7a-pc-windows-msvc` fails with the following error:
```
Building stage1 std artifacts (x86_64-pc-windows-msvc -> thumbv7a-pc-windows-msvc)
..
LLVM ERROR: WinEH not implemented for this target
error: could not compile `panic_unwind`
```

EH (unwinding) is not supported by LLVM for 32 bit arm msvc targets. This changes panic unwind to use the dummy implementation for `thumbv7a-pc-windows-msvc`.

library/panic_unwind/src/lib.rs

index 1eb4f378904a9894efcddba25f6138e5aac883c9..7e7180a38e2f23d6c76b3886a503ebb20832bec6 100644 (file)
@@ -42,7 +42,8 @@
         // L4Re is unix family but does not yet support unwinding.
         #[path = "dummy.rs"]
         mod real_imp;
-    } else if #[cfg(target_env = "msvc")] {
+    } else if #[cfg(all(target_env = "msvc", not(target_arch = "arm")))] {
+        // LLVM does not support unwinding on 32 bit ARM msvc (thumbv7a-pc-windows-msvc)
         #[path = "seh.rs"]
         mod real_imp;
     } else if #[cfg(any(