Merging r181728:
------------------------------------------------------------------------
r181728 | rafael | 2013-05-13 13:09:47 -0700 (Mon, 13 May 2013) | 6 lines

Use atomic instructions on ARM linux.

This is safe given how the pre-v6 atomic ops funcions in libgcc are
implemented.

This fixes pr15429.
------------------------------------------------------------------------
Merging r181750:
------------------------------------------------------------------------
r181750 | rafael | 2013-05-13 17:44:24 -0700 (Mon, 13 May 2013) | 4 lines

Use atomic instructions on linux thumb v7.

This matches gcc's behaviour. The patch also explicitly parses the version so
that this keeps working when we add support for v8.
------------------------------------------------------------------------
Merging r181909:
------------------------------------------------------------------------