From owner-freebsd-doc@FreeBSD.ORG Mon Feb 3 01:28:54 2014 Return-Path: Delivered-To: freebsd-doc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 18790878; Mon, 3 Feb 2014 01:28:54 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0394F19EB; Mon, 3 Feb 2014 01:28:54 +0000 (UTC) Received: from nemysis4now (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with SMTP id s131Sppf074713; Mon, 3 Feb 2014 01:28:52 GMT (envelope-from nemysis@FreeBSD.org) Received: by nemysis4now (sSMTP sendmail emulation); Mon, 03 Feb 2014 02:28:51 +0100 Date: Mon, 3 Feb 2014 02:28:51 +0100 From: Rusmir Dusko To: freebsd-doc@FreeBSD.org Subject: [PATCH] Stripping Binaries and Shared Libraries Message-ID: <20140203012851.GA88519@nemysis4now> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="k+w/mQv8wyuph6w0" Content-Disposition: inline User-Agent: Mutt/1.5.22 (2013-10-16) Cc: nemysis@FreeBSD.org X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 01:28:54 -0000 --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 @@ INSTALL_LIB macros, ${STRIP_CMD} will strip your program or shared library. This is typically done within the - post-install target. For - example: + post-install target. + If you need to strip one file, + for example this executable: + post-install: - ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/xdl + ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${PORTNAME} + If you need to strip more than one file, + for example these shared libraries: + + post-install: + .for l in geometry media body track world + ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libvamos-${l}.so.0 + .endfor + Use the &man.file.1; command on the installed executable to check whether the binary is stripped or not. If it does not say not stripped, it is stripped. --k+w/mQv8wyuph6w0--