[PATCH] D151188: [lld] Find resource and lib dir

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 23 14:00:17 PDT 2023


rnk added a comment.

So, the way that MSVC handles this is with the `LIB` and `LIBPATH` environment variables, I forget which. The linker doesn't have to know the search path, target OS, or ISA. People don't like environment variables for various reasons ("how come the tool doesn't work? Oh right, you have to launch it from the VS developer prompt..." 💩 ), so some build systems clear out the environment and pass the library path explicitly on the command line. The library path could be computed by interrogating the compiler directly with one of the `-print*` family of options, but in Chrome, it is recomputed with gn logic, which is no good.

I wasn't involved in these EuroLLVM conversations and I strongly support the goal here: we need lld-link to find compiler-rt out of the box! We need to be able to find the PGO, builtins, and sanitizer libraries with minimal configuration from the user. But, it seems like we are going down the path of replicating some extremely complicated clang library search path logic. I think documenting a solution like `clang-cl /clang:--print-search-paths` might be a better way to go, but maybe other folks feel that is too much like Makefile goop and this should work out of the box.



================
Comment at: llvm/lib/WindowsDriver/LLVMPaths.cpp:14
+#include <llvm/Support/Path.h>
+#include <llvm/TargetParser/Triple.h>
+
----------------
Why angle includes?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151188



More information about the llvm-commits mailing list