[libvirt] PATCH: configure.in should use 'ld' from $PATH for checking version-script syntax, not hardcode /usr/bin/ld

Paolo Bonzini pbonzini at redhat.com
Tue Nov 17 17:12:23 UTC 2009

On 11/16/2009 11:42 PM, Daniel Veillard wrote:
> that won't differentiate ld in $PATH from /usr/bin/ld which
> is the actual command launched by gcc (or rather collect2) ... so
> unfortunately that's still gcc only and even then incomplete:-)

If --print-prog-name gives only "ld" that means collect2 will walk the 
$PATH.  But if gcc was configured with --with-ld=something, or if a -B 
option is included in $CC, then --print-prog-name will print a full path.

Example (PATH includes ~/bin):

$ cat ~/bin/ld
#! /bin/sh
echo hello from "$0" > /dev/tty
exec /usr/bin/ld "$@"

$ gcc --print-prog-name=ld
$ gcc f.c
hello from /home/pbonzini/bin/ld

$ gcc -B$HOME/bin --print-prog-name=ld
$ gcc -B$HOME/bin f.c
hello from /home/pbonzini/bin/ld

$ gcc -B$HOME/./bin --print-prog-name=ld
$ gcc -B$HOME/./bin f.c
hello from /home/pbonzini/./bin/ld



More information about the libvir-list mailing list