From unknown Sun Jun 15 08:40:56 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#54421 <54421@debbugs.gnu.org> To: bug#54421 <54421@debbugs.gnu.org> Subject: Status: AM_PROG_AR and LT_INIT don't work together when using lib.exe Reply-To: bug#54421 <54421@debbugs.gnu.org> Date: Sun, 15 Jun 2025 15:40:56 +0000 retitle 54421 AM_PROG_AR and LT_INIT don't work together when using lib.exe reassign 54421 automake submitter 54421 Tim Ruffing severity 54421 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 16 10:25:00 2022 Received: (at submit) by debbugs.gnu.org; 16 Mar 2022 14:25:00 +0000 Received: from localhost ([127.0.0.1]:51945 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUUaC-0006mp-Ep for submit@debbugs.gnu.org; Wed, 16 Mar 2022 10:25:00 -0400 Received: from lists.gnu.org ([209.51.188.17]:49650) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUUaB-0006mh-JG for submit@debbugs.gnu.org; Wed, 16 Mar 2022 10:25:00 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55352) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nUUaA-0007mh-Sv for bug-automake@gnu.org; Wed, 16 Mar 2022 10:24:59 -0400 Received: from mout-p-102.mailbox.org ([80.241.56.152]:43392) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1nUUa6-0006QP-Im for bug-automake@gnu.org; Wed, 16 Mar 2022 10:24:58 -0400 Received: from smtp102.mailbox.org (smtp102.mailbox.org [80.241.60.233]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4KJXbb75LQz9sbW for ; Wed, 16 Mar 2022 15:24:43 +0100 (CET) Message-ID: <4eaebcb62ae35f75b5cb3439e1552684fed81956.camel@timruffing.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=timruffing.de; s=MBO0001; t=1647440681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IYjZk7lK7nYhUQPWeZRtBUk7oRMuFbMRGVwYkjjl//A=; b=S50Fv5hwhcNVDFvoc0LJGwv8dv68PlZHARwv59J1H3Eqg72C8LIAwPE0Bl/PM4AKfTpi9N Ed4bZxoL1BsOjh1+T3ZP3yhhN+b+ShqQRZn44+wymYAtYGcYhYJKxgX+mLgeA7zDrNqM2P IcUK5een/Tfbb4s3otzxs+fUv8XjyCV9nfX2rSHnm1f24taOf3VWlmt7TG6TyEHhENy4EU yF4dbbvwdcKPs3RWozb1uq84XYejo5DRv5lWfDclI02ydeoR/7KPvZiPBRJiE6OQEJiPOf 1JyI8cRd9+9dTv3X5DUPCgh6nIT28+7XHPRLuf+9G5HbaJ3CYzdi7LAqmZR+eA== Subject: AM_PROG_AR and LT_INIT don't work together when using lib.exe From: Tim Ruffing To: bug-automake@gnu.org Date: Wed, 16 Mar 2022 15:24:37 +0100 Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=80.241.56.152; envelope-from=crypto@timruffing.de; helo=mout-p-102.mailbox.org X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.7 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.7 (--) Hello :) Assume environment variable AR="lib.exe" and configure.ac has ``` AM_PROG_AR LT_INIT ``` Then AM_PROG_AR checks for an archiver using AC_CHECK_TOOLS. Then it detects the lib.exe interface and prefixes the AR variable with a call to ar-lib. (There's a FIXME in the code that says that overwriting is wrong). But so far so good, this works. Now LT_INIT will again look for an archiver using AC_CHECK_TOOLS (in subroutine _LT_PROG_AR). The check will discover that ac_cv_prog_AR has "lib.exe" (unprefixed!) and overwrites AR with it. So AR is correct (with ar-lib prefix) after AM_PROG_AR but LT_INIT overwrites with the unprefixed value again, causing the build the fail. I wonder why noone has reported this so far. I tend to think that lib.exe support is only really useful in combination with libtool but this then triggers the bug. Possible workarounds include: * Calling AM_PROG_AR after LT_INIT. But this will raise a warning in autoreconf telling me that I should call AM_PROG_AR before LT_INIT. * Clearing the cache value. This is what I've done for now in our project [1]. Note that here I'm careful and clear two cache variables but in in the end it's enough to clear ac_cv_prog_AR. The aforementioned FIXME mentions introducing am_AR as a cleaner way. This sounds like it fix the problem but maybe I'm overlooking something. A crude hack is to overwrite not only AR but also ac_cv_prog_AR. Best, Tim [1] https://github.com/bitcoin-core/secp256k1/pull/1084/commits/e6b8a1ca47c07b798cf45ea85e257546c4dbafc4 From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 13 00:52:57 2023 Received: (at 54421) by debbugs.gnu.org; 13 Jan 2023 05:52:57 +0000 Received: from localhost ([127.0.0.1]:49189 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pGCzm-0000Y9-ER for submit@debbugs.gnu.org; Fri, 13 Jan 2023 00:52:57 -0500 Received: from woodpecker.gentoo.org ([140.211.166.183]:39886 helo=smtp.gentoo.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pGCzk-0000Xu-VP for 54421@debbugs.gnu.org; Fri, 13 Jan 2023 00:52:53 -0500 Received: by smtp.gentoo.org (Postfix, from userid 559) id 52350340AEC; Fri, 13 Jan 2023 05:52:47 +0000 (UTC) From: Mike Frysinger To: Tim Ruffing Subject: Re: AM_PROG_AR and LT_INIT don't work together when using lib.exe User-Agent: GNU debbugs/0 Message-Id: <20230113055247.52350340AEC@smtp.gentoo.org> Date: Fri, 13 Jan 2023 05:52:47 +0000 (UTC) X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54421 Cc: 54421@debbugs.gnu.org, bug-automake@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) On Wed, 16 Mar 2022 15:24:37 +0100, Tim Ruffing wrote: > Assume environment variable AR="lib.exe" and configure.ac has > > ``` > AM_PROG_AR > LT_INIT > ``` i think the expectation is that, if you're using libtool, then you use libtool. it can create static convenience libraries too: https://www.gnu.org/software/libtool/manual/html_node/Static-libraries.html -mike From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 13 07:52:30 2023 Received: (at 54421) by debbugs.gnu.org; 13 Jan 2023 12:52:30 +0000 Received: from localhost ([127.0.0.1]:49818 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pGJXq-0004aJ-Hw for submit@debbugs.gnu.org; Fri, 13 Jan 2023 07:52:30 -0500 Received: from mout-p-101.mailbox.org ([80.241.56.151]:38410) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pGJXo-0004a4-FL for 54421@debbugs.gnu.org; Fri, 13 Jan 2023 07:52:29 -0500 Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4NthC41t6wz9sjT; Fri, 13 Jan 2023 13:52:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=timruffing.de; s=MBO0001; t=1673614336; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UU8jBoQnV8q+/ASzYbODbf2sXB5ngNf68/8N+eW7688=; b=LwLJYK2GgVMS2O4wMxEG+Aa9YWcu4Oz3tO9ut5OjKvBNA8wn8KLVEL/aqJgSN0fztqOFet 7xRcmmCTZ8mhdwtXmrpQsbS9k31gw+TBM5bcDrP/9uv+tNo6tKu7RtETyAYUc4SIFqjkew Isj98I+iDml3HXyJyvRtvgVXk264pu6oBJHOf0z17nU5fQngPdclZsEDJInh3F4hPEvsLD 46FVWfxjBEB4m/GFIdsTIBsam2Kd6lL2e/aOTWKAp3bpxszgoJ+6N/CjVQro4QpR1dm6sm xofzewXrXbHQ+HZx074RmHQYVPCsshj4C2Keeehp0jbYaeOpgTPqmcIpGzsEpA== Message-ID: <3c0ec4e782e44f356eaf4a254ac026791b1c0ee6.camel@timruffing.de> Subject: Re: AM_PROG_AR and LT_INIT don't work together when using lib.exe From: Tim Ruffing To: Mike Frysinger Date: Fri, 13 Jan 2023 13:52:14 +0100 In-Reply-To: <20230113055247.52350340AEC@smtp.gentoo.org> References: <20230113055247.52350340AEC@smtp.gentoo.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 54421 Cc: 54421@debbugs.gnu.org, bug-automake@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On Fri, 2023-01-13 at 05:52 +0000, Mike Frysinger wrote: > i think the expectation is that, if you're using libtool, then you > use libtool.=C2=A0=20 Well, I *use* libtool. libtool needs some AR. I choose to use libtool.exe with the ar-lib wrapper.=20 From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 14 00:04:00 2023 Received: (at 54421) by debbugs.gnu.org; 14 Jan 2023 05:04:00 +0000 Received: from localhost ([127.0.0.1]:52998 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pGYhz-0001eq-S2 for submit@debbugs.gnu.org; Sat, 14 Jan 2023 00:04:00 -0500 Received: from woodpecker.gentoo.org ([140.211.166.183]:41186 helo=smtp.gentoo.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pGYhy-0001eK-Oh for 54421@debbugs.gnu.org; Sat, 14 Jan 2023 00:03:59 -0500 Received: by smtp.gentoo.org (Postfix, from userid 559) id 51C09340E1A; Sat, 14 Jan 2023 05:03:53 +0000 (UTC) Date: Sat, 14 Jan 2023 00:03:51 -0500 From: Mike Frysinger To: Tim Ruffing Subject: Re: AM_PROG_AR and LT_INIT don't work together when using lib.exe Message-ID: References: <20230113055247.52350340AEC@smtp.gentoo.org> <3c0ec4e782e44f356eaf4a254ac026791b1c0ee6.camel@timruffing.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="4T+gakbabrxX5rW6" Content-Disposition: inline In-Reply-To: <3c0ec4e782e44f356eaf4a254ac026791b1c0ee6.camel@timruffing.de> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54421 Cc: 54421@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --4T+gakbabrxX5rW6 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 13 Jan 2023 13:52, Tim Ruffing wrote: > On Fri, 2023-01-13 at 05:52 +0000, Mike Frysinger wrote: > > i think the expectation is that, if you're using libtool, then you > > use libtool.=C2=A0=20 >=20 > Well, I *use* libtool. libtool needs some AR. I choose to use > libtool.exe with the ar-lib wrapper.=20 you wondered why no one has reported/noticed hits before. i gave you an explanation. what you're doing is unusual, and so far, i haven't seen an explanation as to why you're doing something unusual. so the (implicit) question still stands: why are you using Automake's archive (ar-lib) logic when libtool already provides support for doing the same thing -- creating static archives. should we fix it ? probably. is it worth the effort ? maybe not. would we accept patches from someone who wants to spend the time ? depends on the patch. -mike --4T+gakbabrxX5rW6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEuQK1JxMl+JKsJRrUQWM7n+g39YEFAmPCN7cACgkQQWM7n+g3 9YEEuA//S5greNphnJmMwm62w8tVoDSi0rfkooJ91OwmDfQKecwDkmLW58R7hQR4 9wsDzwPEWknFDrkqo4VHnlZM+2qYr3JMUHHw4vhurzplQd9+LHqn+6kYYkhA+Fdy elqOt2M6WvoKrRUDrrKrULQ8W0oXzcn9v9ES2nM+r2CA+6IOwY2keJMRJaRPyUfE cjVeRtsJwZPyRdS9LJ3MQsxAvrUyPHBmz2jVqN6uEo90MdeRsF52jHU2KdPGWrfP 71dOd0oTC3wKAzqXhBUOt2sxrY3G5MFWEWJw13PTFLPHczVo6gn8iOUFfkuVhmGy +yNIEytslYvtRdxStBo4F/hys2Xwnh8AFeye5Lr8uSLfnmLBwVfDAOaxiC4DYlth xtJwj+GdpaTDx9KSILDs+t2tm6PpUBfGxDnkmUtVGJfi4y1h31lh/QswnsR9Wl6a n7KlNmFveHkcmTv7IBs0tW/6/IRWU2yMj+pnSoGjsp6aIDa9EHs9gmg6cHYhBNcr SKKSUv0dtXPd6gg9Pwkf+uqKwqmjOwWDhU2GJio+fOGLBFptITtljeeTtmvvgRyH PIqq/c458jF87fTGKdOkVsj3woGW/gLg9dQM/WS070S3aS7zaLy58ZF9r0XjzgXT BJ8GGYLd36M+LpQVP/iveUYOjAR5Dp+oDVpNQKMFeRAujfayvfw= =T+ca -----END PGP SIGNATURE----- --4T+gakbabrxX5rW6--