patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: stable@dpdk.org
Cc: bluca@debian.org, thomas@monjalon.net, david.marchand@redhat.com,
	xuemingl@nvidia.com,
	Bruce Richardson <bruce.richardson@intel.com>
Subject: [PATCH 21.11] build: detect backtrace availability
Date: Tue, 18 Apr 2023 10:03:23 +0100	[thread overview]
Message-ID: <20230418090323.154351-1-ktraynor@redhat.com> (raw)

From: Thomas Monjalon <thomas@monjalon.net>

[ upstream commit bc1db4f45af35c87e7d97db7a24d479674aa8a43 ]

Backtrace dump is available:
	- always on Windows
	- on Linux/BSD if execinfo.h is available (not anymore on Alpine)

The flag RTE_BACKTRACE was set unconditionally in rte_config.h.
It is now set only if the feature is available.

Note: Alpine Linux has decided to remove libexecinfo support,
so this change will allow to compile DPDK on recent Alpine Linux.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
This is need to fix Alpine Linux compile failure in 21.11 UNH CI [0]
Tested on 21.11-staging branch [1]

Thomas, any objection to backporting this patch?

[0] https://dpdkdashboard.iol.unh.edu/results/dashboard/tarballs/24280/#env-45

Project version: 21.11.4-rc1
C compiler for the host machine: ccache cc
(gcc 12.2.1 "cc (Alpine 12.2.1_git20220924-r4) 12.2.1 20220924")
...
[2604/2949] Compiling C object 'lib/76b5a35@@rte_eal@sta/eal_linux_eal_debug.c.o'.
../lib/eal/linux/eal_debug.c:6:10: fatal error: execinfo.h: No such file or directory
    6 | #include <execinfo.h>
      |          ^~~~~~~~~~~~
compilation terminated.

[1] https://dpdkdashboard.iol.unh.edu/results/dashboard/tarballs/24284/#env-45
---
 config/meson.build                | 3 ++-
 config/rte_config.h               | 1 -
 doc/guides/linux_gsg/sys_reqs.rst | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/config/meson.build b/config/meson.build
index cf3b68a5ce..a79a3ed39c 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -199,8 +199,9 @@ endif
 
 libexecinfo = cc.find_library('execinfo', required: false)
-if libexecinfo.found() and cc.has_header('execinfo.h')
+if libexecinfo.found()
     add_project_link_arguments('-lexecinfo', language: 'c')
     dpdk_extra_ldflags += '-lexecinfo'
 endif
+dpdk_conf.set('RTE_BACKTRACE', cc.has_header('execinfo.h') or is_windows)
 
 libarchive = dependency('libarchive', required: false, method: 'pkg-config')
diff --git a/config/rte_config.h b/config/rte_config.h
index cab4390a97..2f1a3ffb21 100644
--- a/config/rte_config.h
+++ b/config/rte_config.h
@@ -38,5 +38,4 @@
 #define RTE_MAX_TAILQ 32
 #define RTE_LOG_DP_LEVEL RTE_LOG_INFO
-#define RTE_BACKTRACE 1
 #define RTE_MAX_VFIO_CONTAINERS 64
 
diff --git a/doc/guides/linux_gsg/sys_reqs.rst b/doc/guides/linux_gsg/sys_reqs.rst
index cfaa2db301..63990cee86 100644
--- a/doc/guides/linux_gsg/sys_reqs.rst
+++ b/doc/guides/linux_gsg/sys_reqs.rst
@@ -44,5 +44,5 @@ Compilation of the DPDK
     * For RHEL/Fedora systems these can be installed using ``dnf groupinstall "Development Tools"``
     * For Ubuntu/Debian systems these can be installed using ``apt install build-essential``
-    * For Alpine Linux, ``apk add gcc libc-dev bsd-compat-headers libexecinfo-dev``
+    * For Alpine Linux, ``apk add gcc libc-dev bsd-compat-headers``
 
 *   Python 3.5 or later.
-- 
2.39.2


             reply	other threads:[~2023-04-18  9:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-18  9:03 Kevin Traynor [this message]
2023-04-21 14:14 ` Kevin Traynor

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=20230418090323.154351-1-ktraynor@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=bluca@debian.org \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    --cc=xuemingl@nvidia.com \
    /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).