-
Notifications
You must be signed in to change notification settings - Fork 1.7k
AVRO-4221: [C++] Allow using symbol visibility annotations also on non-Windows platforms #3600
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: main
Are you sure you want to change the base?
Conversation
|
The only thing I still need to verify that the tests actually work when compiling under Windows with MSYS2, in these logs you can see that |
0d9e09c to
52938d0
Compare
Sure, I'll do it then. |
martin-g
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Seems like there are still some issues, e.g.:
For inlines, there are warning of similar nature:
I'm not quite sure what the solution is here. Probably just dropping the inline attribute as it doesn't do anything anyway. |
|
Created apache/iceberg-cpp#421 to verify this PR. |
|
It seems like I'm running into another visibility related issue. The I write However, when a program using my dynamic library constructs a I have no ideas on how to solve this problem, unless I remove the hidden visibility configuration. |
Hm, I don't think I can help with this one. |
52938d0 to
059b3c0
Compare
…latforms In GCC and clang the symbol visibility behavior of MSVC can be mirror using `-fvisibility=hidden`. This allows to more easily test that symbol visbility annotations work correctly and can potentially lead to smaller binaries. The default behavior on non-Windows platforms is not changed with this commit. See also https://gcc.gnu.org/wiki/Visibility Also fixes a tiny mistake where the _WIN32 macro was used to silence a MSVC warning where the _MSC_VER macro should have been used instead.
059b3c0 to
5f93cdd
Compare
|
I updated this with the latest test from mesonbuild/wrapdb#2270, with this one it links on all platforms and tests run also fine. |
What is the purpose of the change
In GCC and clang the symbol visibility behavior of MSVC can be mirror using
-fvisibility=hidden. This allows to more easily test that symbol visbility annotations work correctly and can potentially lead to smaller binaries. The default behavior on non-Windows platforms is not changed with this commit.See also https://gcc.gnu.org/wiki/Visibility
Also fixes a tiny mistake where the _WIN32 macro was used to silence a MSVC warning where the _MSC_VER macro should have been used instead.
This also needs to be backported to 1.12.1, see mesonbuild/wrapdb#2270
Verifying this change
This change is a trivial rework / code cleanup without any test coverage.
This change added tests and can be verified as follows:
Documentation