[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#662998: debian-policy: stripping static libraries



Jakub Wilk <jwilk@debian.org> writes:

> As far as I can tell, the Policy currently doesn't require stripping
> static libraries[0]. The de facto standard is to strip them with
> --strip-debug, because this what dh_strip does[1].

> Can we make stripping static libraries a Policy “should”?

> [0] The only reference I could find was footnote to §10.2: “You might also
> want to use […] ‘--strip-debug’ on static libraries.” This is a bit odd
> though, because the footnote applies to a paragraph which talks only about
> stripping shared libraries.

> [1] More specifically, dh_strip calls “strip --with-debug” on all files
> matching “lib*.a”, except those ending with “_g.a”.

This seems like a good idea to me.  Here is proposed text.

diff --git a/policy.sgml b/policy.sgml
index 4fd60d9..eb79db6 100644
--- a/policy.sgml
+++ b/policy.sgml
@@ -7783,9 +7783,12 @@ strip --strip-unneeded <var>your-lib</var>
 	      You might also want to use the options
 	      <tt>--remove-section=.comment</tt> and
 	      <tt>--remove-section=.note</tt> on both shared libraries
-	      and executables, and <tt>--strip-debug</tt> on static
-	      libraries.
+	      and executables.
 	  </footnote>
+	  All installed static libraries should be stripped with
+	  <example compact="compact">
+strip --strip-debug <var>your-lib</var>
+	  </example>
 	</p>
 
 	<p>

Does Lintian already check for unstripped static libraries?

Separately, I'd love it if someone would tackle writing a new section on
how to properly generate and package detached debugging symbols for
executables and shared libraries and propose that wording as a new Policy
bug.

-- 
Russ Allbery (rra@debian.org)               <http://www.eyrie.org/~eagle/>



Reply to: