| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 
 | Restore that for now, we're not GenToo ...
https://reviews.llvm.org/D148945
https://reviews.llvm.org/D122444
Index: llvm-toolchain-snapshot_21~++20250630094904+57f7e14b5779/clang/lib/Driver/ToolChains/Linux.cpp
===================================================================
--- llvm-toolchain-snapshot_21~++20250630094904+57f7e14b5779.orig/clang/lib/Driver/ToolChains/Linux.cpp
+++ llvm-toolchain-snapshot_21~++20250630094904+57f7e14b5779/clang/lib/Driver/ToolChains/Linux.cpp
@@ -352,6 +352,13 @@ Linux::Linux(const Driver &D, const llvm
 
   Generic_GCC::AddMultiarchPaths(D, SysRoot, OSLibDir, Paths);
 
+  // The deprecated -DLLVM_ENABLE_PROJECTS=libcxx configuration installs
+  // libc++.so in D.Dir+"/../lib/". Detect this path.
+  // TODO Remove once LLVM_ENABLE_PROJECTS=libcxx is unsupported.
+  if (StringRef(D.Dir).starts_with(SysRoot) &&
+      D.getVFS().exists(D.Dir + "/../lib/libc++.so"))
+    addPathIfExists(D, D.Dir + "/../lib", Paths);
+
   addPathIfExists(D, concat(SysRoot, "/lib"), Paths);
   addPathIfExists(D, concat(SysRoot, "/usr/lib"), Paths);
 }
 |