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

Joerg Sonnenberger via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 8 15:06:51 PST 2019


On Tue, Jan 08, 2019 at 10:58:37PM +0000, Alexander Richardson via Phabricator via cfe-commits wrote:
> arichardson added inline comments.
> 
> 
> ================
> Comment at: ELF/Driver.cpp:770
> +  // Start with a default initial triple
> +  Config->TargetTriple = llvm::Triple(getDefaultTargetTriple());
> +
> ----------------
> If I invoke an unprefixed ld.lld on NetBSD but want to target a
> different operating system, this will cause all the NetBSD defaults to
> apply to that binary and will possibly cause it to crash at runtime.

...which no different from clang.

> I think any config changes based on a triple would need to use an
> explicit --target= flag instead. As @ruiu says, LLD's behaviour should
> not change depending on the host OS/default LLVM triple. Given the same
> input files and command line options the resulting binary should be
> identical on any host.

That boils down to either "lld is unusable out of the box" or "your
system must look similar enough to a GNU/Linux environment for lld to
work". I don't consider that useful behavior at all.

Joerg


More information about the cfe-commits mailing list