about summary refs log tree commit diff
path: root/src/libunwind
diff options
context:
space:
mode:
authorEric Huss <eric@huss.org>2020-07-06 20:31:12 -0700
committerEric Huss <eric@huss.org>2020-07-15 09:57:10 -0700
commit0eb293ddb72ce080b3d0a6bdf643bd645849fa9e (patch)
tree04f7024267632bc85abb802b6f4f27d7700df085 /src/libunwind
parentcee9f05c2d369cda1d8487fe6e475a2ae990b9f8 (diff)
downloadrust-0eb293ddb72ce080b3d0a6bdf643bd645849fa9e.tar.gz
rust-0eb293ddb72ce080b3d0a6bdf643bd645849fa9e.zip
Use an allow-list of platforms that support std.
Use a fall-through for no_std targets.
Diffstat (limited to 'src/libunwind')
-rw-r--r--src/libunwind/lib.rs36
1 files changed, 23 insertions, 13 deletions
diff --git a/src/libunwind/lib.rs b/src/libunwind/lib.rs
index c705ed31fd5..c4d10ab177b 100644
--- a/src/libunwind/lib.rs
+++ b/src/libunwind/lib.rs
@@ -9,21 +9,31 @@
 
 cfg_if::cfg_if! {
     if #[cfg(target_env = "msvc")] {
-        // no extra unwinder support needed
-    } else if #[cfg(
-        any(
-            all(target_arch = "wasm32", not(target_os = "emscripten")),
-            target_os = "none",
-            target_os = "hermit",
-            target_os = "uefi",
-            target_os = "cuda",
-            target_os = "l4re",
-        ))]
-    {
-        // no unwinder on the system!
-    } else {
+        // Windows MSVC no extra unwinder support needed
+    } else if #[cfg(any(
+        target_os = "l4re",
+        target_os = "none",
+    ))] {
+        // These "unix" family members do not have unwinder.
+        // Note this also matches x86_64-linux-kernel.
+    } else if #[cfg(any(
+        unix,
+        windows,
+        target_os = "cloudabi",
+        all(target_vendor = "fortanix", target_env = "sgx"),
+    ))] {
         mod libunwind;
         pub use libunwind::*;
+    } else {
+        // no unwinder on the system!
+        // - wasm32 (not emscripten, which is "unix" family)
+        // - os=none ("bare metal" targets)
+        // - os=hermit
+        // - os=uefi
+        // - os=cuda
+        // - nvptx64-nvidia-cuda
+        // - mipsel-sony-psp
+        // - Any new targets not listed above.
     }
 }