[PATCH] D14164: Driver: fallback to parent directory of clang if no sysroot for mingw-w64 target

Martell Malone via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 29 09:00:07 PDT 2015


martell added a subscriber: llvm-commits.
martell updated this revision to Diff 38743.
martell added a comment.

My code is a little different from yours as I wanted to preserve as much of the original code as possible.

Added llvm-commits as a subscriber.


http://reviews.llvm.org/D14164

Files:
  lib/Driver/MinGWToolChain.cpp

Index: lib/Driver/MinGWToolChain.cpp
===================================================================
--- lib/Driver/MinGWToolChain.cpp
+++ lib/Driver/MinGWToolChain.cpp
@@ -68,21 +68,16 @@
 
 // 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;
+#ifdef LLVM_ON_WIN32
   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
   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();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14164.38743.patch
Type: text/x-patch
Size: 902 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151029/936976d3/attachment.bin>


More information about the llvm-commits mailing list