[clang] [Driver] Ensure ToolChain::LibraryPaths is not empty for non-Darwin (PR #87866)

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 16 09:57:22 PDT 2024


MaskRay wrote:

> Is it expected now that `clang --print-runtime-dir` will always have the clang host triple appended even if `LLVM_ENABLE_PER_TARGET_RUNTIME_DIR` is off? I guess I was expecting to see `lib/linux` instead of `lib/x86_64-unknown-linux-gnu`.

https://reviews.llvm.org/D98868 introduced `--print-runtime-dir`. The question is whether `--print-runtime-dir` should print the legacy `lib/linux` when `LLVM_ENABLE_PER_TARGET_RUNTIME_DIR` is off.
Personally I'd hope that `--print-runtime-dir` does not try to be smart and users should be able to expect that it always prints the new hierarchy. 

With the old hierarchy, the user is expected to know how to derive `libclang_rt.builtins-aarch64.a` from `libclang_rt.builtins.a`. In this case, they can extract the directory name from `clang --print-file-name=libclang_rt.builtins-aarch64.a`.

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


More information about the cfe-commits mailing list