-
Notifications
You must be signed in to change notification settings - Fork 173
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
Static builds and exported symbols #376
Comments
So you'd like |
It makes two differences:
|
zachlewis
added a commit
to zachlewis/libdeflate
that referenced
this issue
Nov 15, 2024
This PR implements @pictview's suggestion from ebiggers#376 to hide symbols when building a static library.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think there is no need to export all symbols when building a static lib with clang. Hence I suggest to change the following
#elif defined(_GNUC_)
# define LIBDEFLATE_EXPORT_SYM _attribute_((visibility("default")))
#else
# define LIBDEFLATE_EXPORT_SYM
#endif
to something like
#elif defined(_GNUC_) || defined(_clang_)
# if defined(LIBDEFLATE_DLL)
# define LIBDEFLATE_EXPORT_SYM _attribute_((visibility("default")))
# else
# define LIBDEFLATE_EXPORT_SYM _attribute_((visibility("hidden")))
# endif
#else
# define LIBDEFLATE_EXPORT_SYM
#endif
maybe then LIBDEFLATE_DLL should be renamed to something like LIBDEFLATE_SHARED.
The text was updated successfully, but these errors were encountered: