setting CPU_TYPE when cross-compiling from Linux to Windows

Claude Heiland-Allen claude at mathr.co.uk
Sun Dec 29 00:58:52 UTC 2019


Hi,

On 29/12/2019 00:43, Torbjörn Granlund wrote:
> Claude Heiland-Allen <claude at mathr.co.uk> writes:
>
>    Notice it uses compiler `gcc` instead of `x86_64-w64-mingw32-gcc`,
>    which leads to a build for Linux, not Windows.
>
> Well, you explicitly tell it to use "gcc" which might be why it uses
> "gcc".
This does work fine for gmp-6.1.2, so this is a regression:

```
CC_FOR_BUILD="gcc" \
CPP_FOR_BUILD="gcc -E" \
./configure \
--build=x86_64-pc-linux-gnu --host=x86_64-w64-mingw32 \
--enable-fat --prefix=$HOME/win64
```

Omitting `*_FOR_BUILD` (with gmp-6.1.2) makes the build fail with:

```
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-w64-mingw32
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for x86_64-w64-mingw32-strip... x86_64-w64-mingw32-strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking ABI=64
checking compiler x86_64-w64-mingw32-gcc -O2 -pedantic 
-fomit-frame-pointer -m64 ... yes
checking compiler x86_64-w64-mingw32-gcc -O2 -pedantic 
-fomit-frame-pointer -m64  has long long... yes
checking for x86_64-w64-mingw32-gcc... x86_64-w64-mingw32-gcc
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... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether x86_64-w64-mingw32-gcc accepts -g... yes
checking for x86_64-w64-mingw32-gcc option to accept ISO C89... none needed
checking whether x86_64-w64-mingw32-gcc understands -c and -o 
together... yes
checking for x86_64-w64-mingw32-gcc option to accept ISO C99... none needed
checking for x86_64-w64-mingw32-gcc option to accept ISO Standard C... 
(cached) none needed
checking how to run the C preprocessor... x86_64-w64-mingw32-gcc -E
checking build system compiler x86_64-w64-mingw32-gcc... yes
checking for build system preprocessor... x86_64-w64-mingw32-gcc -E
checking for build system executable suffix... configure: error: Cannot 
determine executable suffix
```

Regards,


Claude
-- 
https://mathr.co.uk



More information about the gmp-bugs mailing list