From 553e9229258fd4127e35ad983217b7e4825fdfef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= Date: Mon, 2 May 2016 15:58:31 +0200 Subject: [PATCH 2/4] Manually revert 0e2452f3055e2e2cad06a55c5ca9c2be13404781 This re-enables mingw detection --- lib/Driver/MinGWToolChain.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/lib/Driver/MinGWToolChain.cpp b/lib/Driver/MinGWToolChain.cpp index e971869..1ac3bd3 100644 --- a/lib/Driver/MinGWToolChain.cpp +++ b/lib/Driver/MinGWToolChain.cpp @@ -64,23 +64,17 @@ MinGW::MinGW(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) : ToolChain(D, Triple, Args), CudaInstallation(D, Triple, Args) { getProgramPaths().push_back(getDriver().getInstalledDir()); -// In Windows there aren't any standard install locations, we search -// for gcc on the PATH. In Linux the base is always /usr. -#ifdef LLVM_ON_WIN32 + // On Windows if there is no sysroot we search for gcc on the PATH. if (getDriver().SysRoot.size()) Base = getDriver().SysRoot; +#ifdef LLVM_ON_WIN32 else if (llvm::ErrorOr GPPName = llvm::sys::findProgramByName("gcc")) Base = llvm::sys::path::parent_path( llvm::sys::path::parent_path(GPPName.get())); - else - Base = llvm::sys::path::parent_path(getDriver().getInstalledDir()); -#else - if (getDriver().SysRoot.size()) - Base = getDriver().SysRoot; - else - Base = "/usr"; #endif + if (!Base.size()) + Base = llvm::sys::path::parent_path(getDriver().getInstalledDir()); Base += llvm::sys::path::get_separator(); findGccLibDir(); -- 2.7.4