<div dir="ltr">Adding this cflag will not add the clang_rt.profile-*.lib library to the link line. You would have to figure out the proper name for it (similar to how we handle ASan) and add it to the build.<div><br></div><div>In the future, I hope we can simplify compiler-rt's library naming so that all you have to do is add `-lclangrt_profile` or `/defaultlib:clangrt_profile` or something like that and it will just work, instead of having the architecture in the library name.</div></div><br><div class="gmail_quote"><div dir="ltr">‪On Fri, May 11, 2018 at 4:30 AM ‫ניצן חדד‬‎ <<a href="mailto:bhmi12@gmail.com">bhmi12@gmail.com</a>> wrote:‬<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="rtl"><div dir="ltr">Hi Reid,<br></div><div dir="ltr">I just tried compiling chrome-win with -fprofile-instr-generate -Xclang -fcoverage-mapping ( I edited the <a href="http://build.gn" target="_blank">build.gn</a> file in the win toolchain)

, and I get link errors.<br>I don't see any reason why the feature wouldn't work on windows,I am using clang version 7.0.0 (trunk 330570).<br><br>These are the errors I received:<br>LINK(DLL) common.dll common.dll.lib common.dll.pdb<br>FAILED: common.dll common.dll.lib common.dll.pdb<br>C:/src/depot_tools/win_tools-2_7_6_bin/python/bin/python.exe ../../build/toolchain/win/tool_wrapper.py link-wrapper environment.x64 False link.exe /nologo /IMPLIB:./common.dll.lib /DLL /OUT:./common.dll /PDB:./common.dll.pdb @./common.dll.rsp<br>gcm_messages.obj : error LNK2019: unresolved external symbol __llvm_profile_runtime referenced in function __llvm_profile_runtime_user<br>gcm_messages.obj : error LNK2019: unresolved external symbol __llvm_profile_register_function referenced in function __llvm_profile_register_functions<br>gcm_messages.obj : error LNK2019: unresolved external symbol __llvm_profile_register_names_function referenced in function __llvm_profile_register_functions<br>./common.dll : fatal error LNK1120: 3 unresolved externals<br>[693/29165] CXX obj/device/bluetooth/public/mojom/mojom_blink/uuid.mojom-blink.obj<br><br><br>ninja: build stopped: subcommand failed.<br></div><div dir="ltr">Do you have any idea why the chrome build will fail with these flags?<br></div><div dir="ltr">Thanks,<br></div><div dir="ltr">Nitzan<br></div></div><div class="gmail_extra"><div dir="ltr"><br><div class="gmail_quote">2018-05-11 1:31 GMT+03:00 Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 .8ex;border-left:1px #ccc solid;border-right:1px #ccc solid;padding-left:1ex;padding-right:1ex">I made these available in clang-cl in r332053. I have no idea if it works on Windows at all, though. In the meantime, you can probably enable this functionality by escaping the flag with -Xclang -fcoverage-mapping.<div><br></div><div>There isn't any particular reason why flags aren't available in clang-cl. We effectively whitelist gcc-style flags one at a time for inclusion in the clang-cl command line interface. At some point I would like to do something like whitelist all -f flags, since they are unlikely to conflict with future MSVC flags.</div></blockquote></div><br><div class="gmail_quote"><div><div class="m_-5151233779405233381h5"><div dir="ltr">‪On Wed, May 9, 2018 at 5:49 PM ‫ניצן חדד via cfe-dev‬‎ <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:‬<br></div></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-5151233779405233381h5"><div dir="rtl"><div dir="ltr">Hi awesome community,<br></div><div dir="ltr">I am trying to use this feature:<br><a href="https://clang.llvm.org/docs/SourceBasedCodeCoverage.html" target="_blank">https://clang.llvm.org/docs/SourceBasedCodeCoverage.html</a><br></div><div dir="ltr">with clang-cl.exe.<br></div><div dir="ltr">I can see in <a href="https://clang.llvm.org/docs/UsersManual.html#id8" target="_blank">https://clang.llvm.org/docs/UsersManual.html#id8</a> <br>that   -fprofile-instr-generate 

exists in clang-cl interface but -fcoverage-mapping  doesn't exist, even though it does exist in clang++.<br></div><div dir="ltr">Can anyone shed some light on why this feature doesn't exist in clang-cl? it there a plan to future insert it?<br></div><div dir="ltr">Thanks,<br></div><div dir="ltr">Nitzan.<br></div><div dir="ltr"><br><br></div></div></div></div>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div></div></div>
</blockquote></div>