]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
libtool: Use $LD when checking for --whole-archive
authorRaul E Rangel <rrangel@chromium.org>
Wed, 13 Dec 2023 16:44:57 +0000 (09:44 -0700)
committerMike Frysinger <vapier@gentoo.org>
Tue, 16 Jan 2024 20:28:57 +0000 (15:28 -0500)
Using `$CC -print-prog-name=ld` will always use the `ld` linker. We
should instead be using the $LD variable so that we use the proper
linker.

There is already another part of the code that does this same check,
so I just copy/pasted the if line.

* m4/libtool.m4: Change `$CC -print-prog-name=ld` to $LD.

Url: https://savannah.gnu.org/support/?110978
Signed-off-by: Raul E Rangel <rrangel@chromium.org>
m4/libtool.m4

index 83c33d35cb15857278701f491576d3a57ebe972a..4b84ce9664719804d0b04895e192012d35aa6e7a 100644 (file)
@@ -6427,8 +6427,7 @@ if test yes != "$_lt_caught_CXX_error"; then
         wlarc='$wl'
 
         # ancient GNU ld didn't support --whole-archive et. al.
-        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
-         $GREP 'no-whole-archive' > /dev/null; then
+        if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
           _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
         else
           _LT_TAGVAR(whole_archive_flag_spec, $1)=