rpath-link option was ignored before.
This is PR30360, patch fixes that.
Am I missing something ? That looks too much trivial, have no idea why we ignored it before ?
Details
Diff Detail
Event Timeline
This would probably work in practice, but the ld.bfd implementation is a bit more nuanced. Specifically, ld.bfd searches the -L path for libraries named on the command line, and it searches the rpath-link path for libraries required by those libraries. That is, it does not search the -L path for libraries needed by libraries. In my humble opinion, this doesn't make much sense and is slightly annoying for the end user. However, if lld wants to be command-line-compatible with ld.bfd, which I think would be wise, it should probably follow suit.
The ld.bfd documentation has a fairly detailed description:
Yes, that is what I mean when wrote description I think. There is no much sence to split searching I believe.
In lld we always follow the easiest path at first and I do not want to overcomplicate feature until there are reasons to do that.
That makes sense to me. And given that, the patch looks fine (not that my review matters much).
Thanks for your work on this.
Actually, keeping them separate can be quite important when considering the presence of archive libraries in the build library path (-L) vs the link-time view of the run-time path. This matters for linker script look-up.
Sorry, I am missing the idea. Could you provide example to clarify real life usecase you are talking about ?
I was bitten by a subtle difference (or a bug) in the file search path code before, which is fixed in r273846. I can tell from that experience that it was not easy to find a bug. If the linker finds another file in a different directory in search paths, it tries to use that file instead of an intended one and eventually fail in a unresolved symbol error or something like that which seems totally unrelated to a search path problem. So my opinion is that we probably should implement what the GNU linker does to avoid such mess in the future. At least we need to understand the exact semantics of the GNU linker.
ELF/Options.td | ||
---|---|---|
150 | Define rpath_link_eq as an alias for rpath_link. def alias_rpath_link_eq: J<"rpath-link=">, Alias<rpath_link>; |
When prepared this patch, I just already forgot why we ignored it before, but now I remember: it was D18269,
we desided to ignore it like gold do that time.
Define rpath_link_eq as an alias for rpath_link.