From 001fda3c13a7ad09a44f82cfc7bd05011f92e296 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Thu, 7 Mar 2019 23:41:54 +0000 Subject: [PATCH 2/2] configure.ac: add lld detection support With this change $ ./configure CC=clang LDFLAGS='-Wl,--hash-style=gnu -fuse-ld=lld' $ make check exposes 36 test failures Bug: https://bugs.gentoo.org/672918 Signed-off-by: Sergei Trofimovich --- configure.ac | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 8c1866c..3f242b4 100644 --- a/configure.ac +++ b/configure.ac @@ -344,9 +344,16 @@ try_link() { ) 1>&AS_MESSAGE_LOG_FD } LIBC_PATH=$(AS_IF( - dnl GNU linker (bfd & gold) - [try_link -Wl,--verbose], + 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 if log does not contain "attempt" word then it's not a GNU linker + [try_link -Wl,--verbose && grep -q attempt 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" + dnl "ld.lld: /lib64/libc.so.6" + [try_link -Wl,--verbose], + [$EGREP -o '/[[^ ]]*/libc.so.*' libctest.log | tail -n1], dnl Solaris linker [try_link -Wl,-m], [set -- `$EGREP -o '/[[^ ]]*/libc.so' libctest.log`; echo $1] -- 2.21.0