<div>Note that I initially attached the diff to a bug at <a href="http://llvm.org/bugs/show_bug.cgi?id=11278" style="background-color: transparent; ">http://llvm.org/bugs/show_bug.cgi?id=11278</a> but a colleague recommended to me to send it to this list;</div>

<div><br></div><div>---</div><div><br></div><div><div>Try to find clang if gcc is not found</div><div><br></div><div>Repro:</div><div>- On a system without gcc installed (like Windows):</div><div>- Build llvm+clang with MSVS2010. I used MinSizeRel configuration but it</div>

<div>shouldn't matter.</div><div>- Add ...\build\bin\MinSizeRel to PATH to make sure all llvm tools and clang</div><div>are in PATH.</div><div>- echo int main() { return 0; } > hello.c</div><div>- clang -c hello.c -emit-llvm -o hello.bc</div>

<div>- llc -filetype=obj hello.bc</div><div>- llvm-ld hello.obj -o=hello.ld.exe -native</div><div><br></div><div>Result:</div><div>llvm-ld: Failed to find gcc</div><div><br></div><div>Expected:</div><div>Uses clang.</div>

<div><br></div><div>Notes:</div><div>I kept the behavior to try to find gcc first and only fallback to clang if gcc</div><div>is not found to reduce the side-effects of this patch.</div></div>