Have you tries cross-compiling in Linux to windows? That could solve the old mingw version issues, let you use a newer gcc and perhaps allow to add SHA support
I have tried cross-compiling, but the build configurations you have, need some changes and I'm yet to have success figuring it out, due to lack of experience. Although cross-compiling openssl was pretty simple
edit:
after some playing around, i have managed to cross-compile, but, unfortunately, executions fails with "workio thread dead, exiting" message
any suggestions on where to dig?
How do you cross-compile? Isn't that what mingw does? How did you make it portable?
That last question may be why the workio thread is dying, possibly a pthread issue. To run on Windows it needs to link to
pthreadGC2 instead of pthread. I have run in to this problem trying to compile on cygwin. I have discovered that I had
set up a "cygwin" compile environment instead of a "mingw" compile environment. The mingw toolchain includes pthreadGC2.
in short what i did, on ubuntu 17.04
install mingw-w64 package
download latest sources for openssl, curl and gmp
1. openssl
./Configure mingw64 shared --cross-compile-prefix=x86_64-w64-mingw32-
make
2. curl
./configure --with-winssl --with-winidn --host=x86_64-w64-mingw32
make
3. gmp
./configure --host=x86_64-w64-mingw32 #can also be compiled as shared lib instead of static
make
4. cpuminer
ln -s ../gmp-6.1.2/gmp.h #can probably be specified as lib path, but it was the simplest way to do that
export LDFLAGS="-L/home/ffwd/build/curl-7.56.1/lib/.libs -L/home/ffwd/build/gmp-6.1.2/.libs -L/home/ffwd/build/openssl-1.1.0f"
CFLAGS="-O3 -march=core-avx2 -Wall" CXXFLAGS="$CFLAGS -std=gnu++11 -fpermissive" ./configure --with-curl=../curl-7.56.1 --with-crypto=../openssl-1.1.0f --host=x86_64-w64-mingw32
make
now, the dlls are spread over the system, so i used a highly scientific method of running the .exe file and copying the dlls that it was complaining about.
this is the list of dlls that were missing:
from compiled openssl:
libcrypto-1_1-x64.dll
from compiled curl:
libcurl-4.dll
from /usr/x86_64-w64-mingw32/lib
libwinpthread-1.dll
zlib1.dll
from /usr/lib/gcc/x86_64-w64-mingw32/6.2-win32
libgcc_s_seh-1.dll
libstdc++-6.dll
i have tried all of the -march options you have in winbuild-allarch.sh, and it also compiles with -march=znver1 , bringing sha support to windows (if you can find the source of workio thread issue)
hope you can take it from here and make it work