Skip to content

libffi configure script does not detect MSYS2 Windows 10 x86_64

When building GHC 7.10 RC 1 on Windows 10 Technical Preview, 64 bit, in MSYS2, libffi fails with the message that it cannot determine the build system, and that config.guess and config.sub may need to be updated.

The latest versions do indeed work. Unfortunately the scripts are stored in the libffi.tar file, if we don't want to change the file we'll need some way to get the correct versions in place.

I have a very hacky workaround that downloads the latest versions after unpacking the tar, which is obviously not how it should be solved, but might help some people get their RC1 to build before we have a proper fix:

diff --git a/libffi/ghc.mk b/libffi/ghc.mk
index ec37f0c..fbd2e5e 100644
--- a/libffi/ghc.mk
+++ b/libffi/ghc.mk
@@ -89,6 +89,9 @@ $(libffi_STAMP_CONFIGURE): $(TOUCH_DEP)
 	cd libffi && \
 	    $(LIBFFI_PATH_MANGLE) \
 	    cd build && \
+            autoreconf -f && \
+            wget -O config.guess "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD" && \
+            wget -O config.sub "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD" && \
 	    CC=$(CC_STAGE1) \
 	    CXX=$(CC_STAGE1) \
 	    LD=$(LD) \
Trac metadata
Trac field Value
Version 7.10.1-rc1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information