Package: libatomic-ops-dev Version: 7.4.2-1 Tags: patch
On the hppa/parisc platform we would like to switch from hand-crafted atomic ops to the gcc atomic builtins which do come with gcc-4.9 and higher. Main motivations are: 1. The current implementation is not really SMP-safe (due to the problematic architecture itself). We implemented a kernel-helper which is called by the gcc builtin atomic ops and which really gives atomic locking on hppa now. 2. Many other debian packages fail to link in the additional archive files (from libatomic-ops package) which are needed on hppa. Switching to the gcc builtins does not require additional archive files, since everything comes with libgcc which is linked in anyway. Please apply this patch for the next upload. Thanks, Helge
diff -up ./src/atomic_ops/sysdeps/gcc/hppa.h.org ./src/atomic_ops/sysdeps/gcc/hppa.h --- ./src/atomic_ops/sysdeps/gcc/hppa.h.org 2015-05-12 16:38:06.845160096 +0200 +++ ./src/atomic_ops/sysdeps/gcc/hppa.h 2015-05-13 12:08:50.858028368 +0200 @@ -20,6 +20,18 @@ * SOFTWARE. */ + +#define AO_GCC_VERSION_AT_LEAST(x,y) (__GNUC__ > x || __GNUC__ == x && __GNUC_MINOR__ >= y) + +#if defined(__GNUC__) && AO_GCC_VERSION_AT_LEAST(4,9) + +#include "../test_and_set_t_is_ao_t.h" +/* We do not want to enable the atomic add/sub functions yet - they are slow */ +#define AO_PREFER_GENERALIZED +#include "generic.h" + +#else + #include "../all_atomic_load_store.h" /* Some architecture set descriptions include special "ordered" memory */ @@ -87,3 +99,6 @@ AO_pa_clear(volatile AO_TS_t * addr) *a = 1; } #define AO_CLEAR(addr) AO_pa_clear(addr) + +#endif /* __GNUC__ >= 4.9 */ +