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

Allow building LD_PRELOAD-able tcmalloc shared library #16

Closed
wants to merge 1 commit into from
Closed

Allow building LD_PRELOAD-able tcmalloc shared library #16

wants to merge 1 commit into from

Conversation

vsrinivas
Copy link

Certain workloads may wish to use this release of tcmalloc but may
not be easy to rebuild linked against this library. Add a build
target for libtcmalloc.so, which can be LD_PRELOAD-ed.

Certain workloads may wish to use this release of tcmalloc but may
not be easy to rebuild linked against this library. Add a build
target for libtcmalloc.so, which can be LD_PRELOAD-ed.
@ckennelly
Copy link
Collaborator

Modifying the BUILD file to no longer have the linkstatic=1 attribute should produce a libtcmalloc.so.

Since I think this PR pulls in all of TCMalloc's dependencies (including Abseil), this could trigger ODR issues for programs that use Abseil and LD_PRELOAD the produced .so.

@vsrinivas
Copy link
Author

Going to hold off on the pull request now - it served a simple need I had (LD_PRELOAD-able tcmalloc for use with gn / ninja), but it has fairly tricky ODR concerns as a general solution; we want any libtcmalloc.so target to not 'bake in abseil' for the reason Chris mentioned. And short of having abseil produce an .so, I can't find a clear solution.

@jaidayal
Copy link

I commented out linkstatic = 1 in all the BUILD files, but it still never built a libtcmalloc.so.

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 this pull request may close these issues.

None yet

3 participants