summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2021-08-11 14:02:42 -0700
committerFangrui Song <maskray@google.com>2021-08-24 09:35:46 -0700
commit49f9e120d42e9fe7206391edef609642b400dd49 (patch)
treee18d416f31933f59bdbb28c2002abe1e0423d55c /configure.ac
parent9926f6e2eeb374cf729d4bb3f092dd4b36a8f861 (diff)
downloadglibc-maskray/lld.tar.gz
configure: Allow LD to be LLD 13.0.0 or above [BZ #26558]maskray/lld
When using LLD (LLVM linker) as the linker, configure prints a confusing message. *** These critical programs are missing or too old: GNU ld LLD>=13.0.0 can build glibc --enable-static-pie. (8.0.0 needs one workaround for -Wl,-defsym=_begin=0. 9.0.0 works with --disable-static-pie). With BZ #28153 (glibc bug exposed by testing with LLD) fixed, `make check` only has 2 more failures with LLD than with GNU ld: BZ #28154 (LLD follows the PowerPC port of GNU ld for ifunc by placing IRELATIVE relocations in .rela.dyn). The set of dynamic symbols is the same with GNU ld and LLD, modulo unused SHN_ABS version node symbols. For comparison, gold does not support --enable-static-pie yet (--no-dynamic-linker is unsupported BZ #22221), yet has 6 failures more than LLD. gold linked libc.so has larger .dynsym differences with GNU ld and LLD (ISTM non-default version symbols are changed to default versions by a version script). --- I identified the lack of support of * version script on non-default version symbols * copy relocations on non-default version symbols in an earlier snapshot of LLD 13.0.0 and fixed them. The functionality of the LLD linked libc.so and ld.so looks pretty good.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac20
1 files changed, 15 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index e250f0e20b..89fad382a1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -995,18 +995,28 @@ AC_CHECK_PROG_VER(AS, $AS, --version,
[2.1[0-9][0-9]*|2.2[5-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*],
AS=: critic_missing="$critic_missing as")
-if test -n "`$LD --version | sed -n 's/^GNU \(gold\).*$/\1/p'`"; then
+case $($LD --version) in
+ "GNU gold"*)
# Accept gold 1.14 or higher
- AC_CHECK_PROG_VER(LD, $LD, --version,
+ AC_CHECK_PROG_VER(LD, $LD, --version,
[GNU gold.* \([0-9][0-9]*\.[0-9.]*\)],
[1.1[4-9]*|1.[2-9][0-9]*|1.1[0-9][0-9]*|[2-9].*|[1-9][0-9]*],
LD=: critic_missing="$critic_missing GNU gold")
-else
- AC_CHECK_PROG_VER(LD, $LD, --version,
+ ;;
+ "LLD"*)
+ # Accept LLD 13.0.0 or higher
+ AC_CHECK_PROG_VER(LD, $LD, --version,
+ [LLD.* \([0-9][0-9]*\.[0-9.]*\)],
+ [1[3-9].*|[2-9][0-9].*],
+ LD=: critic_missing="$critic_missing LLD")
+ ;;
+ *)
+ AC_CHECK_PROG_VER(LD, $LD, --version,
[GNU ld.* \([0-9][0-9]*\.[0-9.]*\)],
[2.1[0-9][0-9]*|2.2[5-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*],
LD=: critic_missing="$critic_missing GNU ld")
-fi
+ ;;
+esac
# These programs are version sensitive.
AC_CHECK_PROG_VER(MAKE, gnumake gmake make, --version,