From 894434988d96f3246e0525000f281563c1febb73 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 24 Dec 2020 13:31:41 -0700 Subject: [PATCH] libunwind: fix compile errors and warnings for 32-bit arm --- lib/libunwind/src/gcc_personality_v0.c | 10 ---------- src/libunwind.zig | 5 +++++ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/lib/libunwind/src/gcc_personality_v0.c b/lib/libunwind/src/gcc_personality_v0.c index 36e83efd65449f539f13d4cf511d56a0e5d18fca..c946497d75e01634991516b6453278d25ee20cb8 100644 --- a/lib/libunwind/src/gcc_personality_v0.c +++ b/lib/libunwind/src/gcc_personality_v0.c @@ -19,16 +19,6 @@ #define compilerrt_abort() __builtin_unreachable() #include -#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 diff --git a/src/libunwind.zig b/src/libunwind.zig index b5b11f59dca3eade6741ae4c231e07dc7b7913cb..057663a44b9c11c62c8ffba584b3ce364b25c66e 100644 --- a/src/libunwind.zig +++ b/src/libunwind.zig @@ -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}), -- 2.54.0