<div dir="ltr"><blockquote style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex" class="gmail_quote">Searching for gcc on Linux is not a good idea, you'll find the system one not the mingw one. Searching for i686-w64-mingw32-gcc or <span style="font-size:12.8px">x86_64-w64-mingw32-gcc </span>should work better, that is searching for:<br>  getTriple().getArchName()) + "-w64-mingw32-gcc"</blockquote><div><blockquote style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex" class="gmail_quote">Moreover, this should work on Windows as well, mingw-w64 distribution has [i686|x86_64]-w64-mingw32-gcc.exe at the same location as gcc.exe. For this you can unite the code for both Linux and Windows. <br></blockquote><div>Agreed this makes most sense.<br><br></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex" class="gmail_quote">To continue supporting <a href="http://mingw.org/" target="_blank">mingw.org</a>, if this search fails, search for mingw32-gcc.</blockquote></div><div>I'll make a patch for review, I won't be able todo it until the weekend because of work but I will get to it</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 24, 2015 at 7:03 AM, Yaron Keren <span dir="ltr"><<a href="mailto:yaron.keren@gmail.com" target="_blank">yaron.keren@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="rtl"><div dir="ltr">Searching for gcc on Linux is not a good idea, you'll find the system one not the mingw one. Searching for i686-w64-mingw32-gcc or <span style="font-size:12.8px">x86_64-w64-mingw32-gcc </span>should work better, that is searching for:</div><div dir="ltr"><br></div><div dir="ltr">  getTriple().getArchName()) + "-w64-mingw32-gcc"<br></div><div dir="ltr"><br></div><div dir="ltr">Moreover, this should work on Windows as well, mingw-w64 distribution has [i686|x86_64]-w64-mingw32-gcc.exe at the same location as gcc.exe. For this you can unite the code for both Linux and Windows. </div><div dir="ltr"><br></div><div dir="ltr">To continue supporting <a href="http://mingw.org" target="_blank">mingw.org</a>, if this search fails, search for mingw32-gcc.<br></div><div dir="ltr"><br></div><div dir="ltr"><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><div dir="ltr"><br><div class="gmail_quote">2015-11-24 16:36 GMT+02:00 Martell Malone <span dir="ltr"><<a href="mailto:martellmalone@gmail.com" target="_blank">martellmalone@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style="font-size:12.8px">Why not hardcode /usr for Linux hosts?</span></blockquote></span><div>Portable toolchain packages exist but can't on linux if you do this.<br></div><div>but in general I'm sure most would agree that detection is much better then hard coding.<br></div>This is why Yaron approved the patch<br><br></div><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style="font-size:12.8px">Well this is a custom clang it can be anywhere. Official one is in /usr.</span></blockquote></span><div>This means that your earlier statement of "<span style="font-size:12.8px">This breaks mingw support on openSUSE" is incorrect.</span><br>The official SUSE packages still work with this patch.<br><br><span style="font-size:12.8px">More accurately it breaks your setup of having clang and mingw-w64 in 2 completely separate install locations.<br>Which is not a typical use case even for gcc and one would be expected to pass a sysroot for this.<br><br>For a more immediate solution for your specific setup I would create a bash script called</span></div><div><span style="font-size:12.8px">x86_64-w64-mingw32-clang</span></div><div><span style="font-size:12.8px">with this content like this</span></div><div><div>#!/usr/bin/env bash</div><div>/opt/bin/clang -target x86_64-windows-gnu -sysroot=/usr "$@"</div></div><div><br></div><div>It seems as though SUSE''s binutils is built with sysroot so this should be acceptable<br><a href="https://build.opensuse.org/package/view_file/windows:mingw:win64/mingw64-cross-binutils/mingw64-binutils.spec?expand=1" target="_blank">https://build.opensuse.org/package/view_file/windows:mingw:win64/mingw64-cross-binutils/mingw64-binutils.spec?expand=1</a><br><br>Other then that we should wait for Yaron's thoughts on mingw-gcc detection on linux :)</div><div><br><br></div></blockquote></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 24, 2015 at 2:53 AM, Ismail Donmez <span dir="ltr"><<a href="mailto:ismail@i10z.com" target="_blank">ismail@i10z.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On Tue, Nov 24, 2015 at 12:43 PM, Martell Malone<br>
<<a href="mailto:martellmalone@gmail.com" target="_blank">martellmalone@gmail.com</a>> wrote:<br>
>> This breaks mingw support on openSUSE :<br>
><br>
> My first question is why on SUSE is clang installed in /opt while mingw-w64<br>
> in /usr?<br>
<br>
</span>Well this is a custom clang it can be anywhere. Official one is in /usr.<br>
<span><br>
>> x86_64-w64-mingw32-gcc is in $PATH, and this used to work fine before<br>
>> this commit.<br>
><br>
> It doesn't look for gcc on linux that is a windows host only thing.<br>
> It didn't do that before this commit also.<br>
> SUSE was just lucky because we hard coded /usr as the base path.<br>
<br>
</span>This is not a SUSE only thing, afaik Fedora has the same setup.<br>
<span><br>
> I don't like the idea of hard coding for just a single distro so I think<br>
> We could optionally do some search for "x86_64-w64-mingw32-gcc" on non<br>
> windows hosts<br>
> Just like we do for "gcc" on windows hosts.<br>
> This should fix SUSE while maintaining the new more reasonable search<br>
> pattern.<br>
<br>
</span>Why not hardcode /usr for Linux hosts?<br>
<br>
Thanks,<br>
ismail<br>
</blockquote></div><br></div>
</div></div></div></div>
</div></div></blockquote></div><br></div>