public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Victor Kamensky <victor.kamensky7@gmail.com>
To: systemtap@sourceware.org
Cc: "Frank Ch . Eigler" <fche@redhat.com>,
	Victor Kamensky <victor.kamensky7@gmail.com>
Subject: [PATCH 1/2] configure.ac: fix broken libdebuginfod library auto detection
Date: Sun, 17 Dec 2023 21:01:34 -0800	[thread overview]
Message-ID: <20231218050135.12565-1-victor.kamensky7@gmail.com> (raw)

After 2e67b053e3796ee7cf29a39f9698729b52078406 "configury: rework debuginfod searches"
commit, libdebuginfod.so library auto detection is broken. It was reported by Martin Jansa
on openembedded-core mailing list [1].

Currently configure.ac does "AC_DEFINE([HAVE_LIBDEBUGINFOD], [1] ..." as long as
no --without-debuginfod option is passed, regardless PKG_CHECK_MODULES check result.
It seems to be bad copy/paste. Address the issue by moving the AC_DEFINE back to
PKG_CHECK_MODULES action-if-found block.

To reproduce the issue on FC system, one can do the following
"sudo dnf remove elfutils-debuginfod-client-devel" and then try to build SystemTap
util.cxx will fail to compile because of missing elfutils/debuginfod.h because
config.h will have "#define HAVE_LIBDEBUGINFOD 1", while config.log and configure
output indicates that check for libdebuginfod library failed.

[1] https://lists.openembedded.org/g/openembedded-core/message/192109?p=%2C%2C%2C20%2C0%2C0%2C0%3A%3Acreated%2C0%2Csystemtap%2C20%2C2%2C0%2C102987514

Signed-off-by: Victor Kamensky <victor.kamensky7@gmail.com>
---
 configure.ac | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index d9559c5c3..18cd7f84a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -219,12 +219,11 @@ dnl take the user at his or her word
 elif test "x$with_debuginfod" != xno; then
 dnl check in the system pkgconfig
   PKG_CHECK_MODULES([debuginfod], [libdebuginfod >= 0.179],
-    [have_debuginfod=1],
+    [have_debuginfod=1
+     AC_DEFINE([HAVE_LIBDEBUGINFOD], [1], [Define to 1 if debuginfod is enabled.])],
     [if test "x$with_debuginfod" = xyes; then
        AC_MSG_ERROR(["--with-debuginfod was given, but libdebuginfod is missing or unusable."])
      fi])
-  AC_DEFINE([HAVE_LIBDEBUGINFOD], [1], [Define to 1 if debuginfod is enabled.])
-  AC_MSG_RESULT([yes])  
 else
   AC_MSG_RESULT([no])
 fi
-- 
2.31.1


             reply	other threads:[~2023-12-18  5:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-18  5:01 Victor Kamensky [this message]
2023-12-18  5:01 ` [PATCH 2/2] Makefile.am: fix build with --with-debuginfod=/path configure option Victor Kamensky
2023-12-21 15:09   ` Frank Ch. Eigler
2023-12-21 14:58 ` [PATCH 1/2] configure.ac: fix broken libdebuginfod library auto detection Frank Ch. Eigler

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=20231218050135.12565-1-victor.kamensky7@gmail.com \
    --to=victor.kamensky7@gmail.com \
    --cc=fche@redhat.com \
    --cc=systemtap@sourceware.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 read-only IMAP folder(s) and NNTP newsgroup(s).