summaryrefslogtreecommitdiffstats
path: root/library/unwind
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:39 +0000
commit1376c5a617be5c25655d0d7cb63e3beaa5a6e026 (patch)
tree3bb8d61aee02bc7a15eab3f36e3b921afc2075d0 /library/unwind
parentReleasing progress-linux version 1.69.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.tar.xz
rustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.zip
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'library/unwind')
-rw-r--r--library/unwind/src/lib.rs16
-rw-r--r--library/unwind/src/libunwind.rs3
2 files changed, 19 insertions, 0 deletions
diff --git a/library/unwind/src/lib.rs b/library/unwind/src/lib.rs
index edc10aa39..b655bae96 100644
--- a/library/unwind/src/lib.rs
+++ b/library/unwind/src/lib.rs
@@ -54,6 +54,22 @@ cfg_if::cfg_if! {
}
}
+// This is the same as musl except that we default to using the system libunwind
+// instead of libgcc.
+#[cfg(target_env = "ohos")]
+cfg_if::cfg_if! {
+ if #[cfg(all(feature = "llvm-libunwind", feature = "system-llvm-libunwind"))] {
+ compile_error!("`llvm-libunwind` and `system-llvm-libunwind` cannot be enabled at the same time");
+ } else if #[cfg(feature = "llvm-libunwind")] {
+ #[link(name = "unwind", kind = "static", modifiers = "-bundle")]
+ extern "C" {}
+ } else {
+ #[link(name = "unwind", kind = "static", modifiers = "-bundle", cfg(target_feature = "crt-static"))]
+ #[link(name = "unwind", cfg(not(target_feature = "crt-static")))]
+ extern "C" {}
+ }
+}
+
#[cfg(target_os = "android")]
cfg_if::cfg_if! {
if #[cfg(feature = "llvm-libunwind")] {
diff --git a/library/unwind/src/libunwind.rs b/library/unwind/src/libunwind.rs
index eeeed3afc..f6a68073b 100644
--- a/library/unwind/src/libunwind.rs
+++ b/library/unwind/src/libunwind.rs
@@ -75,6 +75,9 @@ pub const unwinder_private_data_size: usize = 20;
#[cfg(all(target_arch = "hexagon", target_os = "linux"))]
pub const unwinder_private_data_size: usize = 35;
+#[cfg(target_arch = "loongarch64")]
+pub const unwinder_private_data_size: usize = 2;
+
#[repr(C)]
pub struct _Unwind_Exception {
pub exception_class: _Unwind_Exception_Class,