[clang] [clang][Driver] Set *LinkerIsLLD for all LLD linker paths in GetLinkerPath (PR #236027)

Petr Hosek via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 29 11:54:09 PDT 2026


================
@@ -301,11 +301,7 @@ constructHexagonLinkArgs(Compilation &C, const JobAction &JA,
   bool IncStartFiles = !Args.hasArg(options::OPT_nostartfiles);
   bool IncDefLibs = !Args.hasArg(options::OPT_nodefaultlibs);
   bool UseLLD = false;
-  const char *Exec = Args.MakeArgString(HTC.GetLinkerPath(&UseLLD));
-  StringRef LinkerName = llvm::sys::path::filename(Exec);
-  UseLLD = UseLLD || LinkerName.starts_with("ld.lld") ||
-           LinkerName.ends_with("ld.lld") ||
-           llvm::sys::path::stem(Exec).ends_with("ld.lld");
+  (void)HTC.GetLinkerPath(&UseLLD);
----------------
petrhosek wrote:

We call `HTC.GetLinkerPath` also in [`Linker::ConstructJob`](https://github.com/frobtech/llvm-project/blob/70c4d893e83708527ae17a348dea30bc323e902f/clang/lib/Driver/ToolChains/Hexagon.cpp#L554). Ideally we would reorder the call there and pass `UseLLD` into this function since that's the only thing we need here. Darwin driver uses the same approach.

https://github.com/llvm/llvm-project/pull/236027


More information about the cfe-commits mailing list