[PATCH] D45604: Support for multiarch runtimes layout

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 23 23:19:24 PDT 2018


phosek added inline comments.


================
Comment at: clang/lib/Driver/ToolChain.cpp:383
+  SmallString<128> Path(D.ResourceDir);
+  llvm::sys::path::append(Path, D.getDefaultTargetTriple(), "lib",
+                          Prefix + Twine("clang_rt.") + Component + Suffix);
----------------
hans wrote:
> Why is it using the default target triple here and not the current one? (same for the ToolChain ctor).
> 
> And the #ifdefs seems unfortunate.. could Clang just look in the target-specific directory if it exists and fall back otherwise or something?
`getDefaultTargetTriple()` returns either default triple or the current one if overriden via `--target=` option, I just reused the existing value. I think this should be called simply `getTargetTriple()`, that should be a simple refactoring in `Driver` (famous last words).

I could do the fallback, I had that implemented in the first version of the patch but then Reid suggested guarding this feature behind a flag. I can still keep the flag, but only use it for CMake and make the driver support both variants.


Repository:
  rL LLVM

https://reviews.llvm.org/D45604





More information about the llvm-commits mailing list