Proposal: provide cas and barriers symbols even without -threaded

Ryan Newton rrnewton at
Thu Jul 18 15:17:44 CEST 2013

The "atomic-primops" library depends on symbols such as store_load_barrier
and "cas", which are defined in SMP.h.  Thus the result is that if the
program is linked WITHOUT "-threaded", the user gets a linker error about
undefined symbols.

The specific place it's used is in the 'foreign "C"' bits of this .cmm code:

I'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's a fragile business.

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 "-threaded"?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the ghc-devs mailing list