Fixes #1421. See code comments for rationale.
Related meta-bug: #1181. This reminds me that we should move forward with #1359.
The most recent comment on the upstream GCC issue is not 100% clear to me.
Can you elaborate on which part is unclear?
In any case, I could rephrase this such that it says it’s a GCC bug. When I wrote it, I wasn’t sure yet, but the upstream response seems to confirm that this is a bug.
Fixes #1421.
146@@ -147,6 +147,15 @@ typedef int (*secp256k1_nonce_function)(
147 * 1. If using Libtool, it defines DLL_EXPORT automatically.
148 * 2. In other cases, SECP256K1_DLL_EXPORT must be defined. */
149 # define SECP256K1_API extern __declspec (dllexport)
150+# else
151+ /* Building libsecp256k1 as a static library on Windows.
tests
and noverify_tests
targets using CMake, where object files are linked directly.
You mean https://github.com/bitcoin-core/secp256k1/blob/master/src/CMakeLists.txt#L89, right? True, and it’s also true for bench_internal
and bench_ecmult
.
Would you prefer “Building libsecp256k1 not as a DLL.”? (I also dropped the Windows part because it’s anyway only Windows in the outer #ifdef.)
You mean https://github.com/bitcoin-core/secp256k1/blob/master/src/CMakeLists.txt#L89, right? True, and it’s also true for
bench_internal
andbench_ecmult
.Would you prefer “Building libsecp256k1 not as a DLL.”? (I also dropped the Windows part because it’s anyway only Windows in the outer #ifdef.)
Looks good. However, I’m not sure if it worth invalidating all ACKs.
Looks good. However, I’m not sure if it worth invalidating all ACKs.
Ok, let’s just get it merged.
ACK 447334cb06de229024161021cc79b3af32ce8b5c, tested on Ubuntu 24.04 using the following commands:
0$ env CFLAGS="-flto" cmake -B build --preset dev-mode --toolchain cmake/x86_64-w64-mingw32.toolchain.cmake
1$ cmake --build build -j 16 -t tests noverify_tests
real-or-random
fanquake
hebasto
theuni
Labels
build