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

merge #2501 #2894

Merged
merged 4 commits into from
Dec 2, 2021
Merged

merge #2501 #2894

merged 4 commits into from
Dec 2, 2021

Conversation

Cyan4973
Copy link
Contributor

@Cyan4973 Cyan4973 commented Dec 2, 2021

Merge #2051 by @skitt after rebasing it.

The PR makes it possible to selectively disable static symbols from the list of exposed symbols in the dynamic library.
Static symbols remain exposed by libzstd by default, as it's the historical policy.

skitt and others added 4 commits May 14, 2021 19:41
Even with -fvisibility=hidden added to CFLAGS, any symbol which is
given a default visibility attribute ends up exported in the dynamic
library. This happens through zstd_internal.h which defines
..._STATIC_LINKING_ONLY before including various header files, and is
included for example in lib/common/pool.c.

To avoid this, this patch distinguishes static and non-static APIs, by
using ZSTDLIB_API only for the latter, and introducing
ZSTDLIB_STATIC_API for the former. For now, both are exported, but
non-static APIs can be hidden by overriding the definition
ZSTDLIB_STATIC_API. lib/Makefile is modified to allow this using

	make CPPFLAGS_DYNLIB=-DZSTDLIB_STATIC_API=ZSTDLIB_HIDDEN

In addition, API declarations are dropped from zstd_compress.c (they
aren't needed there).

Signed-off-by: Stephen Kitt <[email protected]>
now included from libzstd.mk
@Cyan4973 Cyan4973 merged commit 550410d into dev Dec 2, 2021
@Cyan4973 Cyan4973 deleted the tomerge2051 branch December 9, 2021 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants