Don't statically link libtsutil.a into core plugins. #11034
Closed
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.
Two equivalent libraries are now created, libtsutil.a and libtsutil_link_dummy.so, with the same code and symbol content. Non-core plugins can be linked with libtsutil_link_dummy.so, with the --no-undefined ld option. The drawback is, for dlopen() to successfully load the plugin, it will require the presence of libtsutil_link_dummy.so. But, the symbols in libtsutil_link_dummy.so don't seem to be used, because they are satisfied by symbols from core TS. I tested this (on Red Hat 8) by substituting a random .so for libtsutil_link_dummy.so, before successfully loading the xdebug.so plugin.
I checked for an option in ld to resolve symbols for the link in a .so, without creating a dependency on it. But I could not find any such option.