Fix LIBC_PROG_BINUTILS for -fuse-ld=lld
GCC does not print the correct linker when -fuse-ld=lld is used with the -print-prog-name=ld: $ gcc -v 2>&1 | tail -n 1 gcc version 11.2.0 (Ubuntu 11.2.0-7ubuntu2) $ gcc ld This is different than for gold: $ gcc -fuse-ld=gold -print-prog-name=ld ld.gold Using ld.lld as the static linker name prints the expected result. This is only required when -fuse-ld=lld is used, if lld is used as the 'ld' programs (through a symlink) LIBC_PROG_BINUTILS works as expected. Checked on x86_64-linux-gnu. Reviewed-by: Fangrui Song <maskray@google.com>
This commit is contained in:
parent
66a273d16a
commit
3d5ecb6246
6
aclocal.m4
vendored
6
aclocal.m4
vendored
|
@ -114,8 +114,12 @@ if test -n "$path_binutils"; then
|
||||||
path_binutils=`(cd $path_binutils; pwd) | sed 's%/*$%/%'`
|
path_binutils=`(cd $path_binutils; pwd) | sed 's%/*$%/%'`
|
||||||
CC="$CC -B$path_binutils"
|
CC="$CC -B$path_binutils"
|
||||||
fi
|
fi
|
||||||
|
case "$CC" in
|
||||||
|
*fuse-ld=lld*) LDNAME=ld.lld;;
|
||||||
|
*) LDNAME=ld;;
|
||||||
|
esac
|
||||||
AS=`$CC -print-prog-name=as`
|
AS=`$CC -print-prog-name=as`
|
||||||
LD=`$CC -print-prog-name=ld`
|
LD=`$CC -print-prog-name=$LDNAME`
|
||||||
AR=`$CC -print-prog-name=ar`
|
AR=`$CC -print-prog-name=ar`
|
||||||
AC_SUBST(AR)
|
AC_SUBST(AR)
|
||||||
OBJDUMP=`$CC -print-prog-name=objdump`
|
OBJDUMP=`$CC -print-prog-name=objdump`
|
||||||
|
|
6
configure
vendored
6
configure
vendored
|
@ -4549,8 +4549,12 @@ if test -n "$path_binutils"; then
|
||||||
path_binutils=`(cd $path_binutils; pwd) | sed 's%/*$%/%'`
|
path_binutils=`(cd $path_binutils; pwd) | sed 's%/*$%/%'`
|
||||||
CC="$CC -B$path_binutils"
|
CC="$CC -B$path_binutils"
|
||||||
fi
|
fi
|
||||||
|
case "$CC" in
|
||||||
|
*fuse-ld=lld*) LDNAME=ld.lld;;
|
||||||
|
*) LDNAME=ld;;
|
||||||
|
esac
|
||||||
AS=`$CC -print-prog-name=as`
|
AS=`$CC -print-prog-name=as`
|
||||||
LD=`$CC -print-prog-name=ld`
|
LD=`$CC -print-prog-name=$LDNAME`
|
||||||
AR=`$CC -print-prog-name=ar`
|
AR=`$CC -print-prog-name=ar`
|
||||||
|
|
||||||
OBJDUMP=`$CC -print-prog-name=objdump`
|
OBJDUMP=`$CC -print-prog-name=objdump`
|
||||||
|
|
Loading…
Reference in a new issue