GNU bug report logs -
#78411
LDADD vs. LDFLAGS
Previous Next
Reported by: Bruno Haible <bruno <at> clisp.org>
Date: Tue, 13 May 2025 17:00:02 UTC
Severity: normal
Done: Karl Berry <karl <at> freefriends.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 78411 in the body.
You can then email your comments to 78411 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-automake <at> gnu.org
:
bug#78411
; Package
automake
.
(Tue, 13 May 2025 17:00:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Bruno Haible <bruno <at> clisp.org>
:
New bug report received and forwarded. Copy sent to
bug-automake <at> gnu.org
.
(Tue, 13 May 2025 17:00:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
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.
[0001-doc-Clarify-where-to-put-L-and-l-options.patch (text/x-patch, attachment)]
Information forwarded
to
bug-automake <at> gnu.org
:
bug#78411
; Package
automake
.
(Wed, 14 May 2025 21:44:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 78411 <at> debbugs.gnu.org (full text, mbox):
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
Reply sent
to
Karl Berry <karl <at> freefriends.org>
:
You have taken responsibility.
(Wed, 14 May 2025 21:44:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Bruno Haible <bruno <at> clisp.org>
:
bug acknowledged by developer.
(Wed, 14 May 2025 21:44:03 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Thu, 12 Jun 2025 11:24:06 GMT)
Full text and
rfc822 format available.
This bug report was last modified 1 day ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.