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

Alexander Richardson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 11 09:36:51 PST 2019


arichardson requested changes to this revision.
arichardson added inline comments.
This revision now requires changes to proceed.


================
Comment at: ELF/Driver.cpp:770
+  // Start with a default initial triple
+  Config->TargetTriple = llvm::Triple(getDefaultTargetTriple());
+
----------------
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.


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

https://reviews.llvm.org/D56215





More information about the cfe-commits mailing list