Tyler Retzlaff <roret...@linux.microsoft.com> writes:

> Replace the use of gcc builtin __atomic_xxx intrinsics with
> corresponding rte_atomic_xxx optional rte stdatomic API.
>
> Signed-off-by: Tyler Retzlaff <roret...@linux.microsoft.com>
> ---
>  drivers/net/sfc/meson.build       |  5 ++---
>  drivers/net/sfc/sfc_mae_counter.c | 30 +++++++++++++++---------------
>  drivers/net/sfc/sfc_repr_proxy.c  |  8 ++++----
>  drivers/net/sfc/sfc_stats.h       |  8 ++++----
>  4 files changed, 25 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/net/sfc/meson.build b/drivers/net/sfc/meson.build
> index 5adde68..d3603a0 100644
> --- a/drivers/net/sfc/meson.build
> +++ b/drivers/net/sfc/meson.build
> @@ -47,9 +47,8 @@ int main(void)
>      __int128 a = 0;
>      __int128 b;
>  
> -    b = __atomic_load_n(&a, __ATOMIC_RELAXED);
> -    __atomic_store(&b, &a, __ATOMIC_RELAXED);
> -    __atomic_store_n(&b, a, __ATOMIC_RELAXED);
> +    b = rte_atomic_load_explicit(&a, rte_memory_order_relaxed);
> +    rte_atomic_store_explicit(&b, a, rte_memory_order_relaxed);
>      return 0;
>  }
>  '''

I think this is a case where simple find/replace is a problem.  For
example, this is a sample file that the meson build uses to determine if
libatomic is properly installed.  However, it is very bare-bones.

Your change is likely causing a compile error when cc.links happens in
the meson file.  That leads to the ABI error.

If the goal is to remove all the intrinsics, then maybe a better change
would be dropping this libatomic check from here completely.

WDYT?

Reply via email to