[compiler-rt] r208896 - Teach the compiler-rt custom compilation and linking CMake rules used

Timur Iskhodzhanov timurrrr at google.com
Thu May 15 10:41:55 PDT 2014


Totally agree with what you say.

Please note however that -fsanitize=address is appended later, thus adding
the -link thing doesn't work as link.exe doesn't know about ASan.
At the same time, we do want these "default" flags to come before the
"custom" ones....
Can clang-cl steal -fsanitize=address from the -link flags?
15 мая 2014 г. 21:31 пользователь "Reid Kleckner" <rnk at google.com> написал:

> On Thu, May 15, 2014 at 9:01 AM, Chandler Carruth <chandlerc at gmail.com>wrote:
>
>> On Thu, May 15, 2014 at 9:43 AM, Timur Iskhodzhanov <timurrrr at google.com>wrote:
>>
>>> This breaks the build on Windows
>>>
>>> FAILED: cmd.exe /c cd /D ...\projects\compiler-rt\lib\asan\tests &&
>>> ...\bin\clang-cl.exe
>>> ASAN_INST_TEST_OBJECTS.gtest-all.cc.i386-with-calls.o
>>> ASAN_INST_TEST_OBJECTS.asan_asm_test.cc.i386-with-calls.o
>>> ASAN_INST_TEST_OBJECTS.asan_globals_test.cc.i386-with-calls.o
>>> ASAN_INST_TEST_OBJECTS.asan_interface_test.cc.i386-with-calls.o
>>> ASAN_INST_TEST_OBJECTS.asan_test.cc.i386-with-calls.o
>>> ASAN_INST_TEST_OBJECTS.asan_oob_test.cc.i386-with-calls.o
>>> ASAN_INST_TEST_OBJECTS.asan_mem_test.cc.i386-with-calls.o
>>> ASAN_INST_TEST_OBJECTS.asan_str_test.cc.i386-with-calls.o
>>> ASAN_INST_TEST_OBJECTS.asan_test_main.cc.i386-with-calls.o
>>> -Fe".../projects/compiler-rt/lib/asan/tests/Asan-i386-with-calls-Test"
>>> /machine:X86 /STACK:10000000 -fsanitize=address
>>> clang-cl.exe: error: no such file or directory: '/machine:X86'
>>>
>>> clang-cl.exe: error: no such file or directory: '/STACK:10000000'
>>>
>>
>> Is it that you can't use '/' spelled flags after the file arguments? Does
>> the patch here fix? http://paste2.org/8X69zf0v
>>
>> I'm asking others to test as well and will commit if i get the indication
>> that this fixes things.
>>
>
> /machine and /stack are linker flags that clang-cl doesn't know about.
>  The error is misleading, though, and we should fix it.
>
> 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:
> clang-cl.exe a.o b.o -Fefoo.exe -fsanitize=address /link /machine:X86
> /stack:10000000
>
> These particular flags aren't actually useful, though.  For now I'd
> conditionalize this under NOT MSVC.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140515/d48ed7da/attachment.html>


More information about the llvm-commits mailing list