summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/MinGWToolChain.cpp
diff options
context:
space:
mode:
authorIsmail Donmez <ismail@i10z.com>2016-01-12 10:41:20 +0000
committerIsmail Donmez <ismail@i10z.com>2016-01-12 10:41:20 +0000
commit5797c55f07255eb95710917f94e6bcf4dcac711f (patch)
treea92026987d0aa48a0fec9ff70f9f706258fd62ec /clang/lib/Driver/MinGWToolChain.cpp
parentbdd9da14d653c5b9616cb8562f58513c0c781964 (diff)
downloadbcm5719-llvm-5797c55f07255eb95710917f94e6bcf4dcac711f.tar.gz
bcm5719-llvm-5797c55f07255eb95710917f94e6bcf4dcac711f.zip
Revert r253898 and r253899, this breaks mingw compilation on openSUSE.
Will re-apply after llvm 3.8 is branched. Original commit message: Driver: fallback to the location of clang if no sysroot, hard coding /usr makes little sense for mingw-w64. If we have portable toolchains having /usr breaks that. If the clang we use is in /usr/bin or /usr/sbin etc this will still detect as though it was hard coded to /usr This makes the most sense going forward for mingw-w64 toolchains on both linux and mac llvm-svn: 257468
Diffstat (limited to 'clang/lib/Driver/MinGWToolChain.cpp')
-rw-r--r--clang/lib/Driver/MinGWToolChain.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/clang/lib/Driver/MinGWToolChain.cpp b/clang/lib/Driver/MinGWToolChain.cpp
index c5287bb4157..938440b08f6 100644
--- a/clang/lib/Driver/MinGWToolChain.cpp
+++ b/clang/lib/Driver/MinGWToolChain.cpp
@@ -66,17 +66,23 @@ MinGW::MinGW(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
: ToolChain(D, Triple, Args) {
getProgramPaths().push_back(getDriver().getInstalledDir());
- // On Windows if there is no sysroot we search for gcc on the PATH.
- if (getDriver().SysRoot.size())
- Base = getDriver().SysRoot;
+// 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
+ 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()));
-#endif
- if (!Base.size())
+ else
Base = llvm::sys::path::parent_path(getDriver().getInstalledDir());
+#else
+ if (getDriver().SysRoot.size())
+ Base = getDriver().SysRoot;
+ else
+ Base = "/usr";
+#endif
Base += llvm::sys::path::get_separator();
findGccLibDir();
OpenPOWER on IntegriCloud