diff options
author | James Le Cuirot <chewi@gentoo.org> | 2023-01-21 16:36:05 +0000 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2023-05-12 02:39:38 +0100 |
commit | b926cd079443bb9d0420b11201d4bd88a7aacd08 (patch) | |
tree | b64d43201fa7e7b71f7d42a5e7e195404c5ba655 | |
parent | CI: add Github Actions (diff) | |
download | sandbox-b926cd079443bb9d0420b11201d4bd88a7aacd08.tar.gz sandbox-b926cd079443bb9d0420b11201d4bd88a7aacd08.tar.bz2 sandbox-b926cd079443bb9d0420b11201d4bd88a7aacd08.zip |
build: Fix libc path configure test for mold
bfd, gold, lld, and mold all support `-Wl,--trace`, which has cleaner
output than `-Wl,--verbose`. mold doesn't output anything with the
latter, so the test didn't support that until now. The only difference
between them now is that mold prefixes its output with `trace: ` whereas
the others do not.
I checked the Solaris linker, but that does not support `-Wl,--trace`.
Bug: https://bugs.gentoo.org/830463
Signed-off-by: James Le Cuirot <chewi@gentoo.org>
Closes: https://github.com/gentoo/sandbox/pull/5
Signed-off-by: Sam James <sam@gentoo.org>
(cherry picked from commit 190300def3160ca39bd8590d1bbc7305ae07cc5b)
-rw-r--r-- | configure.ac | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac index ace4173..a274580 100644 --- a/configure.ac +++ b/configure.ac @@ -363,16 +363,11 @@ try_link() { ) 1>&AS_MESSAGE_LOG_FD } LIBC_PATH=$(AS_IF( - dnl GNU linker (bfd & gold) searching for - 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 '[[Aa]]ttempt' libctest.log], - [$AWK '/[[Aa]]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], + dnl GNU linkers (bfd, gold), LLVM lld, mold - searching for latest entry of: + dnl "/usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../lib64/libc.so" + dnl "/lib64/libc.so.6" + dnl Note that mold prefixes output with "trace: " whereas others do not. + [try_link -Wl,--trace], [$EGREP -o '/[[^ ]]*/libc.so.*' libctest.log | tail -n1], dnl Solaris linker [try_link -Wl,-m], |