DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net, Aaron Conole <aconole@redhat.com>,
	Michael Santana <maicolgabriel@hotmail.com>,
	Bruce Richardson <bruce.richardson@intel.com>
Subject: [PATCH] ci: test stdatomic API
Date: Fri, 29 Sep 2023 16:15:10 +0200	[thread overview]
Message-ID: <20230929141510.3114938-1-david.marchand@redhat.com> (raw)

Add some compilation tests with C11 atomics enabled.
The headers check can't be enabled (as gcc and clang don't provide
stdatomic before C++23).

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 .ci/linux-build.sh            | 6 +++++-
 .github/workflows/build.yml   | 8 ++++++++
 devtools/test-meson-builds.sh | 3 +++
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index e0b62bac90..b09df07b55 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -92,7 +92,11 @@ fi
 OPTS="$OPTS -Dplatform=generic"
 OPTS="$OPTS -Ddefault_library=$DEF_LIB"
 OPTS="$OPTS -Dbuildtype=$buildtype"
-OPTS="$OPTS -Dcheck_includes=true"
+if [ "$STDATOMIC" = "true" ]; then
+	OPTS="$OPTS -Denable_stdatomic=true"
+else
+	OPTS="$OPTS -Dcheck_includes=true"
+fi
 if [ "$MINI" = "true" ]; then
     OPTS="$OPTS -Denable_drivers=net/null"
     OPTS="$OPTS -Ddisable_libs=*"
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 7a2ac0ceee..14328622fb 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -30,6 +30,7 @@ jobs:
       REF_GIT_TAG: none
       RISCV64: ${{ matrix.config.cross == 'riscv64' }}
       RUN_TESTS: ${{ contains(matrix.config.checks, 'tests') }}
+      STDATOMIC: ${{ contains(matrix.config.checks, 'stdatomic') }}
 
     strategy:
       fail-fast: false
@@ -38,6 +39,12 @@ jobs:
           - os: ubuntu-20.04
             compiler: gcc
             mini: mini
+          - os: ubuntu-20.04
+            compiler: gcc
+            checks: stdatomic
+          - os: ubuntu-20.04
+            compiler: clang
+            checks: stdatomic
           - os: ubuntu-20.04
             compiler: gcc
             checks: debug+doc+examples+tests
@@ -241,6 +248,7 @@ jobs:
         > ~/env
         echo CC=ccache ${{ matrix.config.compiler }} >> ~/env
         echo DEF_LIB=${{ matrix.config.library }} >> ~/env
+        echo STDATOMIC=false >> ~/env
     - name: Load the cached image
       run: |
         docker load -i ~/.image/${{ matrix.config.image }}.tar
diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index c41659d28b..ca32e3d5a5 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -239,6 +239,9 @@ done
 build build-mini cc skipABI $use_shared -Ddisable_libs=* \
 	-Denable_drivers=net/null
 
+build build-gcc-shared-stdatomic gcc skipABI -Denable_stdatomic=true $use_shared
+build build-clang-shared-stdatomic clang skipABI -Denable_stdatomic=true $use_shared
+
 # test compilation with minimal x86 instruction set
 # Set the install path for libraries to "lib" explicitly to prevent problems
 # with pkg-config prefixes if installed in "lib/x86_64-linux-gnu" later.
-- 
2.41.0


             reply	other threads:[~2023-09-29 14:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-29 14:15 David Marchand [this message]
2023-09-29 20:20 ` Aaron Conole
2023-10-17  7:15 ` [PATCH v2] " David Marchand
2023-10-17  9:05   ` David Marchand

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=20230929141510.3114938-1-david.marchand@redhat.com \
    --to=david.marchand@redhat.com \
    --cc=aconole@redhat.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=maicolgabriel@hotmail.com \
    --cc=thomas@monjalon.net \
    /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).