<div dir="ltr">No problem, thanks for the quick update!</div><div class="gmail_extra"><br><div class="gmail_quote">On 18 April 2017 at 15:56, Martell Malone <span dir="ltr"><<a href="mailto:martellmalone@gmail.com" target="_blank">martellmalone@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Yes I do :)<br>I updated <a href="https://reviews.llvm.org/D15005" target="_blank">https://reviews.llvm.<wbr>org/D15005</a> with a comment incase anyone goes there.<br>I also updated <a href="https://reviews.llvm.org/D15006" target="_blank">https://reviews.llvm.<wbr>org/D15006</a> (the correct link) to point to the commit revision.<br><br>Thanks for pointing that out Alex</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 18, 2017 at 3:49 PM, Alex L <span dir="ltr"><<a href="mailto:arphaman@gmail.com" target="_blank">arphaman@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I think you've got the wrong Phabricator link in the commit log.</div><div class="m_8585871894592900279HOEnZb"><div class="m_8585871894592900279h5"><div class="gmail_extra"><br><div class="gmail_quote">On 18 April 2017 at 15:27, Martell Malone via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: martell<br>
Date: Tue Apr 18 09:27:36 2017<br>
New Revision: 300555<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=300555&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject?rev=300555&view=rev</a><br>
Log:<br>
Driver: Better detection of mingw-gcc<br>
<br>
Stop blindly searching for "gcc.exe" on windows.<br>
Stop assuming "/usr" on unix, fixes cross compiling.<br>
<br>
Reviewers: mati865, yaron.keren<br>
<br>
Subscribers: ismail, rnk<br>
<br>
Differential revision: <a href="https://reviews.llvm.org/D15005" rel="noreferrer" target="_blank">https://reviews.llvm.org/D1500<wbr>5</a><br>
<br>
Modified:<br>
cfe/trunk/lib/Driver/ToolChain<wbr>s/MinGW.cpp<br>
cfe/trunk/lib/Driver/ToolChain<wbr>s/MinGW.h<br>
<br>
Modified: cfe/trunk/lib/Driver/ToolChain<wbr>s/MinGW.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/MinGW.cpp?rev=300555&r1=300554&r2=300555&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/cfe/trunk/lib/Driver/Too<wbr>lChains/MinGW.cpp?rev=300555&r<wbr>1=300554&r2=300555&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/lib/Driver/ToolChain<wbr>s/MinGW.cpp (original)<br>
+++ cfe/trunk/lib/Driver/ToolChain<wbr>s/MinGW.cpp Tue Apr 18 09:27:36 2017<br>
@@ -285,28 +285,30 @@ void toolchains::MinGW::findGccLibD<wbr>ir()<br>
}<br>
}<br>
<br>
+llvm::ErrorOr<std::string> toolchains::MinGW::findGcc() {<br>
+ llvm::SmallVector<llvm::SmallS<wbr>tring<32>, 2> Gccs;<br>
+ Gccs.emplace_back(getTriple().<wbr>getArchName());<br>
+ Gccs[0] += "-w64-mingw32-gcc";<br>
+ Gccs.emplace_back("mingw32-gcc<wbr>");<br>
+ // Please do not add "gcc" here<br>
+ for (StringRef CandidateGcc : Gccs)<br>
+ if (llvm::ErrorOr<std::string> GPPName = llvm::sys::findProgramByName(C<wbr>andidateGcc))<br>
+ return GPPName;<br>
+ return make_error_code(std::errc::no_<wbr>such_file_or_directory);<br>
+}<br>
+<br>
toolchains::MinGW::MinGW(cons<wbr>t Driver &D, const llvm::Triple &Triple,<br>
const ArgList &Args)<br>
: ToolChain(D, Triple, Args), CudaInstallation(D, Triple, Args) {<br>
getProgramPaths().push_back(g<wbr>etDriver().getInstalledDir());<br>
<br>
-// In Windows there aren't any standard install locations, we search<br>
-// for gcc on the PATH. In Linux the base is always /usr.<br>
-#ifdef LLVM_ON_WIN32<br>
if (getDriver().SysRoot.size())<br>
Base = getDriver().SysRoot;<br>
- else if (llvm::ErrorOr<std::string> GPPName =<br>
- llvm::sys::findProgramByName(<wbr>"gcc"))<br>
+ else if (llvm::ErrorOr<std::string> GPPName = findGcc())<br>
Base = llvm::sys::path::parent_path(<br>
llvm::sys::path::parent_path(<wbr>GPPName.get()));<br>
else<br>
Base = llvm::sys::path::parent_path(g<wbr>etDriver().getInstalledDir());<br>
-#else<br>
- if (getDriver().SysRoot.size())<br>
- Base = getDriver().SysRoot;<br>
- else<br>
- Base = "/usr";<br>
-#endif<br>
<br>
Base += llvm::sys::path::get_separator<wbr>();<br>
findGccLibDir();<br>
<br>
Modified: cfe/trunk/lib/Driver/ToolChain<wbr>s/MinGW.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/MinGW.h?rev=300555&r1=300554&r2=300555&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/cfe/trunk/lib/Driver/Too<wbr>lChains/MinGW.h?rev=300555&r1=<wbr>300554&r2=300555&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/lib/Driver/ToolChain<wbr>s/MinGW.h (original)<br>
+++ cfe/trunk/lib/Driver/ToolChain<wbr>s/MinGW.h Tue Apr 18 09:27:36 2017<br>
@@ -93,6 +93,7 @@ private:<br>
mutable std::unique_ptr<tools::gcc::Pr<wbr>eprocessor> Preprocessor;<br>
mutable std::unique_ptr<tools::gcc::Co<wbr>mpiler> Compiler;<br>
void findGccLibDir();<br>
+ llvm::ErrorOr<std::string> findGcc();<br>
};<br>
<br>
} // end namespace toolchains<br>
<br>
<br>
______________________________<wbr>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>