From ba4390a43c3afff3348862cff557e8aad4052d1c Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Mon, 11 Mar 2019 21:27:08 +0000 Subject: [PATCH] configure.ac: fix libc.so.6 detection on ld.gold As reported by Mike Lothian below failed as: $ ./configure LDFLAGS=-fuse-ld=gold > checking libc path... configure: error: Unable to determine LIBC PATH (/lib64/libc.so.6") The regression happened in 3c0010366 ("configure.ac: add lld detection support") where "attempt" keyword in verbose linker log was used as a hint to use bfd or gold output parser. Unfortunately lg.gold uses "Attempt" spelling. The change is to use the same "ttempt" substring matcher as in output parser. Tested on bfd, gold and lld. Reported-by: Mike Lothian Bug: https://bugs.gentoo.org/680034 Signed-off-by: Sergei Trofimovich --- configure.ac | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 8269b37..55fd507 100644 --- a/configure.ac +++ b/configure.ac @@ -345,9 +345,10 @@ try_link() { } LIBC_PATH=$(AS_IF( dnl GNU linker (bfd & gold) searching for - dnl "attempt to open /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../lib64/libc.so succeeded" + dnl (bfd) "attempt to open /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../lib64/libc.so succeeded" + dnl (gold) "/usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: Attempt to open /lib64/libc.so.6 succeeded" dnl if log does not contain "attempt" word then it's not a GNU linker - [try_link -Wl,--verbose && grep -q attempt libctest.log], + [try_link -Wl,--verbose && grep -q ttempt libctest.log], [$AWK '/ttempt to open/ { if (($(NF-1) ~ /\/libc\.so/) && ($NF == "succeeded")) LIBC = $(NF-1); }; END {print LIBC}' libctest.log], dnl LLVM lld searching for latest (successful) entry of dnl "ld.lld: /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../lib64/libc.so" -- 2.21.0