lttng-dev.lists.lttng.org archive mirror
 help / color / mirror / Atom feed
From: "Ondřej Surý via lttng-dev" <lttng-dev@lists.lttng.org>
To: lttng-dev@lists.lttng.org
Subject: [lttng-dev] [PATCH 1/7] Require __atomic builtins to build
Date: Fri, 17 Mar 2023 22:37:49 +0100	[thread overview]
Message-ID: <20230317213755.455957-2-ondrej@sury.org> (raw)
In-Reply-To: <20230317213755.455957-1-ondrej@sury.org>

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)]])],
+	[],
+	[AC_MSG_ERROR([The compiler does not support __atomic builtins])])
 
 ##                             ##
 ## Optional features selection ##
-- 
2.39.2

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

  reply	other threads:[~2023-03-17 21:38 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Ondřej Surý via lttng-dev [this message]
2023-03-17 21:37 ` [lttng-dev] [PATCH 2/7] Use gcc __atomic builtis for <urcu/uatomic.h> implementation Ondřej Surý via lttng-dev
2023-03-20 18:03   ` Mathieu Desnoyers via lttng-dev
2023-03-20 18:13     ` Mathieu Desnoyers via lttng-dev
2023-03-20 18:28     ` Ondřej Surý via lttng-dev
2023-03-20 18:38       ` Mathieu Desnoyers via lttng-dev
2023-03-20 18:41         ` Mathieu Desnoyers via lttng-dev
2023-03-20 19:38     ` Duncan Sands via lttng-dev
2023-03-21 20:26       ` Mathieu Desnoyers via lttng-dev
2023-03-22  8:24         ` Duncan Sands via lttng-dev
2023-03-17 21:37 ` [lttng-dev] [PATCH 3/7] Use __atomic_thread_fence() for cmm_barrier() Ondřej Surý via lttng-dev
2023-03-20 18:06   ` Mathieu Desnoyers via lttng-dev
2023-03-20 18:14     ` Mathieu Desnoyers via lttng-dev
2023-03-17 21:37 ` [lttng-dev] [PATCH 4/7] Replace the internal pointer manipulation with __atomic builtins Ondřej Surý via lttng-dev
2023-03-20 18:25   ` Mathieu Desnoyers via lttng-dev
2023-03-17 21:37 ` [lttng-dev] [PATCH 5/7] Use __atomic builtins to implement CMM_{LOAD, STORE}_SHARED Ondřej Surý via lttng-dev
2023-03-20 18:28   ` Mathieu Desnoyers via lttng-dev
2023-03-17 21:37 ` [lttng-dev] [PATCH 6/7] Fix: uatomic_or() need retyping to uintptr_t in rculfhash.c Ondřej Surý via lttng-dev
2023-03-20 18:31   ` Mathieu Desnoyers via lttng-dev
2023-03-21 10:15     ` Ondřej Surý via lttng-dev
2023-03-21 14:44       ` Mathieu Desnoyers via lttng-dev
2023-03-21 14:45         ` Mathieu Desnoyers via lttng-dev
2023-03-17 21:37 ` [lttng-dev] [PATCH 7/7] Experiment: Add explicit memory barrier in free_completion() Ondřej Surý via lttng-dev
2023-03-20 18:37   ` Mathieu Desnoyers via lttng-dev
2023-03-21 10:21     ` Ondřej Surý via lttng-dev
2023-03-21 14:46       ` Mathieu Desnoyers via lttng-dev
2023-03-21 14:48         ` Ondřej Surý via lttng-dev
2023-03-21 14:49           ` Mathieu Desnoyers via lttng-dev
2023-03-21 14:59             ` [lttng-dev] TSAN and the tests Ondřej Surý via lttng-dev
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

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=20230317213755.455957-2-ondrej@sury.org \
    --to=lttng-dev@lists.lttng.org \
    --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;
as well as URLs for NNTP newsgroup(s).