<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 28 Nov 2017, at 01:15, comic fans <<a href="mailto:comicfans44@gmail.com" class="">comicfans44@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">I wonder if I can build xray with clang/llvm-as on windows, seems that<br class="">is a little easier and requires less changes. but I've not tried yet.<br class=""><br class=""></div></div></blockquote><div><br class=""></div><div>That should be something worth the try I think. It's also not entirely a bad idea to still be able to build XRay with MSVC, but only if it's not too hard to get that done.</div><br class=""><blockquote type="cite" class=""><div class=""><div class="">On Fri, Nov 24, 2017 at 8:22 AM, Dean Michael Berris<br class=""><<a href="mailto:dean.berris@gmail.com" class="">dean.berris@gmail.com</a>> wrote:<br class=""><blockquote type="cite" class=""><br class="">On 23 Nov 2017, at 23:34, comic fans <<a href="mailto:comicfans44@gmail.com" class="">comicfans44@gmail.com</a>> wrote:<br class=""><br class="">On Wed, Nov 22, 2017 at 10:37 AM, Dean Michael Berris<br class=""><<a href="mailto:dean.berris@gmail.com" class="">dean.berris@gmail.com</a>> wrote:<br class=""><br class=""><br class="">On 22 Nov 2017, at 02:32, comic fans <<a href="mailto:comicfans44@gmail.com" class="">comicfans44@gmail.com</a>> wrote:<br class=""><br class="">with some dirty hack , I've made xray runtime  'built' on windows ,<br class=""><br class=""><br class="">\o/<br class=""><br class=""><br class="">with more test, I've found that trampoline didn't got built for windows :/<br class="">currently cmake didn't generate build rule for asm so its silently<br class="">ignored(with msvc ide, but not ninja).<br class="">we must have enable_language(ASM_MASM) to use masm, and trampoline<br class="">also need ports.<br class=""><br class=""><br class="">Right -- this is similar to issues we've run into trying to make XRay work /<br class="">get built for Darwin too.<br class=""><br class=""><br class="">If you're alright with it, maybe you can send some patches to review,<br class="">preferably through the LLVM Phabricator instance? You can have me or Reid<br class="">(who knows more about COFF and the Windows stuff) as reviewers.<br class=""><br class="">in AsmPrinter, copy/paster xray for coff target<br class=""><br class="">InstMap = OutContext.getCOFFSection("xray_instr_map", 0,<br class="">SectionKind::getReadOnlyWithRel());<br class="">FnSledIndex = OutContext.getCOFFSection("xray_fn_idx",<br class="">0,SectionKind::getReadOnlyWithRel());<br class=""><br class="">in XRayArgs , allow windows platform to use xray args. with this,<br class="">generated code seems have sled and xray parts.<br class=""><br class=""><br class="">Nice, I suspect we can make this change with tests as well, which we can<br class="">build on incrementally.<br class=""><br class=""><br class="">where can I find some examples to test this xray part in llvm ?<br class=""><br class=""><br class="">Those are in the llvm/test/CodeGen/X86/... -- in particular, searching for<br class="">'xray_' in the files there will be the best way of finding examples of what<br class="">we're looking for to verify.<br class=""><br class=""><br class="">in xray runtime,<br class="">bool atomic_compare_exchange_strong(volatile atomic_sint32_t *a,<br class="">                                         s32 *cmp,<br class="">                                         s32 xchg,<br class="">                                         memory_order mo)<br class="">is missed for MSVC , I take atomic_uint32_t implementation<br class=""><br class=""><br class="">This is in compiler-rt/lib/sanitizer_common/... right?<br class=""><br class=""><br class="">yes, sanitizer_atomic_msvc.h didn't provide this override. according<br class="">to msdn of interlockedcompareexchange,  implementation for<br class="">atomic_uint32_t should also works for atomic_sint32_t. this is a<br class="">copy/paste but I think its short enough. any better suggestion ?<br class=""><br class=""><br class="">I'm sure adding an implementation for atomic_sint32_t will be nice to have<br class="">across platforms. :)<br class=""><br class=""><br class="">FunctionRecord pack , __attribute__((packed)) =>  #pragma<br class="">pack(push,1),  msvc also requires bitfields to be same type to pack<br class="">them together( all types => uint32_t)<br class=""><br class=""><br class="">Are you able to test this on other platforms?<br class=""><br class=""><br class="">I've tested this on linux64 (with clang) and it pass check-xray , but<br class="">I don't have mac to test. if changing all attribute to pragma is<br class="">desirable , I can submit a patch for that .<br class=""><br class=""><br class="">We're still working on getting XRay to build right and work on macOS so that<br class="">shouldn't be a barrier. :)<br class=""><br class="">A patch would be good there too.<br class=""><br class="">Thanks again!<br class=""><br class="">-- Dean<br class=""><br class=""></blockquote></div></div></blockquote></div><br class=""><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">-- Dean</div></div>

</div>
<br class=""></body></html>