[PATCH] D56650: [lld] [ELF] Support customizing behavior on target triple

Kamil Rytarowski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 2 08:04:03 PDT 2019


krytarowski added a comment.

> Personally I am opposed to this change. The compiler driver (gcc,clang) has a set of arch/OS dependent defaults. It seems weird/redundant to add another sets of defaults on the linker side.

The NetBSD toolchain relies on internal knowledge in a linker that can be used as a standalone program. This is our design choice and this was decided internally to be kept. You might not be nice from some point of view, but it is our real-world use-case, we wrote set of patches for it, we maintain a buildbot building and running lld tests... we try to upstream it.

A similar customization is actually done for (at least) Darwin (as the only OS using MachO) and FreeBSD (by an accident it's possible to differentiate FreeBSD on emul name). Please see that Darwin appends default paths (last time I checked) and for FreeBSD there are some fixups based on detecting FreeBSD. For OpenBSD there is an accident that it works thanks to embedding 'openbsd' in customization parts. For NetBSD we don't have such escape detection viable to include fixups and we shall detect triple target based on lld executable name.

If you don't like to see this code by defaut in lld, we can include it under `#ifdef` or overload the 'elf' namespace into 'netbsdelf'.

We need to unearth from our local patches and get upstream version of lld functional.


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

https://reviews.llvm.org/D56650





More information about the cfe-commits mailing list