[PATCH] D33601: libunwind: fix building on mingw-w64

Saleem Abdulrasool via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 31 21:17:24 PDT 2017


compnerd requested changes to this revision.
compnerd added a comment.
This revision now requires changes to proceed.

Im not sure that this is a reasonable patch.  I think that specializing a AddressSpace for `_WIN32` is more likely what we want.  Furthermore, this actually should be more restrictive, since the unwind library cannot be used for Windows -- the unwinding model on Windows is completely different.  This only makes sense for MinGW and cygwin, and so we should ensure that the environment matches that.



================
Comment at: src/AddressSpace.hpp:293
         return false;
-#if __LP64__
+#if defined(__LP64__) || defined(_WIN64)
       const struct mach_header_64 *mh = (const struct mach_header_64 *)dlinfo.dli_fbase;
----------------
Huh?  This doesn't make sense.  `mach_header_64` on `_WIN64`?  Plus, how does `dladdr` work here?


================
Comment at: src/config.h:54
 
-// FIXME: these macros are not correct for COFF targets
+#ifdef _WIN32
+#define _LIBUNWIND_EXPORT
----------------
Please use `defined`.


================
Comment at: src/config.h:55
+#ifdef _WIN32
+#define _LIBUNWIND_EXPORT
+#define _LIBUNWIND_HIDDEN
----------------
EricWF wrote:
> Shouldn't this be change to be a DLL import/export?
This should be using `__declspec(dllexport)` and ` `.


Repository:
  rL LLVM

https://reviews.llvm.org/D33601





More information about the llvm-commits mailing list