[llvm-dev] question about xray tls data initialization (original) (raw)

Dean Michael Berris via llvm-dev llvm-dev at lists.llvm.org
Tue Nov 28 01:57:16 PST 2017


On 28 Nov 2017, at 01:15, comic fans <comicfans44 at gmail.com> wrote:

I wonder if I can build xray with clang/llvm-as on windows, seems that is a little easier and requires less changes. but I've not tried yet.

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.

On Fri, Nov 24, 2017 at 8:22 AM, Dean Michael Berris <dean.berris at gmail.com> wrote:

On 23 Nov 2017, at 23:34, comic fans <comicfans44 at gmail.com> wrote: On Wed, Nov 22, 2017 at 10:37 AM, Dean Michael Berris <dean.berris at gmail.com> wrote:

On 22 Nov 2017, at 02:32, comic fans <comicfans44 at gmail.com> wrote: with some dirty hack , I've made xray runtime 'built' on windows , \o/ with more test, I've found that trampoline didn't got built for windows :/ currently cmake didn't generate build rule for asm so its silently ignored(with msvc ide, but not ninja). we must have enablelanguage(ASMMASM) to use masm, and trampoline also need ports. Right -- this is similar to issues we've run into trying to make XRay work / get built for Darwin too. If you're alright with it, maybe you can send some patches to review, preferably through the LLVM Phabricator instance? You can have me or Reid (who knows more about COFF and the Windows stuff) as reviewers. in AsmPrinter, copy/paster xray for coff target InstMap = OutContext.getCOFFSection("xrayinstrmap", 0, SectionKind::getReadOnlyWithRel()); FnSledIndex = OutContext.getCOFFSection("xrayfnidx", 0,SectionKind::getReadOnlyWithRel()); in XRayArgs , allow windows platform to use xray args. with this, generated code seems have sled and xray parts. Nice, I suspect we can make this change with tests as well, which we can build on incrementally. where can I find some examples to test this xray part in llvm ? Those are in the llvm/test/CodeGen/X86/... -- in particular, searching for 'xray' in the files there will be the best way of finding examples of what we're looking for to verify. in xray runtime, bool atomiccompareexchangestrong(volatile atomicsint32t *a, s32 *cmp, s32 xchg, memoryorder mo) is missed for MSVC , I take atomicuint32t implementation This is in compiler-rt/lib/sanitizercommon/... right? yes, sanitizeratomicmsvc.h didn't provide this override. according to msdn of interlockedcompareexchange, implementation for atomicuint32t should also works for atomicsint32t. this is a copy/paste but I think its short enough. any better suggestion ? I'm sure adding an implementation for atomicsint32t will be nice to have across platforms. :) FunctionRecord pack , attribute((packed)) => #pragma pack(push,1), msvc also requires bitfields to be same type to pack them together( all types => uint32t) Are you able to test this on other platforms? I've tested this on linux64 (with clang) and it pass check-xray , but I don't have mac to test. if changing all attribute to pragma is desirable , I can submit a patch for that . We're still working on getting XRay to build right and work on macOS so that shouldn't be a barrier. :) A patch would be good there too. Thanks again! -- Dean

-- Dean

-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171128/4fd00f04/attachment.html>



More information about the llvm-dev mailing list