This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] building libffi on mswin64 with msvcc.sh


Here's a patch that adds a few gotchas to the README, and just disables -WX, since it's a pain for everyone. (It'd be nice if we could tell 'cl' to error on warning D4002, "unrecognized option", but I think you can only do that for compiler warnings, not commandline warnings.)

Anthony, can you look over and apply?

Thanks,
Dan.

----- "wanabe" <s.wanabe@gmail.com> wrote:

> Hello, libffi-discuss.
> 
> I tried to build libffi on mswin64.
> To do it, I had to rewrite part of msvcc.sh to avoid some warnings.
> The patch is below.
> 
> And in configure phase, it needed --build=x86_64-pc-mingw32 and
> CC="path/to/msvcc.sh -m64".
> If README notes it, it get more easily comprehensible, I guess.
> 
> Your attention to this would be greatly appreciated.
> Sincerely.
> 
> 
> diff --git a/msvcc.sh b/msvcc.sh
> index 8301839..f6ae503 100755
> --- a/msvcc.sh
> +++ b/msvcc.sh
> @@ -44,7 +44,7 @@
> 
>  # Disable specific warnings, and enable warnings-as-errors so we
> catch any
>  # mistranslated args.
> -nowarn="-wd4127 -wd4820 -wd4706 -wd4100 -wd4255 -wd4668 -wd4053
> -wd4324"
> +nowarn="-wd4127 -wd4820 -wd4706 -wd4100 -wd4255 -wd4668 -wd4053
> -wd4324 -wd4267 -wd4305 -wd4054"
>  args="-nologo -W3 -WX $nowarn"
>  md=-MD
>  cl="cl"
> 
> -- 
> wanabe
diff --git a/js/ctypes/libffi/msvcc.sh b/js/ctypes/libffi/msvcc.sh
--- a/js/ctypes/libffi/msvcc.sh
+++ b/js/ctypes/libffi/msvcc.sh
@@ -37,20 +37,17 @@
 #
 # ***** END LICENSE BLOCK *****
 
 #
 # GCC-compatible wrapper for cl.exe and ml.exe. Arguments are given in GCC
 # format and translated into something sensible for cl or ml.
 #
 
-# Disable specific warnings, and enable warnings-as-errors so we catch any
-# mistranslated args.
-nowarn="-wd4127 -wd4820 -wd4706 -wd4100 -wd4255 -wd4668 -wd4053 -wd4324"
-args="-nologo -W3 -WX $nowarn"
+args="-nologo -W3"
 md=-MD
 cl="cl"
 ml="ml"
 output=
 
 while [ $# -gt 0 ]
 do
   case $1
diff --git a/js/ctypes/libffi/README b/js/ctypes/libffi/README
--- a/js/ctypes/libffi/README
+++ b/js/ctypes/libffi/README
@@ -108,19 +108,23 @@ Another useful configure switch is --ena
 will add some extra code which will suppress certain warnings when you
 are using Purify with libffi. Only use this switch when using 
 Purify, as it will slow down the library.
 
 It's also possible to build libffi on Windows platforms with
 Microsoft's Visual C++ compiler.  In this case, use the msvcc.sh
 wrapper script during configuration like so:
 
-path/to/configure --enable-shared --enable-static \
-	CC=path/to/msvcc.sh LD=link \
-	CPP=\"cl -nologo -EP\"
+path/to/configure CC=path/to/msvcc.sh LD=link CPP=\"cl -nologo -EP\"
+
+For 64-bit Windows builds, use CC="path/to/msvcc.sh -m64".
+You may also need to specify --build appropriately. When building with MSVC
+under a MingW environment, you may need to remove the line in configure
+that sets 'fix_srcfile_path' to a 'cygpath' command. ('cygpath' is not
+present in MingW, and is not required when using MingW-style paths.)
 
 Configure has many other options. Use "configure --help" to see them all.
 
 Once configure has finished, type "make". Note that you must be using
 GNU make.  You can ftp GNU make from prep.ai.mit.edu:/pub/gnu.
 
 To ensure that libffi is working as advertised, type "make check".
 This will require that you have DejaGNU installed.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]