From owner-freebsd-doc@FreeBSD.ORG Fri May 23 16:20:02 2014 Return-Path: Delivered-To: freebsd-doc@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E3C8F5C5 for ; Fri, 23 May 2014 16:20:01 +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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0A652D55 for ; Fri, 23 May 2014 16:20:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s4NGK1aY010531 for ; Fri, 23 May 2014 16:20:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s4NGK1Vc010530; Fri, 23 May 2014 16:20:01 GMT (envelope-from gnats) Resent-Date: Fri, 23 May 2014 16:20:01 GMT Resent-Message-Id: <201405231620.s4NGK1Vc010530@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-doc@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Natacha Porté 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 B03C85B1 for ; Fri, 23 May 2014 16:18:53 +0000 (UTC) Received: from cgiserv.freebsd.org (cgiserv.freebsd.org [IPv6:2001:1900:2254:206a::50:4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84E942D4A for ; Fri, 23 May 2014 16:18:53 +0000 (UTC) Received: from cgiserv.freebsd.org ([127.0.1.6]) by cgiserv.freebsd.org (8.14.8/8.14.8) with ESMTP id s4NGIoWZ008896 for ; Fri, 23 May 2014 16:18:50 GMT (envelope-from nobody@cgiserv.freebsd.org) Received: (from nobody@localhost) by cgiserv.freebsd.org (8.14.8/8.14.8/Submit) id s4NGIoCU008893; Fri, 23 May 2014 16:18:50 GMT (envelope-from nobody) Message-Id: <201405231618.s4NGIoCU008893@cgiserv.freebsd.org> Date: Fri, 23 May 2014 16:18:50 GMT From: Natacha Porté To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: docs/190146: [patch] make explicit how to install static libraries X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 16:20:02 -0000 >Number: 190146 >Category: docs >Synopsis: [patch] make explicit how to install static libraries >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-doc >State: open >Quarter: >Keywords: >Date-Required: >Class: doc-bug >Submitter-Id: current-users >Arrival-Date: Fri May 23 16:20:00 UTC 2014 >Closed-Date: >Last-Modified: >Originator: Natacha Porté >Release: 9.2-RELEASE >Organization: >Environment: FreeBSD yulai 9.2-RELEASE FreeBSD 9.2-RELEASE #0 r255898: Thu Sep 26 22:50:31 UTC 2013 root@bake.isc.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64 >Description: A lot of ports are currently using $(INSTALL_LIB) macro to install static libraries (*.a files), presumably because the name hints at installing any kind of library. However stripping breaks static libraries, since they are only an archives of object files not yet linked. I detailed my analysis in PR ports/188993, which was the first port I encountered with the problem. I later discovered that there are a lot of them affected. I guess the problem does not manifests often, since static linking is seldom used. Currently, the porter's handbook doesn't say anything about static libraries. The attached patch adds a specific note about them, and distinguish them from shared libraries. >How-To-Repeat: Run grep -r 'INSTALL_LIB.*\.a' /usr/ports and see the amount of matches >Fix: Hopefully patching the documentation will help porters install static libraries correctly in the future. Patch attached with submission follows: Index: en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml =================================================================== --- en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml (revision 44916) +++ en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml (working copy) @@ -4362,7 +4362,8 @@ INSTALL_LIB is a command to - install shared libraries. + install shared libraries (but not static + libraries). @@ -4375,7 +4376,7 @@ INSTALL_DATA is a command to - install sharable data. + install sharable data, including static libraries. @@ -4387,6 +4388,13 @@ These are basically the install command with all the appropriate flags. + + + Do not use INSTALL_LIB to install + static libraries (*.a), because + stripping them render them useless. Use + INSTALL_DATA instead. + >Release-Note: >Audit-Trail: >Unformatted: