diff --git a/include/compiler.h b/include/compiler.h index b46d5aac..f519877c 100644 --- a/include/compiler.h +++ b/include/compiler.h @@ -31,6 +31,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #define COMPILER_H #ifdef __GNUC__ +# define ALIGNED(x) __attribute__((aligned(x))) # define UNUSED __attribute__((unused)) # define NORETURN __attribute__((noreturn)) # define ALIAS(name) __attribute__((alias (#name))) @@ -51,6 +52,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ # define unlikely(x) (x) # endif #else +# define ALIGNED(x) # define ALWAYS_INLINE # define UNUSED # define NORETURN diff --git a/src/mi/mempool.c b/src/mi/mempool.c index 66cb0995..b04aa634 100644 --- a/src/mi/mempool.c +++ b/src/mi/mempool.c @@ -1,6 +1,7 @@ /* libunwind - a platform-independent unwind library Copyright (C) 2002-2003, 2005 Hewlett-Packard Co Contributed by David Mosberger-Tang + Copyright (C) 2012 Tommi Rantala This file is part of libunwind. @@ -38,7 +39,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ # define MAX_ALIGN MAX_ALIGN_(sizeof (long double)) #endif -static char sos_memory[SOS_MEMORY_SIZE]; +static char sos_memory[SOS_MEMORY_SIZE] ALIGNED(MAX_ALIGN); static char *sos_memp; static size_t pg_size;