diff options
| author | Eric Huss <eric@huss.org> | 2020-07-06 20:31:12 -0700 |
|---|---|---|
| committer | Eric Huss <eric@huss.org> | 2020-07-15 09:57:10 -0700 |
| commit | 0eb293ddb72ce080b3d0a6bdf643bd645849fa9e (patch) | |
| tree | 04f7024267632bc85abb802b6f4f27d7700df085 /src/libpanic_unwind/lib.rs | |
| parent | cee9f05c2d369cda1d8487fe6e475a2ae990b9f8 (diff) | |
| download | rust-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/libpanic_unwind/lib.rs')
| -rw-r--r-- | src/libpanic_unwind/lib.rs | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/libpanic_unwind/lib.rs b/src/libpanic_unwind/lib.rs index 26b503cb792..430062d4ac4 100644 --- a/src/libpanic_unwind/lib.rs +++ b/src/libpanic_unwind/lib.rs @@ -41,21 +41,33 @@ cfg_if::cfg_if! { if #[cfg(target_os = "emscripten")] { #[path = "emcc.rs"] mod real_imp; - } else if #[cfg(any(target_arch = "wasm32", target_os = "none"))] { - #[path = "dummy.rs"] - mod real_imp; } else if #[cfg(target_os = "hermit")] { #[path = "hermit.rs"] mod real_imp; } else if #[cfg(target_env = "msvc")] { #[path = "seh.rs"] mod real_imp; - } else { + } else if #[cfg(any( + all(target_family = "windows", target_env = "gnu"), + target_os = "cloudabi", + target_family = "unix", + all(target_vendor = "fortanix", target_env = "sgx"), + ))] { // Rust runtime's startup objects depend on these symbols, so make them public. #[cfg(all(target_os="windows", target_arch = "x86", target_env="gnu"))] pub use real_imp::eh_frame_registry::*; #[path = "gcc.rs"] mod real_imp; + } else { + // Targets that don't support unwinding. + // - arch=wasm32 + // - os=none ("bare metal" targets) + // - os=uefi + // - nvptx64-nvidia-cuda + // - avr-unknown-unknown + // - mipsel-sony-psp + #[path = "dummy.rs"] + mod real_imp; } } |
