Commit 894434988d

Andrew Kelley <andrew@ziglang.org>
2020-12-24 21:31:41
libunwind: fix compile errors and warnings for 32-bit arm
1 parent ed26b32
Changed files (2)
lib
libunwind
src
lib/libunwind/src/gcc_personality_v0.c
@@ -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
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}),