From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id OAvjECEie1/uEQAA0tVLHw (envelope-from ) for ; Mon, 05 Oct 2020 13:39:45 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id MPzaDCEie18/egAAB5/wlQ (envelope-from ) for ; Mon, 05 Oct 2020 13:39:45 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id CE6ED940390 for ; Mon, 5 Oct 2020 13:39:44 +0000 (UTC) Received: from localhost ([::1]:58992 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPQiN-0005Si-Px for larch@yhetil.org; Mon, 05 Oct 2020 09:39:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50438) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPQhy-0005Q3-Jr for guix-devel@gnu.org; Mon, 05 Oct 2020 09:39:18 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58851) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPQhx-0006cb-1w; Mon, 05 Oct 2020 09:39:18 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=35296 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kPQhw-0000TM-HQ; Mon, 05 Oct 2020 09:39:16 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Greg Hogan Subject: Re: Building a library as both static and dynamic References: <5F6328DA-112E-45F9-B6F0-2132E43A6BB0@greghogan.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 14 =?utf-8?Q?Vend=C3=A9miaire?= an 229 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 05 Oct 2020 15:39:14 +0200 In-Reply-To: <5F6328DA-112E-45F9-B6F0-2132E43A6BB0@greghogan.com> (Greg Hogan's message of "Sun, 27 Sep 2020 07:57:19 -0400") Message-ID: <87blhgzta5.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel@gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Spam-Score: -1.51 X-TUID: z7z2bzyRMGqT Hi, Greg Hogan skribis: > Is there a best practice or example for building a library twice, both > static and dynamic? I submitted patch #43620, and in working on > another library have the same issue. These are cmake builds with a > parameter declaration for either a static or dynamic build, not > both. I would like to create a single package with both =E2=80=9Cout=E2= =80=9D and > =E2=80=9Cstatic=E2=80=9D outputs, which looks to be standard across Guix. Yes, a =E2=80=9Cstatic=E2=80=9D output is the preferred method if you want = to keep .a files around. > One idea is to run the configure / make / make install phases > twice. modify-phases does not currently support copying phases (though > add-after could work with the right function reference from > cmake-build) and #:configure-flags would need to be set differently. Build systems from Autoconf/Automake/Libtool and those using CMake can produce both shared libraries (position-independent code, PIC) and static libraries at once. No need to run it twice. HTH, Ludo=E2=80=99.