Skip to content
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

Build ZLIB with fvisibility=hidden on Linux #788

Open
cyrillicw opened this issue Mar 2, 2023 · 3 comments
Open

Build ZLIB with fvisibility=hidden on Linux #788

cyrillicw opened this issue Mar 2, 2023 · 3 comments

Comments

@cyrillicw
Copy link

There is a macro ZEXPORT which as I understand should set appropriate visibility for functions that should be accessed from outside. But for Linux definition of ZEXPORT is empty so when I set fvisibility=hidden the functions become invisible

@fredgan
Copy link

fredgan commented Mar 28, 2023

You can build with your own ZEXPORT MACRO if you set fvisibility=hidden globally.
But why you set fvisibility=hidden ?

@cyrillicw
Copy link
Author

Oh, thank you, didn't think about the possibility of defining own ZEXPORT. Thank you! I use fvisibility=hidden because according to https://gcc.gnu.org/wiki/Visibility this can significantly influence the size of the executable, compilation time, etc.

@uis246
Copy link

uis246 commented Apr 7, 2024

ZEXPORT for some reason is placed in the middle of function declarations and definitions instead of at the beginning, which causes compiler to spit warnings and sometimes to ignore attribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants