[PATCH] D25263: [Driver] Allow setting the default linker during build

Jonas Hahnfeld via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 17 00:36:06 PDT 2016


Hahnfeld added a comment.

Have you run all tests with `CLANG_DEFAULT_LINKER` not being the platform default? I imagine there might be some tests that expect `ld` to be used...



================
Comment at: CMakeLists.txt:198
 
+set(CLANG_DEFAULT_LINKER "" CACHE STRING
+  "Default linker to use (\"bfd\" or \"gold\" or \"lld\", empty for platform default")
----------------
bruno wrote:
> mgorny wrote:
> > Is there a reason not to allow using the absolute path here, like for the command-line option?
> I agree here, if we're adding a cmake options for this, it should accept full paths to the linker to be used (without any need for its type like gold, bfd, etc) as well.
> 
> Additionally, if "" maps to "ld", plain CLANG_DEFAULT_LINKER="ld" should also work here.
I agree with both points here.


================
Comment at: lib/Driver/ToolChain.cpp:352
+      return UseLinker;
+  } else if (A && (UseLinker.empty() || UseLinker == "ld")) {
+    // If we're passed -fuse-ld= with no argument, or with the argument ld,
----------------
I wonder whether this is really correct: If `DefaultLinker` is not `ld` (it is `lld` for some ToolChains), `-fuse-ld=` with an empty argument should probably not use `ld` but rather whatever `DefaultLinker` says...


Repository:
  rL LLVM

https://reviews.llvm.org/D25263





More information about the cfe-commits mailing list