ghc-cabal should pass target, build, host, prefix parameters to "configure" script.
output-log.txtI was trying to bootstrap the current gitlab ghc code using ghc.8.6.4, and I encountered an issue building libraries for the bootstrap.
The issue is that ghc-cabal.exe does NOT pass build, host, target, or prefix to the configure script. The command I used to bootstrap was:
./configure \
--prefix=/mingw64 \
--build=x86_64-w64-mingw32 \
--host=x86_64-w64-mingw32 \
--target=x86_64-w64-mingw32 \
--enable-distro-toolchain=on \
--enable-tarballs-autodownload=on \
--with-system-libffi \
--with-intree-gmp \
--with-ffi-includes="$(cygpath -u $(pkg-config --variable=includedir libffi))"
I did verify that MSYSTEM=MINGW64
was set for the script I used. But when I try to compile in the stage1 bootstrap, I noticed that some settings were not correct in my build log. This could be related to https://github.com/haskell/cabal/issues/5887 but I'm not completely sure. I suspect that this stuff could be effecting other parts of the build. I also think that for building, the target, host, and build parameters as well as prefix need to be passed to libraries such as libffi and gmp. I am attaching the complete log from my guild in case I missed something.
"inplace/bin/ghc-cabal.exe" check libraries/integer-gmp
"inplace/bin/ghc-cabal.exe" configure libraries/integer-gmp dist-install --with-ghc="D:/msys64/home/jpmugaas/mingw-w64-ghc-git/src/x86_64/ghc-8.6.4/inplace/bin/ghc-stage1.exe" --with-ghc-pkg="D:/msys64/home/jpmugaas/mingw-w64-ghc-git/src/x86_64/ghc-8.6.4/inplace/bin/ghc-pkg.exe" --configure-option=--with-intree-gmp --configure-option=--with-intree-gmp --disable-library-for-ghci --enable-library-vanilla --enable-library-for-ghci --enable-library-profiling --disable-shared --with-hscolour="/home/jpmugaas/mingw-w64-ghc-git/src/x86_64/ghc-8.6.4/bin/HsColour" --configure-option=CFLAGS="-Wall -Wno-error=inline" --configure-option=LDFLAGS=" " --configure-option=CPPFLAGS=" " --gcc-options="-Wall -Wno-error=inline " --configure-option=--with-intree-gmp --with-gcc="/mingw64/bin/gcc" --with-ld="ld" --with-ar="D:/msys64/home/jpmugaas/mingw-w64-ghc-git/src/x86_64/ghc-8.6.4/mingw/bin/ar.exe" --with-alex="/home/jpmugaas/mingw-w64-ghc-git/src/x86_64/ghc-8.6.4/bin/alex" --with-happy="/home/jpmugaas/mingw-w64-ghc-git/src/x86_64/ghc-8.6.4/bin/happy"
Configuring integer-gmp-1.0.2.0...
configure: WARNING: unrecognized options: --with-compiler
configure: loading site script D:/msys64/etc/config.site
checking build system type... x86_64-pc-msys
checking host system type... x86_64-pc-msys
checking target system type... x86_64-pc-msys
checking for gcc... D:\msys64\mingw64\bin\gcc.exe
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether D:\msys64\mingw64\bin\gcc.exe accepts -g... yes
checking for D:\msys64\mingw64\bin\gcc.exe option to accept ISO C89... none needed
checking how to run the C preprocessor... D:\msys64\mingw64\bin\gcc.exe -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether to use in-tree GMP... yes
checking GMP version... 5.0.4
configure: creating ./config.status
config.status: creating integer-gmp.buildinfo
config.status: creating config.mk
config.status: creating include/HsIntegerGmp.h
configure: WARNING: unrecognized options: --with-compiler