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

Don't statically link libtsutil.a into core plugins. #11034

Closed
wants to merge 1 commit into from

Conversation

ywkaras
Copy link
Contributor

@ywkaras ywkaras commented Feb 2, 2024

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.

@ywkaras ywkaras self-assigned this Feb 2, 2024
@ywkaras ywkaras added the Build label Feb 2, 2024
@ywkaras ywkaras added this to the 10.0.0 milestone Feb 2, 2024
@ywkaras ywkaras linked an issue Feb 2, 2024 that may be closed by this pull request
@ywkaras ywkaras marked this pull request as draft February 3, 2024 02:16
Also, two equivalent libraries are now created, libtsutil.a and
libtsutil_link_dummy.so, with the same code and symbol content.  External
plugins can be linked with libtsutil_link_dummy.so  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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Why are we linking libtsutil.a into all the core plugins?
2 participants