On Thu, Jan 14, 2021 at 12:21:05PM -0800, Fangrui Song wrote: > On 2021-01-14, Martin Liška wrote: > > On 1/14/21 11:07 AM, Richard Biener wrote: > > > I see no particular reason to allow arbitrary garbage to be used as > > > linker. It just asks for users to shoot themselves in the foot and > > > for strange bugreports to pop up. > > > > Well, for a strange bug report, we'll see eventually usage of the > > --ld-path= option. > > > > I see it handy when developing a ld feature to be able to point to a built > > ld > > (without need to build GCC with it). Yes, one can use --save-temps --verbose > > and invoke the built linker, but it's not handy. > > > > Martin > > > > I did this when I worked on some GNU ld features. > clang --ld-path=/path/to/binutils/out/debug/ld/ld-new > or debugging some Linux kernel issues related to ld. > > Having --ld-path= in GCC will be handy.
If the linker is called ld and there isn't random unrelated stuff in the same directory, one can always just use -B path/to/ld/ Jakub