Time to stop stripping binaries?

Bruce Evans brde at optusnet.com.au
Fri Jun 18 10:24:45 UTC 2010


On Thu, 17 Jun 2010, M. Warner Losh wrote:

> Now that disks are big, can we stop stripping binaries by default?

Symbols aren't very useful unless they are full debugging symbols, but
with full debugging symbols the unstripped binaries would be _very_ large.

With only non-debugging symbols, the symbols' size in most shared
executables is small since most symbols are in libraries.  However,
all libraries may need to be compiled with full symbols irrespective
of the default policy for stripping installed binaries, so that you
can debug [non-installed] binaries.

> I've worked up a patch that lets you set WITH_BINARY_SYMBOLS or
> WITHOUT_BINARY_SYMBOLS as you see fit.  We should commit it regardless
> of the outcome of this discussion (well, defaulting to yes or no
> depending on the outcome).

> Index: bsd.lib.mk
> ===================================================================
> --- bsd.lib.mk	(revision 209268)
> +++ bsd.lib.mk	(working copy)
> @@ -46,7 +46,7 @@
> .endif
> .endif
>
> -.if !defined(DEBUG_FLAGS)
> +.if !defined(DEBUG_FLAGS) || ${MK_BINARY_SYMBOLS} == "no"
> STRIP?=	-s
> .endif
>

The case of full debugging symbols is already handled here.  I believe
some committers (not bde) actually use it.  Similarly in bsd.prog.mk.

So is the case of not stripping installed binaries (STRIP=).

I don't want the bloat from building and/or installing libraries with
full symbols, but miss an easy way to build them when needed (maybe on
demand -- libc now takes only a few seconds to compile).  If you fix
this, don't forget the case of libraries in ports bloatware that takes
more than a few seconds to compile :-).

Bruce


More information about the freebsd-arch mailing list