From 69feb122e1a9eddc5e98e892042bfceeb9b8a547 Mon Sep 17 00:00:00 2001 From: Jethro Beekman Date: Thu, 4 Apr 2019 11:04:45 -0700 Subject: [PATCH 1/2] Fix compilation with gcc version < 7 --- libunwind/src/UnwindRustSgxSnprintf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libunwind/src/UnwindRustSgxSnprintf.c b/libunwind/src/UnwindRustSgxSnprintf.c index a3246b02e2c29..8394f213f66cf 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: From 19e66904a9b99159c7f1ff30bda26ba14d41ef08 Mon Sep 17 00:00:00 2001 From: Jethro Beekman Date: Mon, 3 Feb 2020 20:11:31 +0100 Subject: [PATCH 2/2] Actually fix RWLock representation for UnsafeCell niche fix --- libunwind/src/UnwindRustSgx.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libunwind/src/UnwindRustSgx.h b/libunwind/src/UnwindRustSgx.h index f965cebf4bb34..f48243fad9025 100644 --- a/libunwind/src/UnwindRustSgx.h +++ b/libunwind/src/UnwindRustSgx.h @@ -22,9 +22,9 @@ // 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. +// rwlock.rs has compile time check to ensure sizeof(RWLock) = 144. typedef struct { - unsigned char opaque[128]; + unsigned char opaque[144]; } RWLock; // The below is obtained by printing initialized bytes