summaryrefslogtreecommitdiff
path: root/lib/builtins/gcc_personality_v0.c
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2016-11-18 18:21:06 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2016-11-18 18:21:06 +0000
commitdf7592a0fa0fe4d33c515f2770b757fd2c0f7f97 (patch)
tree19cc6080b710ed8b05546dfb2922ce292073410e /lib/builtins/gcc_personality_v0.c
parent20733913866570f88b025c05aa3bcbc79df79d00 (diff)
downloadcompiler-rt-df7592a0fa0fe4d33c515f2770b757fd2c0f7f97.tar.gz
builtins: repair the builtins build with clang 3.8
When the C unwinding personality was corrected to match the ARM EHABI specification, the unwind header in clang was updated with necessary declarations. However, when building with an older compiler, we would not have the necessary declarations. This would result in a build failure. Provide a supplementary header to ensure that the necessary declarations are present for the build of the C unwinding personality. Note that this is NOT an ABI break. It merely is a compile time failure due to the constants not being present. The constants here are reproduced equivalently. This header should permit building with clang[<3.9] as well as gcc. Addresses PR31035! git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@287359 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/builtins/gcc_personality_v0.c')
-rw-r--r--lib/builtins/gcc_personality_v0.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/builtins/gcc_personality_v0.c b/lib/builtins/gcc_personality_v0.c
index 29e5be307..0bc765624 100644
--- a/lib/builtins/gcc_personality_v0.c
+++ b/lib/builtins/gcc_personality_v0.c
@@ -12,6 +12,17 @@
#include "int_lib.h"
#include <unwind.h>
+#if defined(__arm__) && !defined(__ARM_DWARF_EH__) && !defined(__USING_SJLJ_EXCEPTIONS__)
+/*
+ * When building with older compilers (e.g. clang <3.9), it is possible that we
+ * have a version of unwind.h which does not provide the EHABI declarations
+ * which are quired for the C personality to conform to the specification. In
+ * order to provide forward compatibility for such compilers, we re-declare the
+ * necessary interfaces in the helper to permit a standalone compilation of the
+ * builtins (which contains the C unwinding personality for historical reasons).
+ */
+#include "unwind-ehabi-helpers.h"
+#endif
/*
* Pointer encodings documented at: