<div><div dir="auto">I like the idea of separating the "magic" discovery of fuse-ld and the path based discovery so I'd be happy with that option!</div></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 16, 2020 at 15:26 Fangrui Song via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 2020-06-03, Fangrui Song wrote:<br>
>On 2020-06-03, David Chisnall via cfe-dev wrote:<br>
>>On 02/06/2020 19:47, Fangrui Song via cfe-dev wrote:<br>
>>>If they use a relative path, they can't be benefiting from ld. prefix<br>
>><br>
>>This depends on how they specify the path. If they specify a path <br>
>>for the linker via -fuse-ld, they don't get the prefix. Most <br>
>>cross-compile toolchains that I've seen don't do that. Instead, <br>
>>they use -B to specify a path to find *all* of the tools and then <br>
>>use -fuse-ld={lld,gold,bfd,proprietary linker's name}.<br>
>><br>
>>That is the use case I'm concerned about breaking. The behaviour of <br>
>>-B is to prepend a search path, but still fall back to the default <br>
>>paths if a tool is not found there. For example, if I have:<br>
>><br>
>>/usr/bin/lld<br>
>>/my/custom/sdk/bin/ld.lld<br>
>><br>
>>If I run:<br>
>><br>
>>$ clang -B /my/custom/sdk/bin/ -fuse-ld=lld ...<br>
>><br>
>>Today, I will run my cross-compile toolchain's linker. With your <br>
>>proposed change, I will run my system LLD install. As a user, I <br>
>>will see very confusing error messages from the system linker if it <br>
>>can't handle my cross-compile target. Worse, I may see a binary <br>
>>linked with a linker that defaults to a different linker script, but <br>
>>still produces some output.<br>
>><br>
>>David<br>
><br>
>-fuse-ld={bfd,gold,lld} is compatible with the previous behavior.<br>
><br>
>Do you propose that:<br>
><br>
>* -fuse-ld={bfd,gold.lld} should find "ld.{bfd,gold,lld}" in COMPILER_PATH<br>
>* all -fuse-ld=word should find "word" in COMPILER_PATH<br>
>* -fuse-ld=relative/path should find "relative/path" in PATH?<br>
<br>
Thoughts?<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">--<br>Keith Smiley<br></div>