configure: Add a few CFLAGS for MSVC
- https://github.com/bitcoin-core/secp256k1/pull/1084/changes/09f3d71c51a9621653d766e2fe7e657534e57bd6
- partial https://github.com/bitcoin-core/secp256k1/pull/1209/changes/9a5a611a21fcdf7bf2dab30964cd0208d8cdf444
- partial https://github.com/bitcoin-core/secp256k1/pull/1275/changes/dc0657c7622f5a13afc3876eca7e2fc7cabb9a10
- secp256k1#1328
I used a recent upstream commit for the related CMake changes: 471e3a130d4e0961d087c25a8daae83c846b675f (jan 14, 2026), with some adjustments:
- no try_append_cflags function, because we don't pretend to support all compilers since gcc 2.0
- instead, separate flags that work for both gcc+clang, then gcc specific flags, then clang specific flags. This seems to be good enough to avoid any warning with recent compilers. Only -Wreserved-identifier might produce a warning with clang 10, 11 and 12 (introduced in 13.0)
configure: Convince autotools to work with MSVC's archiver lib.exe
https://github.com/bitcoin-core/secp256k1/pull/1084/changes/2be6ba0fedd0d2d62ba6f346d7ced7abde0d66e4
bench: Make benchmarks compile on MSVC
https://github.com/bitcoin-core/secp256k1/pull/1084/changes/1a6be5745fcf9f90e4218b73712b71ea06361792
schnorrsig bench: Suppress a stupid warning in MSVC
https://github.com/bitcoin-core/secp256k1/pull/1084/changes/bd81f4140a4228b1df3a9f631e2d207a197ae614
ci: Add MSVC builds
This adds MSVC builds built on Linux using wine. This requires some
settings of tools and flags because the autotools support for MSVC is
naturally somewhat limited.
The advantage of this approach is that it is compatible with our
existing CI scripts, so there's no need to write a Windows CI script
(in PowerShell or similar). If we want to test building and running on
Windows native (e.g., as supported by Cirrus CI) we could still do this
in the future.
Another advantage of this approach is that contributors can simply use
the docker image if they need a MSVC installation in a non-Windows
environment.
This commit also improves the Dockerfile by grouping RUN commands
according to Docker docs:
https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#run
https://github.com/bitcoin-core/secp256k1/pull/1084/changes/9efc2e5221560d19dd750e0ba32c03d4ee091227
Ci: Run persistent wineserver to speed up wine
https://github.com/bitcoin-core/secp256k1/pull/1084/changes/51f296a46c0b318b8dd572ef9ac3bb3a4140ae63
This concludes backport of secp256k1#1084 and core#secp256k1#1328