From eb8b122d67db501729ecde4fcb960336c87af4ce Mon Sep 17 00:00:00 2001 From: Christopher Ferris <cferris@google.com> Date: Mon, 16 Mar 2015 16:21:08 -0700 Subject: [PATCH] Add alignment to opaque types. If there is no alignment forced, then the compiler might put these structures at any alignment. Change-Id: I6416db72433504e0ec1178bfae6f5b18b6e363fb --- libc/include/pthread.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libc/include/pthread.h b/libc/include/pthread.h index b0389e84d..38282adb1 100644 --- a/libc/include/pthread.h +++ b/libc/include/pthread.h @@ -78,7 +78,7 @@ typedef struct { #else char __private[4]; #endif -} pthread_cond_t; +} pthread_cond_t __attribute__((aligned(8))); #define PTHREAD_COND_INITIALIZER { { 0 } } @@ -93,7 +93,7 @@ typedef struct { #else char __private[40]; #endif -} pthread_rwlock_t; +} pthread_rwlock_t __attribute__((aligned(8))); #define PTHREAD_RWLOCK_INITIALIZER { { 0 } }