diff options
author | Renato Golin <renato.golin@linaro.org> | 2017-10-31 12:21:32 +0000 |
---|---|---|
committer | Renato Golin <renato.golin@linaro.org> | 2017-10-31 12:21:32 +0000 |
commit | 29d162446817bbd4847f6e291f4eb36252ae3173 (patch) | |
tree | 6b0e94b46d121c39595cb2d28b79ac8fa4b38bf4 | |
parent | 5fd891f9376b779f3e7e7d371afcc55dd4ef568d (diff) |
Merge r311574: ARM: explicitly specify the 8-byte alignmentrelease_50
Fixing the last libunwind failure on ARM.
git-svn-id: https://llvm.org/svn/llvm-project/libunwind/branches/release_50@316991 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/unwind.h | 2 | ||||
-rw-r--r-- | test/alignment.pass.cpp | 12 |
2 files changed, 11 insertions, 3 deletions
diff --git a/include/unwind.h b/include/unwind.h index fc7d122..58dc3d9 100644 --- a/include/unwind.h +++ b/include/unwind.h @@ -100,7 +100,7 @@ struct _Unwind_Control_Block { } pr_cache; long long int :0; /* Enforce the 8-byte alignment */ -}; +} __attribute__((__aligned__(8))); typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn) (_Unwind_State state, diff --git a/test/alignment.pass.cpp b/test/alignment.pass.cpp index 5ab5584..1a3ca5a 100644 --- a/test/alignment.pass.cpp +++ b/test/alignment.pass.cpp @@ -13,8 +13,16 @@ #include <unwind.h> -struct MaxAligned {} __attribute__((aligned)); -static_assert(alignof(_Unwind_Exception) == alignof(MaxAligned), ""); +// EHABI : 8-byte aligned +// itanium: largest supported alignment for the system +#if defined(_LIBUNWIND_ARM_EHABI) +static_assert(alignof(_Unwind_Control_Block) == 8, + "_Unwind_Control_Block must be double-word aligned"); +#else +struct MaxAligned {} __attribute__((__aligned__)); +static_assert(alignof(_Unwind_Exception) == alignof(MaxAligned), + "_Unwind_Exception must be maximally aligned"); +#endif int main() { |