[PATCH] Remove -export-dynamic from sanitizer link lines

Richard Smith richard at metafoo.co.uk
Fri Mar 15 18:35:31 PDT 2013


Hi,

When linking a sanitizer runtime, we add -export-dynamic to the link lines.
This can *dramatically* increase binary sizes (I've seen a 25% increase in
some cases), and seems to be largely unnecessary -- the sanitizer symbols
should be exported anyway if the linker is told about any DSOs which need
the runtime and will be linked against the binary.

However, this will presumably break any mostly-static binaries which don't
link against any sanitizer-using DSOs, but do dlopen such DSOs. If we care
about that, I think the right way to handle it would be to add a file
containing a list of exported sanitizer symbols to compiler-rt, and pass
that file to the linker with --dynamic-list when linking in a sanitizer.

What do you think? Is this patch OK as-is, or do you want the more complete
solution?

Thanks!
Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130315/db4f5a3e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: no-export-dynamic.diff
Type: application/octet-stream
Size: 1882 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130315/db4f5a3e/attachment.obj>


More information about the cfe-commits mailing list