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
https://github.com/bitcoin-core/secp256k1/pull/1674/commits/3eef7362c45e5d4c0d4b06ec4d9af30be8642e5d. 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?