From unknown Sat Jun 14 00:05:59 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#78411 <78411@debbugs.gnu.org> To: bug#78411 <78411@debbugs.gnu.org> Subject: Status: LDADD vs. LDFLAGS Reply-To: bug#78411 <78411@debbugs.gnu.org> Date: Sat, 14 Jun 2025 07:05:59 +0000 retitle 78411 LDADD vs. LDFLAGS reassign 78411 automake submitter 78411 Bruno Haible severity 78411 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Tue May 13 12:59:44 2025 Received: (at submit) by debbugs.gnu.org; 13 May 2025 16:59:44 +0000 Received: from localhost ([127.0.0.1]:32938 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uEsyl-0002zL-SJ for submit@debbugs.gnu.org; Tue, 13 May 2025 12:59:44 -0400 Received: from lists.gnu.org ([2001:470:142::17]:55870) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uEsyi-0002yx-QO for submit@debbugs.gnu.org; Tue, 13 May 2025 12:59:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uEsyT-0001nz-7W for bug-automake@gnu.org; Tue, 13 May 2025 12:59:26 -0400 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.217]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uEsyQ-0007NI-Vn for bug-automake@gnu.org; Tue, 13 May 2025 12:59:24 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1747155560; cv=none; d=strato.com; s=strato-dkim-0002; b=CmnpTefEjgxni7O9WKQ7oMkyxLezBWUL7jlsu2mO9ZU1jiALyGbW38XVM4z8icLuwS aPRW6KCsrqDFM8f2diScPTMI+/r2b2IJbp2Twi3klbBHbjOIeKkfiRBBXflvvjH7a5Gj CBYPBZrtBidXgWnkXubGos7G1ZvZrYJt97wzNq1qlhb6nfkExgJm+JBHuk0X4M7wf+Z6 QCg4kcUcROu0GEeiAVc1He0FG6Uywrm94zn0dbvINnCSszmezHhkiDD18DeRN6onvSk9 vc6rLoenx0G7/UaIpi4sVWpGT9sNtgd5tS0hBQiikoA8ijOpVjfQKVhAXReOMuFUJbTp 3y9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1747155560; s=strato-dkim-0002; d=strato.com; h=Message-ID:Date:Subject:To:From:Cc:Date:From:Subject:Sender; bh=v63Sh64nw9PMuJm8e4VvojhqRBuikwOvOv81JxLuBCs=; b=qSq++rLoLhykLh5ojXJ6GmqbEgs1elsP1x9cTa2bqZGCEYudxFYB9fx3xRIV6Phiwx l3tFPHUoqtlRaO/kJGQu3hPwu2r+fM9VJnduP0sNwPANMpUb6lj2GFljmwu/U4ui+IJD 60s50Y/Mswz25rXubYSgNvYHTloTCw9XIi2aQhOwVWngTaDA0mwOeD2UY4URY2+iiZbj 4/sNBNxgGakKrGiRvUu+rghwjkae3me4HIKV3I6bhWYzwS1eYsWbROxrjn6mmNqD+gcK 6r37eGzOLAJWdeapWFP5KkextJIkRsrWIGyfYj1M1mdXmDQZv2ldjtSrfFaUrhZLSjg8 KH4w== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1747155560; s=strato-dkim-0002; d=clisp.org; h=Message-ID:Date:Subject:To:From:Cc:Date:From:Subject:Sender; bh=v63Sh64nw9PMuJm8e4VvojhqRBuikwOvOv81JxLuBCs=; b=EWVm3oOgBl0SfDRVs7GwZITuH0TLBJgnysn9qUPPP49OaktY91YWlx3UXZVPaHGIzO pFjNgFyC782RG/UV5aBpYaY3smPnSIdFlHykWGLXylKWeDxzqPhk9LzoChjfWDyGWiY7 GAylZo+SMCJg7k6hiHufyKPYaFJBTwiGtuEsJzWUtR+GlP3qUgPY/iq88klR0gRKeC/I ikv9gsRkpLjTgK3imncRMwsjmhyU9kjdjSfaSuVRebDQBww0WWMY1yRWmD+RQHXiVASc RfOBAW45NU8W1CMjLbKQ1ziL8PXdYppP1r3w+3qZAPHz7j7IeQYe7jpqbT7AOmSBa7zb v2yw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1747155560; s=strato-dkim-0003; d=clisp.org; h=Message-ID:Date:Subject:To:From:Cc:Date:From:Subject:Sender; bh=v63Sh64nw9PMuJm8e4VvojhqRBuikwOvOv81JxLuBCs=; b=Sq/wpT/4GyfMzU1qn0HCJb5V6fFfPGRo7L4f9+H4J2+w063YnRifLAH1wiiP7WefSR mDOhehpV3klfzeA52wAA== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlLnY4jECd2hdUURIbZgL8PX2QiTuZ3cdB8X/nqmbNHWh7ydpZK8PdG/T+BNLR/C8h" Received: from nimes.localnet by smtp.strato.de (RZmta 51.3.0 AUTH) with ESMTPSA id N7dcf814DGxKp81 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Tue, 13 May 2025 18:59:20 +0200 (CEST) From: Bruno Haible To: bug-automake@gnu.org Subject: LDADD vs. LDFLAGS Date: Tue, 13 May 2025 18:59:20 +0200 Message-ID: <2966333.FA0FI3ke8A@nimes> Organization: GNU MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart2115070.UkFFEUeh36" Content-Transfer-Encoding: 7Bit Received-SPF: none client-ip=81.169.146.217; envelope-from=bruno@clisp.org; helo=mo4-p00-ob.smtp.rzone.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.0 (/) 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: -1.0 (-) This is a multi-part message in MIME format. --nextPart2115070.UkFFEUeh36 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" The first paragraph in https://www.gnu.org/software/automake/manual/html_node/Linking.html can be interpreted in a misleading way: "If you need to link against libraries that are not found by configure, you can use LDADD to do so. This variable is used to specify additional objects or libraries to link with; it is inappropriate for specifying specific linker flags; you should use AM_LDFLAGS for this purpose." Last week, I interpreted this as "objects or libraries" being *.o, *.a, and *.la files. And "linker flags" as including -L and -l options. And I concluded that I should specify the -L and -l options in *_LDFLAGS, not in *_LDADD, variables. But that would not work because of these Automake generated rules and variables: LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ test_bind_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(test_bind_LDFLAGS) $(LDFLAGS) -o $@ test-bind$(EXEEXT): $(test_bind_OBJECTS) $(test_bind_DEPENDENCIES) $(EXTRA_test_bind_DEPENDENCIES) @rm -f test-bind$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_bind_OBJECTS) $(test_bind_LDADD) $(LIBS) Here's a proposed slight rewording that avoids this ambiguity. --nextPart2115070.UkFFEUeh36 Content-Disposition: attachment; filename="0001-doc-Clarify-where-to-put-L-and-l-options.patch" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="x-UTF_8J"; name="0001-doc-Clarify-where-to-put-L-and-l-options.patch" >From 7434f6ebecc536bf79a61f3746253a6618ab9d76 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 13 May 2025 18:57:00 +0200 Subject: [PATCH] doc: Clarify where to put -L and -l options. * doc/automake.texi (Linking): Clarify that -L and -l options belong in LDADD. --- doc/automake.texi | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/automake.texi b/doc/automake.texi index bdd615e2d..3cbbff250 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -4946,9 +4946,12 @@ and Lex}. If you need to link against libraries that are not found by @command{configure}, you can use @code{LDADD} to do so. This variable is -used to specify additional objects or libraries to link with; it is -inappropriate for specifying specific linker flags; you should use -@code{AM_LDFLAGS} for this purpose. +used to specify additional objects or libraries to link with. +Libraries to link with can be indicated either as file names or +through @code{-L} and @code{-l} options. + +For other linker options (not @code{-L} or @code{-l}), @code{LDADD} +is inappropriate. You should use @code{AM_LDFLAGS} for this purpose. @vindex LDADD @vindex AM_LDFLAGS -- 2.43.0 --nextPart2115070.UkFFEUeh36-- From debbugs-submit-bounces@debbugs.gnu.org Wed May 14 17:43:09 2025 Received: (at 78411) by debbugs.gnu.org; 14 May 2025 21:43:09 +0000 Received: from localhost ([127.0.0.1]:46688 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uFJsb-0004jx-6r for submit@debbugs.gnu.org; Wed, 14 May 2025 17:43:09 -0400 Received: from frenzy.freefriends.org ([198.99.81.75]:34838 helo=freefriends.org) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uFJsZ-0004jT-3Y; Wed, 14 May 2025 17:43:07 -0400 X-Envelope-From: karl@freefriends.org Received: from freefriends.org (localhost [127.0.0.1]) by freefriends.org (8.16.1/8.16.1) with ESMTPS id 54ELh0pf2528973 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 14 May 2025 15:43:00 -0600 Received: (from apache@localhost) by freefriends.org (8.16.1/8.14.7/Submit) id 54ELh0Tw2528972; Wed, 14 May 2025 15:43:00 -0600 Date: Wed, 14 May 2025 15:43:00 -0600 Message-Id: <202505142143.54ELh0Tw2528972@freefriends.org> From: Karl Berry To: bruno@clisp.org Subject: Re: bug#78411: LDADD vs. LDFLAGS In-Reply-To: <2966333.FA0FI3ke8A@nimes> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 78411 Cc: 78411@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 (---) If you need to link against libraries that are not found by @command{configure}, you can use @code{LDADD} to do so. This variable is -used to specify additional objects or libraries to link with; it is -inappropriate for specifying specific linker flags; you should use -@code{AM_LDFLAGS} for this purpose. +used to specify additional objects or libraries to link with. +Libraries to link with can be indicated either as file names or +through @code{-L} and @code{-l} options. + +For other linker options (not @code{-L} or @code{-l}), @code{LDADD} +is inappropriate. You should use @code{AM_LDFLAGS} for this purpose. Thanks Bruno. Pushed as written. -k From unknown Sat Jun 14 00:05:59 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 12 Jun 2025 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator