Fix PR10744 by adding the toolchain path to the regular program path

and doing a simple search. Before we would manually check for the linker
before the -B options were searched.

llvm-svn: 138941
This commit is contained in:
Rafael Espindola 2011-09-01 16:25:49 +00:00
parent ecc25a2812
commit 5f344fff08
1 changed files with 6 additions and 5 deletions

View File

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