WIP: visibility example for cmake #1695
pull purpleKarrot wants to merge 1 commits into bitcoin-core:master from purpleKarrot:visibility changing 3 files +36 −69-
purpleKarrot commented at 5:08 pm on June 30, 2025: contributor
-
purpleKarrot force-pushed on Jun 30, 2025
-
purpleKarrot commented at 5:34 pm on June 30, 2025: contributorThe fact that a build called “Windows (VS 2022, static)” is failing with the message “unresolved external symbol __imp_…” is concerning. The fact that private symbols cannot be resolved indicates that visibility is working correctly and that the library is not static. Unfortunately, the compiler command line is not visible on github, so this needs further investigation.
-
real-or-random commented at 6:22 am on July 1, 2025: contributor
The fact that private symbols cannot be resolved indicates (…) that the library is not static.
I don’t think so. It builds a “.lib” file: https://github.com/bitcoin-core/secp256k1/actions/runs/15979380201/job/45069998808?pr=1695#step:4:57
See also https://github.com/bitcoin-core/secp256k1/actions/runs/15965328923/job/45024576152#step:5:36, which shows that no “.dll” is created on master. (We should run
file
also on “*.lib” files…) -
real-or-random commented at 6:49 am on July 1, 2025: contributor
I suspect that building the exes fails because
SECP256K1_STATIC
is not actually set for some reason.Unfortunately, the compiler command line is not visible on github, so this needs further investigation.
Yes, adding this to CI would be useful in any case.
-
purpleKarrot commented at 8:33 am on July 1, 2025: contributor
The fact that private symbols cannot be resolved indicates (…) that the library is not static.
I don’t think so. It builds a “.lib” file: https://github.com/bitcoin-core/secp256k1/actions/runs/15979380201/job/45069998808?pr=1695#step:4:57
I don’t find that convincing.
0Creating library D:/a/secp256k1/secp256k1/build/lib/RelWithDebInfo/noverify_tests.lib and object D:/a/secp256k1/secp256k1/build/lib/RelWithDebInfo/noverify_tests.exp 1 noverify_tests.vcxproj -> D:\a\secp256k1\secp256k1\build\bin\RelWithDebInfo\noverify_tests.exe 2 secp256k1.vcxproj -> D:\a\secp256k1\secp256k1\build\lib\RelWithDebInfo\libsecp256k1.lib
This does not indicate that a static library for
libsecp256k1
is created, it just means thatnoverify_tests
links againstlibsecp256k1.lib
, which could be a static library or an import library for an associated.dll
. Both of these have the same file extension. -
real-or-random commented at 8:49 am on July 1, 2025: contributor
Ok, maybe this is more convincing:
- This output line from the “shared” job on master mentions the dll explicitly: https://github.com/bitcoin-core/secp256k1/actions/runs/15965328923/job/45024576149#step:4:53
- (Same for the “shared” job in this PR: https://github.com/bitcoin-core/secp256k1/actions/runs/15979380201/job/45069998798?pr=1695#step:4:56)
- But the corresponding output line from the “static” job doesn’t mention the dll: https://github.com/bitcoin-core/secp256k1/actions/runs/15979380201/job/45069998808?pr=1695#step:4:57
-
purpleKarrot force-pushed on Jul 1, 2025
-
purpleKarrot force-pushed on Jul 1, 2025
-
purpleKarrot commented at 10:26 am on July 1, 2025: contributorI see the issue. The usage requirements of the
secp256k1
target are not applied, because benchmarks and tests don’t actually build against that target. They build againstsecp256k1_precomputed
andsecp256k1_asm
instead. -
purpleKarrot force-pushed on Jul 1, 2025
-
purpleKarrot force-pushed on Jul 1, 2025
-
WIP: visibility example for cmake aa8c67f148
-
purpleKarrot force-pushed on Jul 1, 2025
-
theuni commented at 2:07 pm on July 1, 2025: contributor
A few things:
- As discussed in the other PRs, it’s clear that this would be much simpler if we only supported CMake, but that’s unfortunately not the reality at the moment. The majority of the cruft in the header exists to support the combination of buildsystems.
- Could you please split this into refactor vs behavioral change commits for easier review? There’s a lot going on here and the some of the rationale isn’t obvious at first glimpse.
-
real-or-random commented at 10:31 am on July 2, 2025: contributorIf we don’t use this approach in the end, we should recycle the CMake snippets code that sets
SECP256K1_STATIC
for the parent when consuming the library. -
real-or-random added the label feature on Jul 2, 2025
-
real-or-random added the label build on Jul 2, 2025
This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-07-03 12:15 UTC
More mirrored repositories can be found on mirror.b10c.me