Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: Mathieu Desnoyers via lttng-dev <lttng-dev@lists.lttng.org>
To: "Ondřej Surý" <ondrej@sury.org>, lttng-dev@lists.lttng.org
Subject: Re: [lttng-dev] [PATCH 1/7] Require __atomic builtins to build
Date: Tue, 21 Mar 2023 15:26:17 -0400	[thread overview]
Message-ID: <3d756c99-195d-1335-e684-974fcc297ae3@efficios.com> (raw)
In-Reply-To: <20230321133102.1054238-2-ondrej@sury.org>

On 2023-03-21 09:30, Ondřej Surý via lttng-dev wrote:
> Add autoconf checks for all __atomic builtins that urcu require, and
> adjust the gcc and clang versions in the README.md.
> 
> Signed-off-by: Ondřej Surý <ondrej@sury.org>
> ---
>   README.md    | 33 +++++++++------------------------
>   configure.ac | 15 +++++++++++++++
>   2 files changed, 24 insertions(+), 24 deletions(-)
> 
> diff --git a/README.md b/README.md
> index ba5bb08..a65a07a 100644
> --- a/README.md
> +++ b/README.md
> @@ -68,30 +68,15 @@ Should also work on:
>   
>   (more testing needed before claiming support for these OS).
>   
> -Linux ARM depends on running a Linux kernel 2.6.15 or better, GCC 4.4 or
> -better.
> -
> -The C compiler used needs to support at least C99. The C++ compiler used
> -needs to support at least C++11.
> -
> -The GCC compiler versions 3.3, 3.4, 4.0, 4.1, 4.2, 4.3, 4.4 and 4.5 are
> -supported, with the following exceptions:
> -
> -  - GCC 3.3 and 3.4 have a bug that prevents them from generating volatile
> -    accesses to offsets in a TLS structure on 32-bit x86. These versions are
> -    therefore not compatible with `liburcu` on x86 32-bit
> -    (i386, i486, i586, i686).
> -    The problem has been reported to the GCC community:
> -    <http://www.mail-archive.com/gcc-bugs@gcc.gnu.org/msg281255.html>
> -  - GCC 3.3 cannot match the "xchg" instruction on 32-bit x86 build.
> -    See <http://kerneltrap.org/node/7507>
> -  - Alpha, ia64 and ARM architectures depend on GCC 4.x with atomic builtins
> -    support. For ARM this was introduced with GCC 4.4:
> -    <http://gcc.gnu.org/gcc-4.4/changes.html>.
> -  - Linux aarch64 depends on GCC 5.1 or better because prior versions
> -    perform unsafe access to deallocated stack.
> -
> -Clang version 3.0 (based on LLVM 3.0) is supported.
> +Linux ARM depends on running a Linux kernel 2.6.15 or better.
> +
> +The C compiler used needs to support at least C99 and __atomic
> +builtins. The C++ compiler used needs to support at least C++11
> +and __atomic builtins.
> +
> +The GCC compiler versions 4.7 or better are supported.
> +
> +Clang version 3.1 (based on LLVM 3.1) is supported.
>   
>   Glibc >= 2.4 should work but the older version we test against is
>   currently 2.17.
> diff --git a/configure.ac b/configure.ac
> index 909cf1d..cb7ba18 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -198,6 +198,21 @@ AC_SEARCH_LIBS([clock_gettime], [rt], [
>     AC_DEFINE([CONFIG_RCU_HAVE_CLOCK_GETTIME], [1], [clock_gettime() is detected.])
>   ])
>   
> +# Require __atomic builtins
> +AC_COMPILE_IFELSE(
> +	[AC_LANG_PROGRAM(
> +		[[int x, y;]],
> +		[[__atomic_store_n(&x, 0, __ATOMIC_RELEASE);
> +		  __atomic_load_n(&x, __ATOMIC_CONSUME);
> +		  y = __atomic_exchange_n(&x, 1, __ATOMIC_ACQ_REL);
> +		  __atomic_compare_exchange_n(&x, &y, 0, 0, __ATOMIC_ACQ_REL, __ATOMIC_CONSUME);
> +		  __atomic_add_fetch(&x, 1, __ATOMIC_ACQ_REL);
> +		  __atomic_sub_fetch(&x, 1, __ATOMIC_ACQ_REL);
> +		  __atomic_and_fetch(&x, 0x01, __ATOMIC_ACQ_REL);
> +		  __atomic_or_fetch(&x, 0x01, __ATOMIC_ACQ_REL);
> +		  __atomic_thread_fence(__ATOMIC_ACQ_REL)]])],

I think we also want to test for __atomic_signal_fence here.

Thanks,

Mathieu


> +	[],
> +	[AC_MSG_ERROR([The compiler does not support __atomic builtins])])
>   
>   ##                             ##
>   ## Optional features selection ##

-- 
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

  reply	other threads:[~2023-03-21 19:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-21 13:30 [lttng-dev] (no subject) Ondřej Surý via lttng-dev
2023-03-21 13:30 ` [lttng-dev] [PATCH 1/7] Require __atomic builtins to build Ondřej Surý via lttng-dev
2023-03-21 19:26   ` Mathieu Desnoyers via lttng-dev [this message]
2023-03-21 13:30 ` [lttng-dev] [PATCH 2/7] Use gcc __atomic builtis for <urcu/uatomic.h> implementation Ondřej Surý via lttng-dev
2023-03-21 20:03   ` Mathieu Desnoyers via lttng-dev
2023-03-21 13:30 ` [lttng-dev] [PATCH 3/7] Use __atomic_signal_fence() for cmm_barrier() Ondřej Surý via lttng-dev
2023-03-21 13:30 ` [lttng-dev] [PATCH 4/7] Replace the internal pointer manipulation with __atomic builtins Ondřej Surý via lttng-dev
2023-03-21 13:31 ` [lttng-dev] [PATCH 5/7] Replace the arch-specific memory barriers " Ondřej Surý via lttng-dev
2023-03-21 20:19   ` Mathieu Desnoyers via lttng-dev
2023-03-21 13:31 ` [lttng-dev] [PATCH 6/7] Use __atomic builtins to implement CMM_{LOAD, STORE}_SHARED Ondřej Surý via lttng-dev
2023-03-21 13:31 ` [lttng-dev] [PATCH 7/7] Fix: uatomic_or() need retyping to uintptr_t in rculfhash.c Ondřej Surý via lttng-dev
  -- strict thread matches above, loose matches on Subject: below --
2023-03-17 21:37 [lttng-dev] [PATCH 0/7] Replace the custom code with gcc/clang __atomic builtins Ondřej Surý via lttng-dev
2023-03-17 21:37 ` [lttng-dev] [PATCH 1/7] Require __atomic builtins to build Ondřej Surý via lttng-dev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3d756c99-195d-1335-e684-974fcc297ae3@efficios.com \
    --to=lttng-dev@lists.lttng.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=ondrej@sury.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox