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

Why are we linking libtsutil.a into all the core plugins? #11032

Open
ywkaras opened this issue Feb 2, 2024 · 3 comments
Open

Why are we linking libtsutil.a into all the core plugins? #11032

ywkaras opened this issue Feb 2, 2024 · 3 comments

Comments

@ywkaras
Copy link
Contributor

ywkaras commented Feb 2, 2024

target_link_libraries(${name} PRIVATE ts::tsapi ts::tsutil)

Could we create both libtsutil.a and libtsutil_link_dummy.so, both with the same contents? Link plugins against the dummy, and only liink traffic_server ELF with libtsutil.a? (libtsutil_link_dummy.so would be an installed library for use when linking non-core plugins.)

@zwoop
Copy link
Contributor

zwoop commented Feb 2, 2024

Hmmm yeh why ? This seems like it’d make each binary unnecessarily large too ? Indont know about the dummy thing but this seems bad regardless.

Why would plugins need either ? The symbols are in the core.

@ywkaras
Copy link
Contributor Author

ywkaras commented Feb 2, 2024

Hmmm yeh why ? This seems like it’d make each binary unnecessarily large too ? Indont know about the dummy thing but this seems bad regardless.

Why would plugins need either ? The symbols are in the core.

Jason may fatally face-palm if he sees this. It really is helpful to detect what will be load problems due to missing symbols at link time. If we link against the dummy .so, rather than the .a that will be linked into the core executable, the object code will not be pulled into the plugin .so.

@ywkaras ywkaras linked a pull request Feb 2, 2024 that will close this issue
@cmcfarlen
Copy link
Contributor

For detecting load problems at build-time, consider this approach instead of complicated linker gymnastics: #11008

https://github.com/apache/trafficserver/pull/11008/files#diff-d76a50ed90f4f3c3cc59631b9348502788e6b29d38f35594880f315e7e517b58R66-R76

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

Successfully merging a pull request may close this issue.

3 participants