[lld] [LLD] [COFF] Prefer paths specified with -libpath: over toolchain paths (PR #78039)

Saleem Abdulrasool via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 13 13:00:21 PST 2024


================
@@ -1548,14 +1548,14 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
   {
     llvm::TimeTraceScope timeScope2("Search paths");
     searchPaths.emplace_back("");
+    for (auto *arg : args.filtered(OPT_libpath))
+      searchPaths.push_back(arg->getValue());
     if (!config->mingw) {
       // Prefer the Clang provided builtins over the ones bundled with MSVC.
       // In MinGW mode, the compiler driver passes the necessary libpath
       // options explicitly.
       addClangLibSearchPaths(argsArr[0]);
     }
-    for (auto *arg : args.filtered(OPT_libpath))
-      searchPaths.push_back(arg->getValue());
     if (!config->mingw) {
----------------
compnerd wrote:

Should this be collapsed in the preceding branch?

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


More information about the llvm-commits mailing list