-
Notifications
You must be signed in to change notification settings - Fork 1.1k
WIP: visibility example for cmake #1695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
The 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. |
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 |
I suspect that building the exes fails because
Yes, adding this to CI would be useful in any case. |
I don't find that convincing.
This does not indicate that a static library for |
Ok, maybe this is more convincing:
|
561934d
to
68c7b89
Compare
I see the issue. The usage requirements of the |
4777696
to
fa71348
Compare
A few things:
|
If we don't use this approach in the end, we should recycle the CMake snippets code that sets |
c82d84b build: add CMake option for disabling symbol visibility attributes (Cory Fields) ce79238 build: Add SECP256K1_NO_API_VISIBILITY_ATTRIBUTES (Tim Ruffing) e5297f6 build: Refactor visibility logic (Tim Ruffing) Pull request description: This is less invasive than #1695. The latter might be the right thing in a new library (and then we'd probably not support autotools in the first place), but any semantic change to this code has the potential to create news bug, or at least breakages for downstream users. This is different from #1677 in that it does not set `hidden` explicitly. I agree with the comment in #1677 that setting `hidden` violates the principle of least surprise. So this similar in spirit to #1674. So I wonder if this should also include 3eef736. I'd say no, `fvisibility` should then set by the user. But can you, in CMake, set `CMAKE_C_VISIBILITY_PRESET` from a parent project? ACKs for top commit: hebasto: ACK c82d84b, I have reviewed the code and it looks OK. Tree-SHA512: dad36c32a108d813e8d4e1849260af43f79a9aa8fbfb9a42b07d737e0467924a511110df0a2c6761539a1587b617a1b11123610a3db9d4cdf2b985dfb3eb21da
@purpleKarrot |
Alternative to #1674 and #1677.