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

Kamil Rytarowski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 4 09:54:44 PST 2019


krytarowski added a comment.

In D56215#1346342 <https://reviews.llvm.org/D56215#1346342>, @arichardson wrote:

> In D56215#1346061 <https://reviews.llvm.org/D56215#1346061>, @mgorny wrote:
>
> > For the record, another option is to actually fix other software not to call LD directly.
>
>
> Or if you really need to call the linker directly without specifying search paths you could also install a shell script as /usr/bin/ld that passes the appropriate flags to /usr/bin/ld.lld?
>
> I don't think ifdefs in the source code are a good idea. Cross linking should just work as expected. But you could look at the OS field in the first input ELF file to choose default config options/a different emulation for NetBSD.
>
> The approach we are using in CheriBSD to differentiate between MIPS and CHERI pure-capability to either pass an explicitly `-m elf_btsmip_cheri_fbsd`/ `-m elf_btsmip_fbsd` or infer whether it is CHERI or MIPS based on the e_flags field of the first input file.


This would be the best option to use a shell wrapper for someone who needs it, but we cannot convince Joerg for almost 2 years.


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

https://reviews.llvm.org/D56215





More information about the llvm-commits mailing list