<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On May 20, 2019, at 2:03 PM, Ben Craig <<a href="mailto:ben.craig@ni.com" class="">ben.craig@ni.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">I guess it depends if the goal is to have a spin lock class, or a sharded lock table.<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">If it’s a spin lock class, then someone needs to just make the class and get it into some header and/or static lib somewhere.  The specifics aren’t super important.</div></div></div></blockquote><div><br class=""></div><div>The former.</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">If it’s a sharded lock table, then you need to figure out which dynamic library will provide it, and how that will interact with libc++ when it is used atop libsupc++ or built with GCC.<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="border-style: none none none solid; border-left-width: 1.5pt; border-left-color: blue; padding: 0in 0in 0in 4pt;" class=""><div class=""><div style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(225, 225, 225); padding: 3pt 0in 0in;" class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class="">From:</b><span class="Apple-converted-space"> </span><a href="mailto:jfbastien@apple.com" class="">jfbastien@apple.com</a> <<a href="mailto:jfbastien@apple.com" class="">jfbastien@apple.com</a>><span class="Apple-converted-space"> </span><br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>Monday, May 20, 2019 3:59 PM<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span>Mitch Phillips <<a href="mailto:mitchphillips@outlook.com" class="">mitchphillips@outlook.com</a>><br class=""><b class="">Cc:</b><span class="Apple-converted-space"> </span>Ben Craig <<a href="mailto:ben.craig@ni.com" class="">ben.craig@ni.com</a>>; Olivier Giroux <<a href="mailto:OGiroux@nvidia.com" class="">OGiroux@nvidia.com</a>>; <a href="mailto:libcxx-dev@lists.llvm.org" class="">libcxx-dev@lists.llvm.org</a>; <a href="mailto:kostyak@google.com" class="">kostyak@google.com</a><br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>[EXTERNAL] Re: [libcxx-dev] Is a compiler-rt shared spinlock implementation of any use to libcxx?<o:p class=""></o:p></div></div></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">“Freestanding” is meant for a few things, of which: codebases that can’t have external dependencies, “bare metal” code or other embedded code. This sounds exactly like what you’re after.<o:p class=""></o:p></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">The projects are all in the same repository. You can absolutely depend on having it: it’s in the same repo. You therefore don’t need to duplicate anything.<o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><br class=""><br class=""><o:p class=""></o:p></div><blockquote style="margin-top: 5pt; margin-bottom: 5pt;" class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">On May 20, 2019, at 1:55 PM, Mitch Phillips <<a href="mailto:mitchphillips@outlook.com" style="color: purple; text-decoration: underline;" class="">mitchphillips@outlook.com</a>> wrote:<o:p class=""></o:p></div></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">I'm a little confused about how said aformentioned freestanding implementation would work. We (GWP-ASan + Scudo) can't depend on having libcxx (we actually<span class="Apple-converted-space"> </span><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__reviews.llvm.org_D62048&d=DwMFaQ&c=I_0YwoKy7z5LMTVdyO6YCiE2uzI1jjZZuIPelcSjixA&r=y8mub81SfUi-UCZRX0Vl1g&m=0JDRKupnKG2FyAYi69CfJqswn5ys3q3D8nrjL8eqtQw&s=AgRXbJ1EHKQtYIn_0Ku-RB1v_LizN2Q4nVeZ595pZa8&e=" style="color: purple; text-decoration: underline;" class="">explicitly disable</a><span class="Apple-converted-space"> </span>using of the c++ standard library for these libraries), and I don't know where we could have a shared implementation live (that could be used by both us and libcxx).<o:p class=""></o:p></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Would we have a spinlock implementation in libcxx and have that guarded by a macro definition before the include of <mutex>, and then keep a synchronised version in compiler-rt?<o:p class=""></o:p></div></div></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">On Mon, May 20, 2019 at 10:10 AM Ben Craig <<a href="mailto:ben.craig@ni.com" style="color: purple; text-decoration: underline;" class="">ben.craig@ni.com</a>> wrote:<o:p class=""></o:p></div></div><blockquote style="border-style: none none none solid; border-left-width: 1pt; border-left-color: rgb(204, 204, 204); padding: 0in 0in 0in 6pt; margin-left: 4.8pt; margin-right: 0in;" class=""><div class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Wouldn’t all the Scudo and sanitizer things count as part of the toolchain implementation though?  Having pieces of the toolchain use an alternative name seems pretty reasonable to me.<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> <o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">If the goal is to have a freestanding std::mutex that is implemented as a spin lock, well, that’s different.  I could be convinced that’s a good thing to have, but I’m still a bit uneasy about it.<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> <o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> <o:p class=""></o:p></div><div style="border-style: none none none solid; border-left-width: 1.5pt; border-left-color: blue; padding: 0in 0in 0in 4pt;" class=""><div class=""><div style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(225, 225, 225); padding: 3pt 0in 0in;" class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class="">From:</b><span class="Apple-converted-space"> </span><a href="mailto:jfbastien@apple.com" target="_blank" style="color: purple; text-decoration: underline;" class="">jfbastien@apple.com</a><span class="Apple-converted-space"> </span><<a href="mailto:jfbastien@apple.com" target="_blank" style="color: purple; text-decoration: underline;" class="">jfbastien@apple.com</a>><span class="Apple-converted-space"> </span><br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>Monday, May 20, 2019 11:27 AM<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span>Ben Craig <<a href="mailto:ben.craig@ni.com" target="_blank" style="color: purple; text-decoration: underline;" class="">ben.craig@ni.com</a>><br class=""><b class="">Cc:</b><span class="Apple-converted-space"> </span>Olivier Giroux <<a href="mailto:OGiroux@nvidia.com" target="_blank" style="color: purple; text-decoration: underline;" class="">OGiroux@nvidia.com</a>>; Mitch Phillips <<a href="mailto:mitchphillips@outlook.com" target="_blank" style="color: purple; text-decoration: underline;" class="">mitchphillips@outlook.com</a>>;<span class="Apple-converted-space"> </span><a href="mailto:libcxx-dev@lists.llvm.org" target="_blank" style="color: purple; text-decoration: underline;" class="">libcxx-dev@lists.llvm.org</a>;<a href="mailto:kostyak@google.com" target="_blank" style="color: purple; text-decoration: underline;" class="">kostyak@google.com</a><br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>[EXTERNAL] Re: [libcxx-dev] Is a compiler-rt shared spinlock implementation of any use to libcxx?<o:p class=""></o:p></div></div></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> <o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">I think what developers *use* should definitely be named std::mutex. We indeed want to consider how the ABI is exposed, that’s a good question for libc++ maintainers.<o:p class=""></o:p></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> <o:p class=""></o:p></div><div class=""><p class="MsoNormal" style="margin: 0in 0in 12pt; font-size: 11pt; font-family: Calibri, sans-serif;"><o:p class=""> </o:p></p><blockquote style="margin-top: 5pt; margin-bottom: 5pt;" class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">On May 20, 2019, at 6:23 AM, Ben Craig <<a href="mailto:ben.craig@ni.com" target="_blank" style="color: purple; text-decoration: underline;" class="">ben.craig@ni.com</a>> wrote:<o:p class=""></o:p></div></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> <o:p class=""></o:p></div><div class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">I think it’s fine to give such a class the same interface as std::mutex, just please don’t actually name it std::mutex.  I would be pretty concerned about ABI compatibility in that situation, as well as subtle interactions with things like condition_variable::wait.  cxxabi::__mutex, or almost any other identifier would be fine.<o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> <o:p class=""></o:p></div></div><div style="border-style: none none none solid; border-left-width: 1.5pt; border-left-color: blue; padding: 0in 0in 0in 4pt;" class=""><div class=""><div style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(225, 225, 225); padding: 3pt 0in 0in;" class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class="">From:</b><span class="gmail-m-1501418984181503871apple-converted-space"> </span>libcxx-dev <<a href="mailto:libcxx-dev-bounces@lists.llvm.org" target="_blank" style="color: purple; text-decoration: underline;" class="">libcxx-dev-bounces@lists.llvm.org</a>><span class="gmail-m-1501418984181503871apple-converted-space"> </span><b class="">On Behalf Of<span class="gmail-m-1501418984181503871apple-converted-space"> </span></b>Olivier Giroux via libcxx-dev<br class=""><b class="">Sent:</b><span class="gmail-m-1501418984181503871apple-converted-space"> </span>Friday, May 17, 2019 7:55 PM<br class=""><b class="">To:</b><span class="gmail-m-1501418984181503871apple-converted-space"> </span>JF Bastien <<a href="mailto:jfbastien@apple.com" target="_blank" style="color: purple; text-decoration: underline;" class="">jfbastien@apple.com</a>>; Mitch Phillips <<a href="mailto:mitchphillips@outlook.com" target="_blank" style="color: purple; text-decoration: underline;" class="">mitchphillips@outlook.com</a>><br class=""><b class="">Cc:</b><span class="gmail-m-1501418984181503871apple-converted-space"> </span><a href="mailto:kostyak@google.com" target="_blank" style="color: purple; text-decoration: underline;" class="">kostyak@google.com</a>;<span class="Apple-converted-space"> </span><a href="mailto:libcxx-dev@lists.llvm.org" target="_blank" style="color: purple; text-decoration: underline;" class="">libcxx-dev@lists.llvm.org</a><br class=""><b class="">Subject:</b><span class="gmail-m-1501418984181503871apple-converted-space"> </span>[EXTERNAL] Re: [libcxx-dev] Is a compiler-rt shared spinlock implementation of any use to libcxx?<o:p class=""></o:p></div></div></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> <o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">That’s what makes the most sense to me, include <mutex> with a macro that freestanding would also use. Inside of that, I would have an implementation of standard mutex backed by atomics and the atomic_wait/atomic_notify_* functions, themselves configured with a macro to not rely on the OS in freestanding implementations.<o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> <o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Olivier<o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> <o:p class=""></o:p></div></div><div style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(181, 196, 223); padding: 3pt 0in 0in;" class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span style="font-size: 12pt;" class="">From:<span class="gmail-m-1501418984181503871apple-converted-space"> </span></span></b><span style="font-size: 12pt;" class="">libcxx-dev <<a href="mailto:libcxx-dev-bounces@lists.llvm.org" target="_blank" style="color: purple; text-decoration: underline;" class=""><span style="color: purple;" class="">libcxx-dev-bounces@lists.llvm.org</span></a>> on behalf of JF Bastien via libcxx-dev <<a href="mailto:libcxx-dev@lists.llvm.org" target="_blank" style="color: purple; text-decoration: underline;" class=""><span style="color: purple;" class="">libcxx-dev@lists.llvm.org</span></a>><br class=""><b class="">Reply-To:<span class="gmail-m-1501418984181503871apple-converted-space"> </span></b>JF Bastien <<a href="mailto:jfbastien@apple.com" target="_blank" style="color: purple; text-decoration: underline;" class=""><span style="color: purple;" class="">jfbastien@apple.com</span></a>><br class=""><b class="">Date:<span class="gmail-m-1501418984181503871apple-converted-space"> </span></b>Friday, May 17, 2019 at 4:40 PM<br class=""><b class="">To:<span class="gmail-m-1501418984181503871apple-converted-space"> </span></b>Mitch Phillips <<a href="mailto:mitchphillips@outlook.com" target="_blank" style="color: purple; text-decoration: underline;" class=""><span style="color: purple;" class="">mitchphillips@outlook.com</span></a>><br class=""><b class="">Cc:<span class="gmail-m-1501418984181503871apple-converted-space"> </span></b>"<a href="mailto:kostyak@google.com" target="_blank" style="color: purple; text-decoration: underline;" class=""><span style="color: purple;" class="">kostyak@google.com</span></a>" <<a href="mailto:kostyak@google.com" target="_blank" style="color: purple; text-decoration: underline;" class=""><span style="color: purple;" class="">kostyak@google.com</span></a>>, "<a href="mailto:libcxx-dev@lists.llvm.org" target="_blank" style="color: purple; text-decoration: underline;" class=""><span style="color: purple;" class="">libcxx-dev@lists.llvm.org</span></a>" <<a href="mailto:libcxx-dev@lists.llvm.org" target="_blank" style="color: purple; text-decoration: underline;" class=""><span style="color: purple;" class="">libcxx-dev@lists.llvm.org</span></a>><br class=""><b class="">Subject:<span class="gmail-m-1501418984181503871apple-converted-space"> </span></b>Re: [libcxx-dev] Is a compiler-rt shared spinlock implementation of any use to libcxx?</span><o:p class=""></o:p></div></div></div><div class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> <o:p class=""></o:p></div></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">I think it makes sense for libc++ to have a version of mutex which has the same API as the standard one, but for “freestanding” platforms such as yours. A flavor which mostly just spins and yields as in your review.<o:p class=""></o:p></div></div><div class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> <o:p class=""></o:p></div></div></div><div class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">I’m not sure how to best turn it on, though. Should it be controlled by a macro, and otherwise it just looks like you’re using <mutex>?<o:p class=""></o:p></div></div><div class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> <o:p class=""></o:p></div></div><div class=""><p class="MsoNormal" style="margin: 0in 0in 12pt; font-size: 11pt; font-family: Calibri, sans-serif;"> <o:p class=""></o:p></p><blockquote style="margin-top: 5pt; margin-bottom: 5pt;" class=""><div class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">On May 17, 2019, at 1:49 PM, Mitch Phillips via libcxx-dev <<a href="mailto:libcxx-dev@lists.llvm.org" target="_blank" style="color: purple; text-decoration: underline;" class=""><span style="color: purple;" class="">libcxx-dev@lists.llvm.org</span></a>> wrote:<o:p class=""></o:p></div></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> <o:p class=""></o:p></div></div><div class=""><div class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Hi all,<span class="gmail-m-1501418984181503871apple-converted-space"> </span><o:p class=""></o:p></div></div><div class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> <o:p class=""></o:p></div></div></div><div class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">In a recent<span class="gmail-m-1501418984181503871apple-converted-space"> </span><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__reviews.llvm.org_D61923-231503272&d=DwMGaQ&c=I_0YwoKy7z5LMTVdyO6YCiE2uzI1jjZZuIPelcSjixA&r=y8mub81SfUi-UCZRX0Vl1g&m=yw9dJtPZSvMNi00nrRSUlnN4NTQzKvXzHbd5w8ShH8A&s=uW10gtroz30NxGIUU3BvNH5efGnzv2tds3P49eY5ri4&e=" target="_blank" style="color: purple; text-decoration: underline;" class=""><span style="color: purple;" class="">discussion</span></a><span class="gmail-m-1501418984181503871apple-converted-space"> </span>from the reviews of<span class="gmail-m-1501418984181503871apple-converted-space"> </span><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__reviews.llvm.org_D60593&d=DwMGaQ&c=I_0YwoKy7z5LMTVdyO6YCiE2uzI1jjZZuIPelcSjixA&r=y8mub81SfUi-UCZRX0Vl1g&m=yw9dJtPZSvMNi00nrRSUlnN4NTQzKvXzHbd5w8ShH8A&s=rKVj5vHVGEsEZRjMkiN2X6e0bAfdTY7iVW0laX2AO8o&e=" target="_blank" style="color: purple; text-decoration: underline;" class=""><span style="color: purple;" class="">GWP-ASan</span></a>, it was mentioned that I should probably consult with cxx-dev to see whether they'd be interested in a common spinlock implementation.<o:p class=""></o:p></div></div></div><div class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> <o:p class=""></o:p></div></div></div><div class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">The problem is:<o:p class=""></o:p></div></div></div><div class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> - Scudo hardened allocator (compiler-rt/lib/scudo) requires its own spinlock as it can't use the C++ standard library due to Fuchsia requirements.<o:p class=""></o:p></div></div></div><div class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> - GWP-ASan (as it's packaged into Scudo) also requires a spinlock.<o:p class=""></o:p></div></div></div><div class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> - 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.<o:p class=""></o:p></div></div></div><div class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> <o:p class=""></o:p></div></div></div><div class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">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?<o:p class=""></o:p></div></div></div><div class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> <o:p class=""></o:p></div></div></div><div class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Cheers,<o:p class=""></o:p></div></div></div><div class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Mitch.<o:p class=""></o:p></div></div></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">_______________________________________________<br class="">libcxx-dev mailing list<br class=""><a href="mailto:libcxx-dev@lists.llvm.org" target="_blank" style="color: purple; text-decoration: underline;" class=""><span style="color: purple;" class="">libcxx-dev@lists.llvm.org</span></a><br class=""><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_libcxx-2Ddev&d=DwQGaQ&c=I_0YwoKy7z5LMTVdyO6YCiE2uzI1jjZZuIPelcSjixA&r=y8mub81SfUi-UCZRX0Vl1g&m=yw9dJtPZSvMNi00nrRSUlnN4NTQzKvXzHbd5w8ShH8A&s=SLhw06SYT_9fwfHOjm_nzQZ0LuPvmMe_b2gjd-VEFcc&e=" target="_blank" style="color: purple; text-decoration: underline;" class=""><span style="color: purple;" class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-dev</span></a><o:p class=""></o:p></div></div></div></blockquote></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> <o:p class=""></o:p></div></div></div></div><div class=""><div class="MsoNormal" align="center" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; text-align: center;"><hr size="2" width="100%" align="center" class=""></div></div><div class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">This email message is for the sole use of the intended recipient(s) and may contain confidential information.  Any unauthorized review, use, disclosure or distribution is prohibited.  If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.</div></div></div></div></div></blockquote></div></div></div></div></div></blockquote></div></div></blockquote></div></div></div></div></div></blockquote></div><br class=""></body></html>