[PATCH] D108286: [clang][Driver][Linux] fix regression issue when define LIBCXX_LIBDIR_SUFFIX=64

lin.sun via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 25 23:07:49 PDT 2021


sunlin updated this revision to Diff 368812.
sunlin added a comment.

Update for do not add duplicate path


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108286

Files:
  clang/lib/Driver/ToolChains/Linux.cpp


Index: clang/lib/Driver/ToolChains/Linux.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Linux.cpp
+++ clang/lib/Driver/ToolChains/Linux.cpp
@@ -303,8 +303,12 @@
   // searched.
   // FIXME: It's not clear whether we should use the driver's installed
   // directory ('Dir' below) or the ResourceDir.
-  if (StringRef(D.Dir).startswith(SysRoot))
+  if (StringRef(D.Dir).startswith(SysRoot)) {
     addPathIfExists(D, D.Dir + "/../lib", Paths);
+    if (OSLibDir != "lib") {
+      addPathIfExists(D, D.Dir + "/../" + OSLibDir, Paths);
+    }
+  }
 
   addPathIfExists(D, SysRoot + "/lib", Paths);
   addPathIfExists(D, SysRoot + "/usr/lib", Paths);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108286.368812.patch
Type: text/x-patch
Size: 705 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210826/3a37bbf8/attachment.bin>


More information about the cfe-commits mailing list