]> granicus.if.org Git - clang/commitdiff
Fix PR10744 by adding the toolchain path to the regular program path
authorRafael Espindola <rafael.espindola@gmail.com>
Thu, 1 Sep 2011 16:25:49 +0000 (16:25 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Thu, 1 Sep 2011 16:25:49 +0000 (16:25 +0000)
and doing a simple search. Before we would manually check for the linker
before the -B options were searched.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138941 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/ToolChains.cpp

index f56ab4379a261408436657d0c49c82024155bbda..7b5183c1066987537ad32b3e75b82a1185208b8a 100644 (file)
@@ -1617,11 +1617,12 @@ Linux::Linux(const HostInfo &Host, const llvm::Triple &Triple)
     Lib = Lib64;
   }
 
-  llvm::sys::Path LinkerPath(Base + "/../../../../" + GccTriple + "/bin/ld");
-  if (!llvm::sys::fs::exists(LinkerPath.str(), Exists) && Exists)
-    Linker = LinkerPath.str();
-  else
-    Linker = GetProgramPath("ld");
+  // OpenSuse stores the linker with the compiler, add that to the search
+  // path.
+  ToolChain::path_list &PPaths = getProgramPaths();
+  PPaths.push_back(Base + "/../../../../" + GccTriple + "/bin");
+
+  Linker = GetProgramPath("ld");
 
   LinuxDistro Distro = DetectLinuxDistro(Arch);