Defend against -fstack-protector in libc startup.
Exactly which functions get a stack protector is up to the compiler, so
let's separate the code that sets up the environment stack protection
requires and explicitly build it with -fno-stack-protector.
Bug: http://b/26276517
Change-Id: I8719e23ead1f1e81715c32c1335da868f68369b5
diff --git a/libc/bionic/pthread_internal.h b/libc/bionic/pthread_internal.h
index f96e9d2..e8be4ae 100644
--- a/libc/bionic/pthread_internal.h
+++ b/libc/bionic/pthread_internal.h
@@ -40,7 +40,8 @@
/* Has the thread been joined by another thread? */
#define PTHREAD_ATTR_FLAG_JOINED 0x00000002
-struct pthread_key_data_t {
+class pthread_key_data_t {
+ public:
uintptr_t seq; // Use uintptr_t just for alignment, as we use pointer below.
void* data;
};
@@ -52,11 +53,12 @@
THREAD_DETACHED
};
-struct thread_local_dtor;
+class thread_local_dtor;
-struct pthread_internal_t {
- struct pthread_internal_t* next;
- struct pthread_internal_t* prev;
+class pthread_internal_t {
+ public:
+ class pthread_internal_t* next;
+ class pthread_internal_t* prev;
pid_t tid;