From ad48cda8fe30592b49711534f1826834ad14d24f Mon Sep 17 00:00:00 2001 From: joboet Date: Sat, 5 Nov 2022 20:16:58 +0100 Subject: [PATCH] Update RwLock definition to match the Rust one [#103150](https://github.com/rust-lang/rust/pull/103150) changes the Rust definition of RwLock, so the C definition in libunwind needs to be updated to match. --- libunwind/src/UnwindRustSgx.h | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/libunwind/src/UnwindRustSgx.h b/libunwind/src/UnwindRustSgx.h index f48243fad90258..d0cac01e1cecfa 100644 --- a/libunwind/src/UnwindRustSgx.h +++ b/libunwind/src/UnwindRustSgx.h @@ -24,22 +24,12 @@ // src/libstd/sys/sgx/rwlock.rs. // rwlock.rs has compile time check to ensure sizeof(RWLock) = 144. typedef struct { - unsigned char opaque[144]; + void * opaque; } RWLock; // The below is obtained by printing initialized bytes // for RWLock in rust repo: src/libstd/sys/sgx/rwlock.rs. -#define RWLOCK_INIT { \ - /* 0x00 */ 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ - /* 0x10 */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ - /* 0x20 */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ - /* 0x30 */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ - /* 0x40 */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ - /* 0x50 */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ - /* 0x60 */ 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ - /* 0x70 */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ - /* 0x80 */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ -} +#define RWLOCK_INIT { (void *)0 } // These are the functions exposed by SGX-Rust. // The rust changes are available at: