setting CPU_TYPE when cross-compiling from Linux to Windows

Claude Heiland-Allen claude at
Sat Dec 28 22:18:42 UTC 2019


I use Linux.  I have a program (that uses GMP via MPFR) that I 
cross-compile for Windows and run in Wine.

I would like to test the new zen-specific optimizations on my AMD Ryzen 
7 2700X CPU, but I can't seem to get it to work:

hg clone
cd gmp
GMP_CPU_TYPE="zen" \
CC_FOR_BUILD="gcc" \
CPP_FOR_BUILD="gcc -E" \
CFLAGS="-march=native -O3 -fomit-frame-pointer" \
CXXFLAGS="-march=native -O3 -fomit-frame-pointer" \
LDFLAGS="-static-libgcc -static-libstdc++" \
./configure --build=x86_64-pc-linux-gnu --host=x86_64-w64-mingw32 \
config.status: linking mpn/x86_64/k8/gmp-mparam.h to gmp-mparam.h
config.status: executing libtool commands
configure: summary of build options:

   Version:           GNU MP 6.1.99
   Host type:         x86_64-w64-mingw32
   ABI:               64
   Install prefix:    /home/claude/winNATIVE
   Compiler:          x86_64-w64-mingw32-gcc
   Static libraries:  yes
   Shared libraries:  no

configure: If wine64 is installed, use make check TESTS_ENVIRONMENT=wine64.

Notice that it is linking `x86_64/k8` instead of `x86_64/zen`.

Compiling natively on Linux with `GMP_CPU_TYPE=zen` works fine (and some 
test programs are faster), but unfortunately my main program is 
Windows-only.  I do not have Microsoft Windows to test a native build there.

How can I do this?


More information about the gmp-bugs mailing list