aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2019-03-07 23:41:54 +0000
committerSergei Trofimovich <slyfox@gentoo.org>2019-03-08 07:35:55 +0000
commit3c001036637930152c038d084334d9a7311ffc6e (patch)
tree5d4337a88405ac58c7532c3768e83cdc7b738d88
parentexec wrapper: add support for GNU_HASH parser (diff)
downloadsandbox-3c001036637930152c038d084334d9a7311ffc6e.tar.gz
sandbox-3c001036637930152c038d084334d9a7311ffc6e.tar.bz2
sandbox-3c001036637930152c038d084334d9a7311ffc6e.zip
configure.ac: add lld detection support
With this change $ ./configure CC=clang LDFLAGS='-Wl,--hash-style=gnu -fuse-ld=lld' $ make check exposes 35 test failures Bug: https://bugs.gentoo.org/672918 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-rw-r--r--configure.ac11
1 files 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]