diff --git a/libunwind/src/UnwindRustSgx.h b/libunwind/src/UnwindRustSgx.h index 087b078cd0b78a..fad3c358408e72 100644 --- a/libunwind/src/UnwindRustSgx.h +++ b/libunwind/src/UnwindRustSgx.h @@ -21,29 +21,15 @@ #include // We have to use RWLock from rust repo, it is defined in: -// src/libstd/sys/sgx/rwlock.rs. -// rwlock.rs has compile time check to ensure sizeof(RWLock) = 128. +// src/libstd/sys/sgx/unwind.rs. +// unwind.rs has compile time check to ensure sizeof(RWLock) = 16. typedef struct { - unsigned char opaque[128]; -} RWLock; + unsigned char opaque[16]; +} __attribute__ ((aligned (8))) RWLock; // The below is obtained by printing initialized bytes -// for RWLock in rust repo: src/libstd/sys/sgx/rwlock.rs. +// for RWLock in rust repo: src/libstd/sys/sgx/unwind.rs. #define RWLOCK_INIT { \ - 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ - 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ - 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ - 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \ } diff --git a/libunwind/src/UnwindRustSgxSnprintf.c b/libunwind/src/UnwindRustSgxSnprintf.c index a3246b02e2c29f..8394f213f66cf0 100644 --- a/libunwind/src/UnwindRustSgxSnprintf.c +++ b/libunwind/src/UnwindRustSgxSnprintf.c @@ -10,7 +10,9 @@ #pragma GCC diagnostic ignored "-Wfloat-conversion" #pragma GCC diagnostic ignored "-Wsign-conversion" #pragma GCC diagnostic ignored "-Wstrict-overflow" +#if __GNUC__ >= 7 #pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#endif /************************************************************** * Original: