<div dir="ltr">Hi all,<div><br></div><div>In a recent <a href="https://reviews.llvm.org/D61923#1503272">discussion</a> from the reviews of <a href="https://reviews.llvm.org/D60593">GWP-ASan</a>, it was mentioned that I should probably consult with cxx-dev to see whether they'd be interested in a common spinlock implementation.</div><div><br></div><div>The problem is:</div><div> - Scudo hardened allocator (compiler-rt/lib/scudo) requires its own spinlock as it can't use the C++ standard library due to Fuchsia requirements.</div><div> - GWP-ASan (as it's packaged into Scudo) also requires a spinlock.</div><div> - Compiler-rt sanitizer_common also can't use c++ stdlib, and has its own spinlock. We can't reuse the sanitizer_common spinlock for Scudo/GWP-ASan as it's currently tightly coupled into sanitizer_common, and Scudo+Fuchsia can't afford the code size overhead of pulling the entire sanitizer_common library.</div><div><br></div><div>The plan was to basically write a small standalone spinlock implementation that can be used by all three of these requirements. Would libcxx benefit by us making this an llvm-common spinlock rather than compiler-rt-common? If so, are there any requirements that we need to be aware of?</div><div><br></div><div>Cheers,</div><div>Mitch.</div></div>