summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Golin <renato.golin@linaro.org>2017-10-31 12:21:32 +0000
committerRenato Golin <renato.golin@linaro.org>2017-10-31 12:21:32 +0000
commitc7fc688bf6636fe5ae31f89ec31951d444a9035d (patch)
tree0d8218131809615db74fc41362cb406445c6334b
parent42478613cd3542e14d88f4e199be151f21bf52c3 (diff)
Merge r311574: ARM: explicitly specify the 8-byte alignmentupstream/llvmorg-5.0.1-rc1llvmorg-5.0.1-rc1
Fixing the last libunwind failure on ARM. llvm-svn: 316991
-rw-r--r--libunwind/include/unwind.h2
-rw-r--r--libunwind/test/alignment.pass.cpp12
2 files changed, 11 insertions, 3 deletions
diff --git a/libunwind/include/unwind.h b/libunwind/include/unwind.h
index fc7d122ab12c..58dc3d95e8c7 100644
--- a/libunwind/include/unwind.h
+++ b/libunwind/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/libunwind/test/alignment.pass.cpp b/libunwind/test/alignment.pass.cpp
index 5ab55842621b..1a3ca5a92304 100644
--- a/libunwind/test/alignment.pass.cpp
+++ b/libunwind/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()
{