1 |
commit: 18b1979734f57726c0a601ade0505c2e4615947d |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Mar 11 21:27:08 2019 +0000 |
4 |
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Mar 13 09:56:33 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=18b19797 |
7 |
|
8 |
configure.ac: fix libc.so.6 detection on ld.gold |
9 |
|
10 |
As reported by Mike Lothian below failed as: |
11 |
$ ./configure LDFLAGS=-fuse-ld=gold |
12 |
> checking libc path... configure: error: Unable to determine LIBC PATH (/lib64/libc.so.6") |
13 |
|
14 |
The regression happened in 3c0010366 |
15 |
("configure.ac: add lld detection support") |
16 |
where "attempt" keyword in verbose linker log was used as a hint |
17 |
to use bfd or gold output parser. Unfortunately ld.gold uses |
18 |
"Attempt" spelling. |
19 |
|
20 |
The change is to use the "[Aa]ttempt" substring matcher. |
21 |
Tweak the parser to also match on "[Aa]ttempt" explicitly. |
22 |
|
23 |
Tested on bfd, gold and lld. |
24 |
|
25 |
Reported-by: Mike Lothian |
26 |
Bug: https://bugs.gentoo.org/680034 |
27 |
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> |
28 |
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org> |
29 |
|
30 |
configure.ac | 7 ++++--- |
31 |
1 file changed, 4 insertions(+), 3 deletions(-) |
32 |
|
33 |
diff --git a/configure.ac b/configure.ac |
34 |
index 8269b37..ca59928 100644 |
35 |
--- a/configure.ac |
36 |
+++ b/configure.ac |
37 |
@@ -345,10 +345,11 @@ try_link() { |
38 |
} |
39 |
LIBC_PATH=$(AS_IF( |
40 |
dnl GNU linker (bfd & gold) searching for |
41 |
- dnl "attempt to open /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../lib64/libc.so succeeded" |
42 |
+ dnl (bfd) "attempt to open /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../lib64/libc.so succeeded" |
43 |
+ 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" |
44 |
dnl if log does not contain "attempt" word then it's not a GNU linker |
45 |
- [try_link -Wl,--verbose && grep -q attempt libctest.log], |
46 |
- [$AWK '/ttempt to open/ { if (($(NF-1) ~ /\/libc\.so/) && ($NF == "succeeded")) LIBC = $(NF-1); }; END {print LIBC}' libctest.log], |
47 |
+ [try_link -Wl,--verbose && grep -q '[[Aa]]ttempt' libctest.log], |
48 |
+ [$AWK '/[[Aa]]ttempt to open/ { if (($(NF-1) ~ /\/libc\.so/) && ($NF == "succeeded")) LIBC = $(NF-1); }; END {print LIBC}' libctest.log], |
49 |
dnl LLVM lld searching for latest (successful) entry of |
50 |
dnl "ld.lld: /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../lib64/libc.so" |
51 |
dnl "ld.lld: /lib64/libc.so.6" |