[patch] Dead-strip binaries by default on OS X and posix (was: Reduce size of clang-format by 87% on OS X)
joerg at britannica.bec.de
Thu Jan 2 10:30:47 PST 2014
On Thu, Jan 02, 2014 at 10:02:10AM -0800, Nico Weber wrote:
> On Thu, Jan 2, 2014 at 6:45 AM, Joerg Sonnenberger
> <joerg at britannica.bec.de>wrote:
> > On Fri, Dec 27, 2013 at 02:04:10PM -0800, Eric Christopher wrote:
> > > On Fri, Dec 27, 2013 at 2:01 PM, Joerg Sonnenberger
> > > <joerg at britannica.bec.de> wrote:
> > > > On Fri, Dec 27, 2013 at 11:12:40AM -0800, Nico Weber wrote:
> > > >> Something like the attached patch? (Make-only again, but now
> > including the
> > > >> linux bits. If folks like it, I can do the cmake part as a followup.)
> > > >
> > > > Does it get applied for shared libraries? I don't think it makes sense
> > > > in that situation.
> > > >
> > >
> > > These have export lists etc.
> > I mean: building the shared library code with -ffunction-section
> > -fdata-section is just going to blow up the object files at best and
> > make the linker slower. It's not really about exporting symbols.
> Much of the code (llvm core libs, clang core libs) is shared by many of the
> tools (libclang, clang, clang-format, opt, etc). Since most of the tools
> want stripping, the shared code needs to be built with these flags (or be
> compiled twice for the different libs). Do you have measurements showing
> that linking got slower for the targets you care about?
I don't understand your argument. If you build a shared library,
everything from the corresponding static archive is included. There is
no stripping for the individual tool involved.
More information about the cfe-commits