<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Nov 28, 2017 at 2:07 PM, Rafael Avila de Espindola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Rui Ueyama via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> writes:<br>
<br>
</span><span class="">> ruiu added a comment.<br>
><br>
> If you are suggesting we emit something like "cannot open file for -R: foo/bar is a directory. Did you mean -rpath?" for -R, I think I'd agree that that is probably better than just emitting an error without the hint.<br>
<br>
</span>Two options:<br>
* We alias -R to --just-symbols. In which case an error like what you<br>
  are suggesting is OK.<br>
* We alias -R to --rpath. In which case we would like an error like:<br>
  "foo/bar is not a directory. Do you want --just-symbols?".<br>
<br>
Given that --rpath is more common, I think we should keep -R aliased to<br>
--rpath and have the second error.<br></blockquote><div><br></div><div>I think we shouldn't even emit an error for the second case. -rpath is the information for the dynamic linker, and the static linker should blindly store given -rpath paths to a file header, because the static linker doesn't know the actual runtime environment. It is a valid use case that a given -rpath is not a directory in a build environment but a directory in a runtime environment.</div><div><br></div><div>Given that, I'm inclined to not to emit an error or a warning at all for -R and just make it an alias to -rpath. If you are so familiar with linker features that you want to use --just-symbols, you are likely to know -R, -rpath and -just-symbols. -just-symbols is used very rarely, so in reality, I think this is not an issue.</div></div></div></div>