[Driver] Gnu.cpp: remove unneeded -L detection for libc++
authorFangrui Song <i@maskray.me>
Sun, 21 Mar 2021 01:56:40 +0000 (18:56 -0700)
committerFangrui Song <i@maskray.me>
Sun, 21 Mar 2021 01:56:40 +0000 (18:56 -0700)
If clang is installed in the system, the other -L suffice;
otherwise $ccc_install_dir/../lib below suffices.

clang/lib/Driver/ToolChains/Linux.cpp

index ad98013..6599f46 100644 (file)
@@ -307,16 +307,6 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
 
   Generic_GCC::AddMultilibPaths(D, SysRoot, OSLibDir, MultiarchTriple, Paths);
 
-  // Similar to the logic for GCC above, if we currently running Clang inside
-  // of the requested system root, add its parent library paths to
-  // those 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)) {
-    addPathIfExists(D, D.Dir + "/../lib/" + MultiarchTriple, Paths);
-    addPathIfExists(D, D.Dir + "/../" + OSLibDir, Paths);
-  }
-
   addPathIfExists(D, SysRoot + "/lib/" + MultiarchTriple, Paths);
   addPathIfExists(D, SysRoot + "/lib/../" + OSLibDir, Paths);