aboutsummaryrefslogtreecommitdiff
path: root/contrib/compiler-rt/lib/builtins
diff options
context:
space:
mode:
authorConrad Meyer <cem@FreeBSD.org>2019-11-05 03:20:40 +0000
committerConrad Meyer <cem@FreeBSD.org>2019-11-05 03:20:40 +0000
commitc8b5e3de39bcfa6833d4ab2980b0dddd30edbb74 (patch)
treecb9c33df28d5affbc288afb10e65645d2b64cb2c /contrib/compiler-rt/lib/builtins
parent6d180b1360b19930587764af836c009419cc3365 (diff)
Fix llvm-libunwind userspace build on ARM
GCC's libgcc exports a few ARM-specific symbols for ARM EABI, AEABI, or EHABI or whatever it's called. Export the same ones from LLVM-libunwind's libgcc_s, on ARM. As part of this, convert libgcc_s from a direct Version.map to one constructed from component Symbol.map files. This allows the ARM-specific Symbol.map to be included only on ARM. Fix ARM-only oddities in struct name/aliases in LLVM-libunwind to match non-ARM definitions and ARM-specific expectations in libcxxrt / libcompiler_rt. No functional change intended for non-ARM architectures. This commit does not actually flip the switch for ARM defaults from libgcc to llvm-libunwind, but makes it possible (to compile, anyway).
Notes
Notes: svn path=/head/; revision=354347
Diffstat (limited to 'contrib/compiler-rt/lib/builtins')
-rw-r--r--contrib/compiler-rt/lib/builtins/gcc_personality_v0.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/contrib/compiler-rt/lib/builtins/gcc_personality_v0.c b/contrib/compiler-rt/lib/builtins/gcc_personality_v0.c
index d12ee03c49fe..b986bd56943e 100644
--- a/contrib/compiler-rt/lib/builtins/gcc_personality_v0.c
+++ b/contrib/compiler-rt/lib/builtins/gcc_personality_v0.c
@@ -9,8 +9,23 @@
#include "int_lib.h"
#include <unwind.h>
+/*
+ * XXX On FreeBSD, this file is compiled into three libraries:
+ * - libcompiler_rt
+ * - libgcc_eh
+ * - libgcc_s
+ *
+ * In the former, the include path points to the contrib/libcxxrt/unwind-arm.h
+ * copy of unwind.h. In the latter, the include path points to the
+ * contrib/libunwind/include/unwind.h header (LLVM libunwind).
+ *
+ * Neither (seemingly redundant) variant of unwind.h needs the redefinitions
+ * provided in the "helpful" header below, and libcxxrt's unwind-arm.h provides
+ * *no* useful distinguishing macros, so just forcibly disable the helper
+ * header on FreeBSD.
+ */
#if defined(__arm__) && !defined(__ARM_DWARF_EH__) && \
- !defined(__USING_SJLJ_EXCEPTIONS__)
+ !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__FreeBSD__)
// 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