arichardson added a comment.

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.


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

https://reviews.llvm.org/D56215



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to