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

Joerg Sonnenberger via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 4 10:32:47 PST 2019


On Fri, Jan 04, 2019 at 02:48:35PM +0000, Alexander Richardson via Phabricator wrote:
> 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?

That's not a honest suggestion, is it?

> 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.

No, #if is certainly wrong. Using the OS field doesn't work though,
because it is typically not set. I think only FreeBSD ever did.

> 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.

Yeah, but introducing new emulation names goes back to having to modify
things, which would defeat the purpose just as well.

Joerg


More information about the llvm-commits mailing list