http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59321

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to H.J. Lu from comment #1)
> -print-prog-name=foobar gives the path name of program, foobar.
> which isn't necessarily used by the GCC driver:
> 
> [hjl@gnu-6 gcc-4.6.3-x32]$ ./bin/gcc -print-prog-name=as  
> as
> [hjl@gnu-6 gcc-4.6.3-x32]$ ./bin/gcc -print-prog-name=foobar
> foobar

This is only the result if a full path cannot be determined.

> gcc -print-prog-name=as
/usr/lib64/gcc/x86_64-suse-linux/4.6/../../../../x86_64-suse-linux/bin/as


> Should we consider -print-prog-name=ld as special case?

Not really, -print-prog-name prints the command gcc uses if it were
to use that command.  It won't use 'ld' but 'ld.gold' with -fuse-ld=gold
so -print-prog-name=ld is simply not the correct way to determine which
linker GCC ultimately would use.

Thus you'd want a -print-linker-name.

Reply via email to