This revision was automatically updated to reflect the committed changes. Closed by commit rL253898: Driver: fallback to the location of clang if no sysroot, (authored by martell).
Changed prior to commit: http://reviews.llvm.org/D14164?vs=39069&id=40951#toc Repository: rL LLVM http://reviews.llvm.org/D14164 Files: cfe/trunk/lib/Driver/MinGWToolChain.cpp Index: cfe/trunk/lib/Driver/MinGWToolChain.cpp =================================================================== --- cfe/trunk/lib/Driver/MinGWToolChain.cpp +++ cfe/trunk/lib/Driver/MinGWToolChain.cpp @@ -66,24 +66,20 @@ : ToolChain(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. +// 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 - if (getDriver().SysRoot.size()) - Base = getDriver().SysRoot; - else if (llvm::ErrorOr<std::string> 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"; +else if (llvm::ErrorOr<std::string> GPPName = + llvm::sys::findProgramByName("gcc")) + Base = llvm::sys::path::parent_path( + llvm::sys::path::parent_path(GPPName.get())); #endif +if (!Base.size()) + Base = llvm::sys::path::parent_path(getDriver().getInstalledDir()); + Base += llvm::sys::path::get_separator(); findGccLibDir(); // GccLibDir must precede Base/lib so that the
Index: cfe/trunk/lib/Driver/MinGWToolChain.cpp =================================================================== --- cfe/trunk/lib/Driver/MinGWToolChain.cpp +++ cfe/trunk/lib/Driver/MinGWToolChain.cpp @@ -66,24 +66,20 @@ : ToolChain(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. +// 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 - if (getDriver().SysRoot.size()) - Base = getDriver().SysRoot; - else if (llvm::ErrorOr<std::string> 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"; +else if (llvm::ErrorOr<std::string> GPPName = + llvm::sys::findProgramByName("gcc")) + Base = llvm::sys::path::parent_path( + llvm::sys::path::parent_path(GPPName.get())); #endif +if (!Base.size()) + Base = llvm::sys::path::parent_path(getDriver().getInstalledDir()); + Base += llvm::sys::path::get_separator(); findGccLibDir(); // GccLibDir must precede Base/lib so that the
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits