<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">I did a small research and was able to compile a small example with clang-cl and asan.<div>Here are the flags I had to set manually:</div><div><p style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: ".SF UI";"><span style="font-family: ".SFUI-Regular";"><br></span></p><p style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: ".SF UI";"><span style="font-family: ".SFUI-Regular";">cpp.optimization: "none"</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: ".SF UI";"><span style="font-family: ".SFUI-Regular";">    cpp.cxxFlags: [</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: ".SF UI";"><span style="font-family: ".SFUI-Regular";">        "/MT",</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: ".SF UI";"><span style="font-family: ".SFUI-Regular";">        "-fsanitize=address",</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: ".SF UI";"><span style="font-family: ".SFUI-Regular";">    ]</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: ".SF UI";"><span style="font-family: ".SFUI-Regular";">    cpp.linkerFlags: [</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: ".SF UI";"><span style="font-family: ".SFUI-Regular";">        "-wholearchive:C:\\Developer\\LLVM\\lib\\clang\\8.0.0\\lib\\windows\\clang_rt.asan-x86_64.lib",</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: ".SF UI";"><span style="font-family: ".SFUI-Regular";">        "-wholearchive:C:\\Developer\\LLVM\\lib\\clang\\8.0.0\\lib\\windows\\clang_rt.asan_cxx-x86_64.lib",</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: ".SF UI";"><span style="font-family: ".SFUI-Regular";">    ]</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: ".SF UI";"><span style="font-family: ".SFUI-Regular";">    cpp.staticLibraries: [</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: ".SF UI";"><span style="font-family: ".SFUI-Regular";">        "C:\\Developer\\LLVM\\lib\\clang\\8.0.0\\lib\\windows\\clang_rt.asan-x86_64.lib",</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: ".SF UI";"><span style="font-family: ".SFUI-Regular";">        "C:\\Developer\\LLVM\\lib\\clang\\8.0.0\\lib\\windows\\clang_rt.asan_cxx-x86_64.lib",</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: ".SF UI";"><span style="font-family: ".SFUI-Regular";">    ]</span></p><div><br></div><div>Probably, we should add some support for that in Qbs...</div><div>The problem is that qbs calls the linker directly (which is not the same clang-cl uses), maybe it’s worth using clang-cl for linking... or just add support for the usual clang with msvc ABI (I have plans for that for 1.16)</div><br><div dir="ltr">Иван Комиссаров</div><div dir="ltr"><br><blockquote type="cite">28 нояб. 2019 г., в 15:53, Christian Kandeler <Christian.Kandeler@qt.io> написал(а):<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><span>On Thu, 28 Nov 2019 18:58:54 +0500</span><br><span>Dan Pat <dannix84@gmail.com> wrote:</span><br><span></span><br><blockquote type="cite"><span>Hello. I am trying to use Asan in my project (windows 10, clang-cl).</span><br></blockquote><blockquote type="cite"><span>There's a requirement for the Asan import library to appear first in the</span><br></blockquote><blockquote type="cite"><span>linker's list of import libraries. </span><br></blockquote><span></span><br><span>Who imposes that requirement and why?</span><br><span></span><br><blockquote type="cite"><span>I cannot seem to find a way to achieve this with qbs. Any suggestions?</span><br></blockquote><span></span><br><span>If you are sure it's really, really needed, you can use a Properties item in your product with e.g. cpp.dynamicLibraries (https://doc.qt.io/qbs/qml-qbslanguageitems-properties.html#overrideListProperties-prop), but then you will have to list *all* libraries there.</span><br><span></span><br><span></span><br><span>Christian</span><br><span>_______________________________________________</span><br><span>Qbs mailing list</span><br><span>Qbs@qt-project.org</span><br><span>https://lists.qt-project.org/listinfo/qbs</span><br></div></blockquote></div></body></html>