D148945-revert
authorLLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>
Sat, 5 Apr 2025 20:24:44 +0000 (22:24 +0200)
committerSylvestre Ledru <sylvestre@debian.org>
Sat, 5 Apr 2025 20:24:44 +0000 (22:24 +0200)
Restore that for now, we're not GenToo ...

https://reviews.llvm.org/D148945
https://reviews.llvm.org/D122444

Gbp-Pq: Name D148945-revert.diff

clang/lib/Driver/ToolChains/Linux.cpp

index aaba988ed176a3e875a290e4740098f63bc56749..15c6cf2be1354d24811b3cbf8beaf6e784f3a307 100644 (file)
@@ -337,6 +337,13 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
 
   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).startswith(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);
 }