libunwind: fix compile errors and warnings for 32-bit arm

This commit is contained in:
Andrew Kelley
2020-12-24 13:31:41 -07:00
parent ed26b3204a
commit 894434988d
2 changed files with 5 additions and 10 deletions

View File

@@ -19,16 +19,6 @@
#define compilerrt_abort() __builtin_unreachable()
#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:
// http://refspecs.freestandards.org/LSB_1.3.0/gLSB/gLSB/ehframehdr.html

View File

@@ -81,7 +81,12 @@ pub fn buildStaticLib(comp: *Compilation) !void {
if (comp.bin_file.options.single_threaded) {
try cflags.append("-D_LIBUNWIND_HAS_NO_THREADS");
}
if (target.cpu.arch.isARM() and target.abi.floatAbi() == .hard) {
try cflags.append("-DCOMPILER_RT_ARMHF_TARGET");
}
try cflags.append("-Wno-bitwise-conditional-parentheses");
try cflags.append("-Wno-visibility");
try cflags.append("-Wno-incompatible-pointer-types");
c_source_files[i] = .{
.src_path = try comp.zig_lib_directory.join(arena, &[_][]const u8{unwind_src}),