<div dir="ltr"><div>The &quot;atomic-primops&quot; library depends on symbols such as store_load_barrier and &quot;cas&quot;, which are defined in SMP.h.  Thus the result is that if the program is linked WITHOUT &quot;-threaded&quot;, the user gets a linker error about undefined symbols.</div>

<div><br></div><div>The specific place it&#39;s used is in the &#39;foreign &quot;C&quot;&#39; bits of this .cmm code:</div><div><br></div><div>   <a href="https://github.com/rrnewton/haskell-lockfree-queue/blob/87e63b21b2a6c375e93c30b98c28c1d04f88781c/AtomicPrimops/cbits/primops.cmm">https://github.com/rrnewton/haskell-lockfree-queue/blob/87e63b21b2a6c375e93c30b98c28c1d04f88781c/AtomicPrimops/cbits/primops.cmm</a><br>

</div><div><br></div><div>I&#39;m trying to explore hacks that will enable me to pull in those functions during compile time, without duplicating a whole bunch of code from the RTS.  But it&#39;s a fragile business.</div>

<div><br></div><div>It seems to me that some of these routines have general utility.  In future versions of GHC, could we consider linking in those routines irrespective of &quot;-threaded&quot;?</div><div><br></div><div>

  -Ryan</div><div><br></div></div>