DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: dev@dpdk.org, david.marchand@redhat.com, stable@dpdk.org
Subject: Re: [PATCH v2] eal: fix C++ builds when stdatomics is set
Date: Tue, 29 Sep 2026 09:23:58 +0200	[thread overview]
Message-ID: <a5GjADT1SeiSQyFkuYrYMQ@monjalon.net> (raw)
In-Reply-To: <20260925124958.44356-1-bruce.richardson@intel.com>

25/09/2026 14:49, Bruce Richardson:
> When the DPDK build is configured to use stdatomics rather than compiler
> builtin atomics, the C++ chkincs builds were failing
> 
> In file included from buildtools/chkincs/staging/generic/rte_atomic.h:18,
>                  from /home/morten/upstreaming/dpdk-stack-std/lib/eal/x86/include/rte_atomic.h:12,
>                  from buildtools/chkincs/chkincs-cpp.p/rte_atomic.cpp:1:
> buildtools/chkincs/staging/rte_stdatomic.h:30:9: error: ‘memory_order’ does not name a type
>    30 | typedef memory_order rte_memory_order;
>       |         ^~~~~~~~~~~~
> 
> The cause is differences in atomics in C (C11) and C++ (e.g. C++17 as
> supported by current GCC). As explained by AI analysis:
> 
>    _Atomic(T) is a C11 feature. In C++ mode, GCC 15 does not support it
>    as a type specifier, and <stdatomic.h> in C++17 doesn't expose
>    memory_order in the global namespace (that's only in C++23). DPDK
>    headers also use _Atomic in anonymous unions and under extern "C",
>    which are incompatible with C++'s std::atomic<T> mapping.
> 
> To fix this in a resilient manner we need to go from two blocks in
> rte_atomic.h to three. We have the existing non-standard/builtin
> atomics path, but the standard atomic path now needs to be split into C
> compatible and C++ compatible blocks. This fixes the build issues with
> C++ while keeping existing C builds unchanged.
> 
> Bugzilla ID: 1985
> Fixes: 5c381a3587d1 ("eal: provide stdatomic API")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Applied, thanks.




      reply	other threads:[~2026-09-29  7:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24 14:12 [PATCH] eal: fix C++ builds when stdatomics is set Bruce Richardson
2026-09-25 10:13 ` David Marchand
2026-09-25 10:54   ` Bruce Richardson
2026-09-25 11:57     ` David Marchand
2026-09-25 12:49 ` [PATCH v2] " Bruce Richardson
2026-09-29  7:23   ` Thomas Monjalon [this message]

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=a5GjADT1SeiSQyFkuYrYMQ@monjalon.net \
    --to=thomas@monjalon.net \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.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