[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

Kamil Rytarowski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 3 14:42:13 PST 2019


krytarowski added a comment.

In D56215#1345695 <https://reviews.llvm.org/D56215#1345695>, @ruiu wrote:

> In D56215#1345417 <https://reviews.llvm.org/D56215#1345417>, @joerg wrote:
>
> > Talking from the perspective of having had to deal with thousands of packages in pkgsrc over the years: it is naive to believe that there isn't a lot of software that calls the linker directly for various reasons. As such, it is very important to have a useful configuration in the linker by default. Such a configuration is by its very nature target specific. This doesn't mean it can't be done in a cross-compiler friendly way, on the contrary. Over the years NetBSD has been pushing its toolchain to be as similar for the native build and a cross-target as reasonable possible. Modulo the build time choices in the config.h sense, the only difference between the native and cross tools is the built-in default of the former.
>
>
> It might be naive but I don't think it's too naive. Most programs use ld via cc, and I don't think it is too unreasonable to not implement a host-specific logic for a very small percentage of programs that directly use ld. If we do, that logic would be the same or very similar to the one that we already have in cc. I think we should avoid that duplication of the host-specific config in the toolchain.
>
> I see there are pros and cons to not have host-specific config in ld. That said, if other operating systems can live without host-specific config in lld, why can't NetBSD do? I really don't like to be in a situation where only one operating system have a host-specific config while others don't.


Before we even can start a philosophical dispute, is there some way to even get that setup functional in lld? How to check if the target is supposed to be a NetBSD binary? @mgorny raised some proposals.. https://reviews.llvm.org/D56215#1345563 but all of them seem to be either dysfunctional (ifdefs) or hackish (renaming emul names or renaming lld binary name to netbsd-*).

Looking at the code of lld, the detection of FreeBSD is done by checking emulation name (*fbsd) and anything else by a flag passed to a linker such as `--do-something-for-android` (e.g. "use-android-relr-tags")


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56215/new/

https://reviews.llvm.org/D56215





More information about the cfe-commits mailing list