<div dir="ltr">I don't remember the details, but I believe LLD-generated executables are fine with either Linux or on NetBSD</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 8, 2017 at 3:08 PM, Kamil Rytarowski <span dir="ltr"><<a href="mailto:n54@gmx.com" target="_blank">n54@gmx.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="">On 08.06.2017 22:39, Rui Ueyama wrote:<br>
> On Wed, Jun 7, 2017 at 6:55 AM, Joerg Sonnenberger via Phabricator<br>
</span><span class="">> <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a> <mailto:<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.<wbr>org</a>>> wrote:<br>
><br>
>     joerg added a comment.<br>
><br>
>     In <a href="https://reviews.llvm.org/D33726#774105" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D33726#774105</a><br>
</span><span class="">>     <<a href="https://reviews.llvm.org/D33726#774105" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D33726#774105</a>>, @ruiu wrote:<br>
><br>
>     > I'm totally against adding per-OS path knowledge to our linker. Compilers already know include paths and I don't want to maintain another list of paths in the linker. Also this can be more confusing than useful when you are doing cross-linking.<br>
><br>
><br>
>     The only reason for compilers to maintain that list is for finding<br>
>     crt*.o. They otherwise don't care about the library paths at all.<br>
>     There is no confusion for cross-linking as long as proper sysroot<br>
>     support is used. Which we have been doing on NetBSD for ages.<br>
><br>
><br>
> That's not what clang is trying to do for all Unix-like systems (except<br>
> NetBSD due to the bug), right? The compiler driver actually passes<br>
> library paths to the linker. If you think that is wrong, you should make<br>
> a change to stop doing that on all systems. I don't see a reason to not<br>
> do this only on NetBSD.<br>
><br>
<br>
</span>I'm convinced that Joerg is right, that there is need some knowledge on<br>
the LLD side. I'm more relaxed about -L paths as long as they work for<br>
regular use-cases, but DT_RPATH vs DT_RUNPATH behaves differently on<br>
Linux and NetBSD.<br>
<span class=""><br>
>     > For all OSes other than NetBSD, LLD works fine with the clang driver as the driver passes include paths to the linker. I don't see any reason not to do the same thing for NetBSD. That stands even if the linker has to have a list of include paths.<br>
><br>
>     Sorry, but this is again ignorant and wrong. The very same problem<br>
>     of build systems calling ld directly apply on most other systems.<br>
>     Even then, the list of linker paths is not the only OS-specific<br>
>     knowledge. Things like the DT_RPATH vs DT_RUNPATH mess, init vs<br>
>     init_array all belong into this category. The list goes on.<br>
><br>
><br>
>     Repository:<br>
>       rL LLVM<br>
><br>
</span>>     <a href="https://reviews.llvm.org/D33726" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D33726</a> <<a href="https://reviews.llvm.org/D33726" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D33726</a>><br>
><br>
><br>
><br>
><br>
<br>
<br>
</blockquote></div><br></div>