Boost logo

Boost :

Subject: Re: [boost] [lockfree] arm / iOS builds against Boost.Atomic
From: Phil Endecott (spam_from_boost_dev_at_[hidden])
Date: 2013-05-16 11:29:23


Hi Rich,

Rich E wrote:
> I noticed today when moving my work from OS X / clang / libc++ to iOS /
> clang / libc++ that Boost.Lockfree must link against libboost_atomic.a to
> compile. This shouldn't be necessary, since there is std::atomic on iOS as
> well.

I wrote the Boost.Atomic support for ARM.

As you may have noticed, Boost.Atomic was a long time in gestation and
has been
somewhat overtaken by events, i.e. there is vendor-supplied <atomic>
support on
many systems, making Boost.Atomic useful primarily for people who
cannot use
latest versions of compilers. Although I'm still using this code
myself on
iOS and ARM Linux, I probably won't be for much longer.

Having said that, I suggest always checking to see what code is
actually being
generated i.e. is it inline atomic instructions (ldrex & strex on ARM)
or some kind
of library call, even with vendor-supplied <atomic> implementations.
Just look at
the generated assembler for a trivial program. The fact that you're
seeing a
requirement to link with Boost.Atomic suggests that it is not using my
inline-assembler version... explained by this post from Tim:

> not sure if arm supports a double-width compare-and-swap or ll/sc

IIRC, ARMv7and later does - but my code doesn't support it. It could
probably be
added quite easily. I didn't have a platform to test that on when I
wrote it.

Regards, Phil.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk