Boost C++ Libraries: Ticket #13569: Broken build on newer versions of LLVM https://svn.boost.org/trac10/ticket/13569 <p> Starting with LLVM <a class="missing changeset" title="No changeset 331746 in the repository">r331746</a>, the use of compare-and-swap on a const object is not allowed. On x86 and Clang, this breaks several places in atomic/detail/ops_gcc_x86_dcas.hpp, like this: </p> <pre class="wiki">if defined(__clang__) // Clang cannot allocate eax:edx register pairs but it has sync intrinsics value = __sync_val_compare_and_swap(&amp;storage, (storage_type)0, (storage_type)0); #elif defined(BOOST_ATOMIC_DETAIL_X86_NO_ASM_AX_DX_PAIRS) ... </pre><p> The use of compare-and-swap is actually a workaround for a Clang limitation which hasn't existed for a long time. Clang versions newer than 4.0.1 understand "=&amp;A" contraints. I am attaching a proposed patch to ops_css_x86_dcas.hpp and config.hpp which detects the Clang version (using a <span class="underline">has_feature), and if it's new enough, uses the "=&amp;A" constraint, otherwise falls back to the existing compare-and-swap. (I had to do a bit of fancy footwork with the #ifs to make this happen.) </span></p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13569 Trac 1.4.3 Emil Gilliam <egilliam@…> Fri, 18 May 2018 21:54:21 GMT attachment set https://svn.boost.org/trac10/ticket/13569 https://svn.boost.org/trac10/ticket/13569 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost-atomic-patch.txt</span> </li> </ul> <p> Patch to Boost to fix compare-and-swap of const object in newer LLVM </p> Ticket Emil Gilliam <egilliam@…> Fri, 18 May 2018 22:04:27 GMT attachment set https://svn.boost.org/trac10/ticket/13569 https://svn.boost.org/trac10/ticket/13569 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost-atomic.patch</span> </li> </ul> <p> IGNORE OTHER ATTACHMENT - file paths are corrected in this patch. </p> Ticket