[Haskell-cafe] Re: Support for lock-free/wait-free programming? / ANN: bits-atomic

Gabriel Wicke wicke at wikidev.net
Mon Aug 30 06:21:21 EDT 2010

On Sun, 29 Aug 2010 13:08:48 -0400, Gregory Collins wrote:

> Gregory Collins <greg at gregorycollins.net> writes:
> ...sigh... The "programs link fine without it" part is a partial lie.
> Anything that the C linker links (i.e. executables) works fine without
> an explicit -lgcc_s, but ghci and compilations using template haskell
> fail with an "unknown symbol `___bswapdi2'", or equivalent.
> Looking for a workaround now.

After some more off-list discussion with Gregory (thanks for your help!) I
split out the atomic operations to the bits-atomic package [1] which no longer
depends on libgcc_s. GCC produces native code for atomic operations, so
libgcc_s is not needed for these operations. 

Additionally, a test suite covering the most important operations is now

I am still looking for a solution to drop the libgcc dependency for
Data.Bits.Extras (which will remain in bits-extras) as well, but this is
harder as the decision whether to use fall-back software implementations
depends on the CPU capabilities.


[1] http://hackage.haskell.org/package/bits-atomic-0.1.0

More information about the Haskell-Cafe mailing list