DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] ci: check C++ headers with clang
@ 2025-07-01 11:31 David Marchand
  2025-07-01 11:37 ` David Marchand
  2025-07-03  8:20 ` [PATCH v2] " David Marchand
  0 siblings, 2 replies; 3+ messages in thread
From: David Marchand @ 2025-07-01 11:31 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson, Aaron Conole, Michael Santana

If not passing an explicit compiler for C++, meson uses c++ which
defaults to /usr/bin/g++ on a Ubuntu system.
Explicitly choose which compiler to use for C++.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
Depends-on: series-35592 ("node: fix C++ compatibility errors (option 2)")

---
 .ci/linux-build.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index e9272d3931..6156fc0e80 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -54,6 +54,12 @@ check_traces() {
 
 cross_file=
 
+if [ "${CC%%clang}" != "$CC" ]; then
+    export CXX=clang++
+else
+    export CXX=g++
+fi
+
 if [ "$AARCH64" = "true" ]; then
     if [ "${CC%%clang}" != "$CC" ]; then
         cross_file=config/arm/arm64_armv8_linux_clang_ubuntu
-- 
2.49.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ci: check C++ headers with clang
  2025-07-01 11:31 [PATCH] ci: check C++ headers with clang David Marchand
@ 2025-07-01 11:37 ` David Marchand
  2025-07-03  8:20 ` [PATCH v2] " David Marchand
  1 sibling, 0 replies; 3+ messages in thread
From: David Marchand @ 2025-07-01 11:37 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson, Aaron Conole, Michael Santana

On Tue, Jul 1, 2025 at 1:33 PM David Marchand <david.marchand@redhat.com> wrote:
>
> If not passing an explicit compiler for C++, meson uses c++ which
> defaults to /usr/bin/g++ on a Ubuntu system.
> Explicitly choose which compiler to use for C++.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
> Depends-on: series-35592 ("node: fix C++ compatibility errors (option 2)")
>
> ---
>  .ci/linux-build.sh | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
> index e9272d3931..6156fc0e80 100755
> --- a/.ci/linux-build.sh
> +++ b/.ci/linux-build.sh
> @@ -54,6 +54,12 @@ check_traces() {
>
>  cross_file=
>
> +if [ "${CC%%clang}" != "$CC" ]; then
> +    export CXX=clang++
> +else
> +    export CXX=g++
> +fi
> +

Looking again, it may be safer to move this block in the
check_includes branch (wrt cross compilation targets, though I would
expect the cross config file to override any CC or CXX variables
content).
But let's see what the CI has to tell with this first revision.

>  if [ "$AARCH64" = "true" ]; then
>      if [ "${CC%%clang}" != "$CC" ]; then
>          cross_file=config/arm/arm64_armv8_linux_clang_ubuntu


-- 
David Marchand


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v2] ci: check C++ headers with clang
  2025-07-01 11:31 [PATCH] ci: check C++ headers with clang David Marchand
  2025-07-01 11:37 ` David Marchand
@ 2025-07-03  8:20 ` David Marchand
  1 sibling, 0 replies; 3+ messages in thread
From: David Marchand @ 2025-07-03  8:20 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson, Aaron Conole, Michael Santana

If not passing an explicit compiler for C++, meson uses c++ which
defaults to /usr/bin/g++ on a Ubuntu system.
Explicitly choose which compiler to use for C++.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
Changes since v1:
- rebased,
- moved CXX tweaking in the branch enabling headers check,

---
 .ci/linux-build.sh | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index e9272d3931..5c4bfa75c3 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -102,9 +102,14 @@ OPTS="$OPTS -Dplatform=generic"
 OPTS="$OPTS -Ddefault_library=$DEF_LIB"
 OPTS="$OPTS -Dbuildtype=$buildtype"
 if [ "$STDATOMIC" = "true" ]; then
-	OPTS="$OPTS -Denable_stdatomic=true"
+    OPTS="$OPTS -Denable_stdatomic=true"
 else
-	OPTS="$OPTS -Dcheck_includes=true"
+    OPTS="$OPTS -Dcheck_includes=true"
+    if [ "${CC%%clang}" != "$CC" ]; then
+        export CXX=clang++
+    else
+        export CXX=g++
+    fi
 fi
 if [ "$MINI" = "true" ]; then
     OPTS="$OPTS -Denable_drivers=net/null"
-- 
2.50.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-07-03  8:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-01 11:31 [PATCH] ci: check C++ headers with clang David Marchand
2025-07-01 11:37 ` David Marchand
2025-07-03  8:20 ` [PATCH v2] " David Marchand

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).