Remove Dependencies to Allow the Zstd Binary to Dynamically Link to the Library#2977
Merged
felixhandte merged 2 commits intofacebook:devfrom Jan 7, 2022
Merged
Remove Dependencies to Allow the Zstd Binary to Dynamically Link to the Library#2977felixhandte merged 2 commits intofacebook:devfrom
felixhandte merged 2 commits intofacebook:devfrom
Conversation
xxHash symbols are present in `libzstd.so`, but they are local and therefore unavailable outside the lib. There are two possible solutions to the problem. We could make those symbols global, or we could remove the dependency. This commit chooses the latter approach. I suppose this comes at the cost of code size / build time. I'm open to comments on whether this is a good thing to do, especially since this will apply even when we are statically linking everything.
Contributor
|
I'm not sure if this is a worthwhile goal either, |
Cyan4973
approved these changes
Jan 6, 2022
terrelln
approved these changes
Jan 7, 2022
Contributor
|
Sorry, I didn't notice this PR before (GitHub doesn't email you when someone links a PR that may close your subscribed ticket). The general topic of dynamic linking I raised in #2976 and I also suggested a potential solution -- which does however require somewhat more long-term consideration and possible source code restructuring, but shouldn't have an effect on code size or build time. As far as fixing the meson setup goes, the program was already linking to both the shared library and directly to the xxhash built .o file. The unused include fix was probably enough to get that working. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR avoids dependencies on symbols that are not exported in the dynamic library.
I believe this works. However, I'm not sure that (a) this is really a worthwhile goal and (b) that this is a good solution for that goal. Your feedback is welcome.
This PR resolves #2950.