<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, May 15, 2014 at 9:01 AM, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@gmail.com" target="_blank">chandlerc@gmail.com</a>></span> wrote:<br>
<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"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">
<div class="">On Thu, May 15, 2014 at 9:43 AM, Timur Iskhodzhanov <span dir="ltr"><<a href="mailto:timurrrr@google.com" target="_blank">timurrrr@google.com</a>></span> wrote:<br>
<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">This breaks the build on Windows<br>
<br>
FAILED: cmd.exe /c cd /D ...\projects\compiler-rt\lib\asan\tests &&<br>
...\bin\clang-cl.exe<br>
ASAN_INST_TEST_OBJECTS.gtest-all.cc.i386-with-calls.o<br>
ASAN_INST_TEST_OBJECTS.asan_asm_test.cc.i386-with-calls.o<br>
ASAN_INST_TEST_OBJECTS.asan_globals_test.cc.i386-with-calls.o<br>
ASAN_INST_TEST_OBJECTS.asan_interface_test.cc.i386-with-calls.o<br>
ASAN_INST_TEST_OBJECTS.asan_test.cc.i386-with-calls.o<br>
ASAN_INST_TEST_OBJECTS.asan_oob_test.cc.i386-with-calls.o<br>
ASAN_INST_TEST_OBJECTS.asan_mem_test.cc.i386-with-calls.o<br>
ASAN_INST_TEST_OBJECTS.asan_str_test.cc.i386-with-calls.o<br>
ASAN_INST_TEST_OBJECTS.asan_test_main.cc.i386-with-calls.o<br>
-Fe".../projects/compiler-rt/lib/asan/tests/Asan-i386-with-calls-Test"<br>
/machine:X86 /STACK:10000000 -fsanitize=address<br>
clang-cl.exe: error: no such file or directory: '/machine:X86'<br>
<br>
clang-cl.exe: error: no such file or directory: '/STACK:10000000'<br></blockquote><div><br></div></div><div>Is it that you can't use '/' spelled flags after the file arguments? Does the patch here fix? <a href="http://paste2.org/8X69zf0v" target="_blank">http://paste2.org/8X69zf0v</a></div>

<div><br></div><div>I'm asking others to test as well and will commit if i get the indication that this fixes things.</div></div></div></div></blockquote><div><br></div><div>/machine and /stack are linker flags that clang-cl doesn't know about.  The error is misleading, though, and we should fix it.</div>
<div><br></div><div>Generally, MSVC does not invoke the compiler to perform links, so the compiler doesn't have to know about linker flags.  You can send linker flags through the compiler if you put them after /link, like:</div>
<div>clang-cl.exe a.o b.o -Fefoo.exe -fsanitize=address /link /machine:X86 /stack:10000000</div><div><br></div><div>These particular flags aren't actually useful, though.  For now I'd conditionalize this under NOT MSVC.</div>
</div></div></div>