[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 11 10:09:20 PST 2019


krytarowski added inline comments.


================
Comment at: ELF/Driver.cpp:770
+  // Start with a default initial triple
+  Config->TargetTriple = llvm::Triple(getDefaultTargetTriple());
+
----------------
arichardson wrote:
> arichardson wrote:
> > 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.
> > 
> > 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.
> There needs to be a way to override the target triple that is not creating prefixed a symlink to ld.lld. Otherwise I can't use NetBSD ld.lld to build a non-NetBSD target without giving a value for every config option that lld supports.
> 
> I think there should be a command line option to override the triple (e.g. --triple= or --target=).
> Also how will the default this interact with input files that have the OSABI field set? I feel like the options based on the target OSABI should be used instead of the default triple.
OSABI field is not reliable way to detect OS/ABI. Everybody except FreeBSD sets UNIX SystemV.


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

https://reviews.llvm.org/D56215





More information about the llvm-commits mailing list