Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Feb 2014 02:28:51 +0100
From:      Rusmir Dusko <nemysis@FreeBSD.org>
To:        freebsd-doc@FreeBSD.org
Cc:        nemysis@FreeBSD.org
Subject:   [PATCH] Stripping Binaries and Shared Libraries
Message-ID:  <20140203012851.GA88519@nemysis4now>

next in thread | raw e-mail | index | archive | help

--k+w/mQv8wyuph6w0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

I have personal documentation and wish to share parts that may be beneficial to other users.

Here I have changed so that the user can see how to patch for striping executables on more than one file.

Porter's Handbook

5.15.2. Stripping Binaries and Shared Libraries

-- 
Best regards,
Rusmir Dusko

--k+w/mQv8wyuph6w0
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="book.xml.diff"

Index: en_US.ISO8859-1/books/porters-handbook/book.xml
===================================================================
--- en_US.ISO8859-1/books/porters-handbook/book.xml	(revision 43727)
+++ en_US.ISO8859-1/books/porters-handbook/book.xml	(working copy)
@@ -5135,12 +5135,22 @@
 	  <varname>INSTALL_LIB</varname> macros,
 	  <varname>${STRIP_CMD}</varname> will strip your program or
 	  shared library.  This is typically done within the
-	  <buildtarget>post-install</buildtarget> target.  For
-	  example:</para>
+	  <buildtarget>post-install</buildtarget> target.</para>
 
+	<para>If you need to strip one file,
+	 for example this executable:</para>
+
 	<programlisting>post-install:
-	  ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/xdl</programlisting>
+	  ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}</programlisting>
 
+	<para>If you need to strip more than one file,
+	 for example these shared libraries:</para>
+
+	<programlisting>post-install:
+	 .for l in geometry media body track world
+	 ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libvamos-${l}.so.0
+	 .endfor</programlisting>
+
 	<para>Use the &man.file.1; command on the installed executable
 	  to check whether the binary is stripped or not.  If it does
 	  not say <literal>not stripped</literal>, it is stripped.

--k+w/mQv8wyuph6w0--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140203012851.GA88519>