From: Ben.Lippmeier@anu.edu.au Date: Wed, 18 Nov 2009 04:39:01 +0000 (+0000) Subject: Windows DLLs: add #ifdefery to turn off DLL import of libffi when building statically. X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=0e7562e8783042a9a8d3e4e0220d87b0946cb816 Windows DLLs: add #ifdefery to turn off DLL import of libffi when building statically. --- diff --git a/libffi/libffi.dllize-3.0.8.patch b/libffi/libffi.dllize-3.0.8.patch index 9967180..be9705d 100644 --- a/libffi/libffi.dllize-3.0.8.patch +++ b/libffi/libffi.dllize-3.0.8.patch @@ -41,7 +41,7 @@ diff -Nur libffi-3.0.8/include/ffi.h.in dllize-3.0.8/include/ffi.h.in #define @TARGET@ #endif -+#if @LIBFFI_DLL@ ++#if @LIBFFI_DLL@ && !defined(LIBFFI_NOT_DLL) +#ifdef DLL_EXPORT +#define __FFI_DECLSPEC __declspec(__dllexport__) +#else diff --git a/rts/Interpreter.c b/rts/Interpreter.c index ea2064f..339d4d8 100644 --- a/rts/Interpreter.c +++ b/rts/Interpreter.c @@ -27,6 +27,13 @@ #include #endif +// When building the RTS in the non-dyn way on Windows, we don't +// want declspec(__dllimport__) on the front of function prototypes +// from libffi. +#if defined(mingw32_HOST_OS) && !defined(__PIC__) +# define LIBFFI_NOT_DLL +#endif + #include "ffi.h" /* --------------------------------------------------------------------------