[PATCH] D50547: [Driver] Use normalized triples for multiarch runtime path

Chris Bieneman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 22 13:45:02 PDT 2018


beanz accepted this revision.
beanz added a comment.

LGTM as-is



================
Comment at: clang/lib/Driver/ToolChain.cpp:372
 
-  const Driver &D = getDriver();
-  SmallString<128> P(D.ResourceDir);
-  llvm::sys::path::append(P, D.getTargetTriple(), "lib");
-  if (getVFS().exists(P)) {
+  for (const auto &LibPath : getLibraryPaths()) {
+    SmallString<128> P(LibPath);
----------------
phosek wrote:
> One possible alternative I've considered would be to simply return `-lclang_rt.<component>.<suffix>` instead of returning the full path when `getLibraryPaths()` is not empty. That should work because we add all paths in this list as `-L` in `AddFilePathLibArgs` and it's more consistent with e.g. `-lgcc_s`.
I'd prefer not doing that since Darwin doesn't call AddFilePathLibArgs, and adjusting to that is a larger change on the Darwin side.


Repository:
  rC Clang

https://reviews.llvm.org/D50547





More information about the cfe-commits mailing list