[lld] [lld][COFF] Add per-target runtime directories to library search path (PR #227744)

Jacek Caban via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 5 03:16:27 PDT 2026


================
@@ -204,6 +204,23 @@ static bool compatibleMachineType(COFFLinkerContext &ctx, MachineTypes mt) {
   }
 }
 
+static std::optional<std::string>
+perTargetRuntimeDirForMachineType(MachineTypes mt) {
+  switch (mt) {
+  case ARM64:
+  case ARM64X:
+    return {"aarch64-pc-windows-msvc"};
+  case ARM64EC:
+    return {"arm64ec-pc-windows-msvc"};
----------------
cjacek wrote:

It looks like Clang would currently use arm64ec-* subdirectory in this case, but I think that it should use aarch64 instead. (For aarch64 in non-per-target-runtime form it uses target's arch, while arm64ec is distinguished from aarch64 by subarch, but for per-target directory it uses full target triple.)

For LLD, I agree that keeping arm64ec equal to aarch64 seems right.

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


More information about the llvm-commits mailing list