Skip to content
This repository was archived by the owner on Nov 6, 2022. It is now read-only.

Commit a50a70f

Browse files
authored
Merge pull request #6 from fortanix/update-rwlock-init
Update RWLOCK_INIT with new parking_lot based value
2 parents 53b5863 + 6e0a83a commit a50a70f

File tree

2 files changed

+7
-19
lines changed

2 files changed

+7
-19
lines changed

libunwind/src/UnwindRustSgx.h

+5-19
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,15 @@
2121
#include <stdint.h>
2222

2323
// We have to use RWLock from rust repo, it is defined in:
24-
// src/libstd/sys/sgx/rwlock.rs.
25-
// rwlock.rs has compile time check to ensure sizeof(RWLock) = 128.
24+
// src/libstd/sys/sgx/unwind.rs.
25+
// unwind.rs has compile time check to ensure sizeof(RWLock) = 16.
2626
typedef struct {
27-
unsigned char opaque[128];
28-
} RWLock;
27+
unsigned char opaque[16];
28+
} __attribute__ ((aligned (8))) RWLock;
2929

3030
// The below is obtained by printing initialized bytes
31-
// for RWLock in rust repo: src/libstd/sys/sgx/rwlock.rs.
31+
// for RWLock in rust repo: src/libstd/sys/sgx/unwind.rs.
3232
#define RWLOCK_INIT { \
33-
0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
34-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
35-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
36-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
37-
0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
38-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
39-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
40-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
41-
0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
42-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
43-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
44-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
45-
0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
46-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
4733
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
4834
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
4935
}

libunwind/src/UnwindRustSgxSnprintf.c

+2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
#pragma GCC diagnostic ignored "-Wfloat-conversion"
1111
#pragma GCC diagnostic ignored "-Wsign-conversion"
1212
#pragma GCC diagnostic ignored "-Wstrict-overflow"
13+
#if __GNUC__ >= 7
1314
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
15+
#endif
1416

1517
/**************************************************************
1618
* Original:

0 commit comments

Comments
 (0)