diff options
author | 2023-01-21 16:36:05 +0000 | |
---|---|---|
committer | 2023-02-16 22:59:03 +0000 | |
commit | 190300def3160ca39bd8590d1bbc7305ae07cc5b (patch) | |
tree | 6ecb637b640c5416bc730e4cdc00defbf18afffd | |
parent | CI: add Github Actions (diff) | |
download | sandbox-190300def3160ca39bd8590d1bbc7305ae07cc5b.tar.gz sandbox-190300def3160ca39bd8590d1bbc7305ae07cc5b.tar.bz2 sandbox-190300def3160ca39bd8590d1bbc7305ae07cc5b.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>
-rw-r--r-- | configure.ac | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac index 698051f..a2a0355 100644 --- a/configure.ac +++ b/configure.ac @@ -352,16 +352,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], |