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 2/2] Makefile.am: fix build with --with-debuginfod=/path configure option
Date: Sun, 17 Dec 2023 21:01:35 -0800	[thread overview]
Message-ID: <20231218050135.12565-2-victor.kamensky7@gmail.com> (raw)
In-Reply-To: <20231218050135.12565-1-victor.kamensky7@gmail.com>

While I was testing my previous fix with libdebuginfod auto detection
failure I've noticed that configure option --with-debuginfod=/path does
not work in case if system does not have elfutils-debuginfod-client-devel.

I had external elfutils branch with debuginfod metadata change installed
at /path and when I've tried to build SystemTap with it, it was failing
in multiple places. My system is FC38.

It boils dows for couple issues applied in serveral Makefile.am files.

1. util.cxx is C++ file so debuginfod_CFLAGS should be added to _CXXFLAGS
flags, rather then just _CFLAGS

2. debuginfod_LDFLAGS should be added to _LDFLAGS, otherwise link command
does not get proper -L flag

Note this patch fixes only proper Makefile.am, someone would need to run
autoreconf and commit proper regenerated configure and Makefile.in files.

Signed-off-by: Victor Kamensky <victor.kamensky7@gmail.com>
---
 Makefile.am         | 16 ++++++++--------
 stapbpf/Makefile.am |  4 ++--
 stapdyn/Makefile.am |  8 ++++----
 staprun/Makefile.am |  4 ++--
 4 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 2ba896088..cfa693e65 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -188,9 +188,9 @@ if BUILD_TRANSLATOR
 if HAVE_NSS
 stap_sign_module_SOURCES = stap-sign-module.cxx nsscommon.cxx util.cxx
 stap_sign_module_CPPFLAGS = $(AM_CPPFLAGS)
-stap_sign_module_CXXFLAGS = $(AM_CXXFLAGS) @PIECXXFLAGS@ $(nss_CFLAGS)
+stap_sign_module_CXXFLAGS = $(AM_CXXFLAGS) @PIECXXFLAGS@ $(nss_CFLAGS) $(debuginfod_CFLAGS)
 stap_sign_module_CFLAGS = $(AM_CFLAGS) @PIECFLAGS@ $(nss_CFLAGS) $(debuginfod_CFLAGS)
-stap_sign_module_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@
+stap_sign_module_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@ $(debuginfod_LDFLAGS)
 stap_sign_module_LDADD = $(nss_LIBS) $(debuginfod_LIBS)
 if HAVE_HTTP_SUPPORT
 stap_sign_module_LDADD += $(openssl_LIBS)
@@ -198,9 +198,9 @@ endif
 
 stap_authorize_cert_SOURCES = stap-authorize-cert.cxx nsscommon.cxx util.cxx
 stap_authorize_cert_CPPFLAGS = $(AM_CPPFLAGS)
-stap_authorize_cert_CXXFLAGS = $(AM_CXXFLAGS) @PIECXXFLAGS@ $(nss_CFLAGS)
+stap_authorize_cert_CXXFLAGS = $(AM_CXXFLAGS) @PIECXXFLAGS@ $(nss_CFLAGS) $(debuginfod_CFLAGS)
 stap_authorize_cert_CFLAGS = $(AM_CFLAGS) @PIECFLAGS@ $(nss_CFLAGS) $(debuginfod_CFLAGS)
-stap_authorize_cert_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@
+stap_authorize_cert_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@ $(debuginfod_LDFLAGS)
 stap_authorize_cert_LDADD = $(nss_LIBS) $(debuginfod_LIBS)
 if HAVE_HTTP_SUPPORT
 stap_authorize_cert_LDADD += $(openssl_LIBS)
@@ -208,9 +208,9 @@ endif
 
 if BUILD_SERVER
 stap_serverd_SOURCES = stap-serverd.cxx cscommon.cxx util.cxx privilege.cxx nsscommon.cxx cmdline.cxx
-stap_serverd_CXXFLAGS = $(AM_CXXFLAGS) @PIECXXFLAGS@ $(nss_CFLAGS)
+stap_serverd_CXXFLAGS = $(AM_CXXFLAGS) @PIECXXFLAGS@ $(nss_CFLAGS) $(debuginfod_CFLAGS)
 stap_serverd_CFLAGS = $(AM_CFLAGS) @PIECFLAGS@ $(nss_CFLAGS) $(debuginfod_CFLAGS)
-stap_serverd_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@
+stap_serverd_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@ $(debuginfod_LDFLAGS)
 stap_serverd_LDADD = $(nss_LIBS) -lpthread $(debuginfod_LIBS)
 if HAVE_AVAHI
 stap_serverd_CFLAGS += $(avahi_CFLAGS)
@@ -223,9 +223,9 @@ endif
 
 
 stap_gen_cert_SOURCES = stap-gen-cert.cxx util.cxx nsscommon.cxx
-stap_gen_cert_CXXFLAGS = $(AM_CXXFLAGS) @PIECXXFLAGS@ $(nss_CFLAGS)
+stap_gen_cert_CXXFLAGS = $(AM_CXXFLAGS) @PIECXXFLAGS@ $(nss_CFLAGS) $(debuginfod_CFLAGS)
 stap_gen_cert_CFLAGS = $(AM_CFLAGS) @PIECFLAGS@ $(nss_CFLAGS) $(debuginfod_CFLAGS)
-stap_gen_cert_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@
+stap_gen_cert_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@ $(debuginfod_LDFLAGS)
 stap_gen_cert_LDADD = $(nss_LIBS) $(debuginfod_LIBS)
 if HAVE_HTTP_SUPPORT
 stap_gen_cert_LDADD += $(openssl_LIBS)
diff --git a/stapbpf/Makefile.am b/stapbpf/Makefile.am
index 26b9a0cdf..e8c5168cf 100644
--- a/stapbpf/Makefile.am
+++ b/stapbpf/Makefile.am
@@ -22,8 +22,8 @@ stapbpf_SOURCES = stapbpf.cxx bpfinterp.cxx libbpf.c ../util.cxx \
 	../staprun/start_cmd.c
 stapbpf_CPPFLAGS = $(AM_CPPFLAGS)
 stapbpf_CFLAGS = $(AM_CFLAGS) $(debuginfod_CFLAGS)
-stapbpf_CXXFLAGS = $(AM_CXXFLAGS)
-stapbpf_LDFLAGS = $(AM_LDFLAGS)
+stapbpf_CXXFLAGS = $(AM_CXXFLAGS) $(debuginfod_CFLAGS)
+stapbpf_LDFLAGS = $(AM_LDFLAGS) $(debuginfod_LDFLAGS)
 stapbpf_LDADD = $(stapbpf_LIBS) -lpthread $(debuginfod_LIBS)
 
 BUILT_SOURCES =
diff --git a/stapdyn/Makefile.am b/stapdyn/Makefile.am
index 1b0dcf116..bd63d497b 100644
--- a/stapdyn/Makefile.am
+++ b/stapdyn/Makefile.am
@@ -30,15 +30,15 @@ man_MANS = stapdyn.8
 
 stapdyn_SOURCES = stapdyn.cxx mutator.cxx mutatee.cxx \
 				  dynprobe.cxx dynutil.cxx ../util.cxx
-stapdyn_CXXFLAGS = $(AM_CXXFLAGS) @DYNINST_CXXFLAGS@
-stapdyn_LDFLAGS = $(AM_LDFLAGS) @DYNINST_LDFLAGS@
+stapdyn_CXXFLAGS = $(AM_CXXFLAGS) @DYNINST_CXXFLAGS@ $(debuginfod_CFLAGS)
+stapdyn_LDFLAGS = $(AM_LDFLAGS) @DYNINST_LDFLAGS@ $(debuginfod_LDFLAGS)
 stapdyn_LDADD = -ldl -ldyninstAPI -lsymtabAPI -lpthread $(debuginfod_LIBS)
 stapdyn_CFLAGS = $(debuginfod_CFLAGS)
 
 dynsdt_SOURCES = dynsdt.cxx dynutil.cxx ../util.cxx
 dynsdt_CPPFLAGS = $(AM_CPPFLAGS)
-dynsdt_CXXFLAGS = $(AM_CXXFLAGS) @DYNINST_CXXFLAGS@
-dynsdt_LDFLAGS = $(AM_LDFLAGS) @DYNINST_LDFLAGS@
+dynsdt_CXXFLAGS = $(AM_CXXFLAGS) @DYNINST_CXXFLAGS@ $(debuginfod_CFLAGS)
+dynsdt_LDFLAGS = $(AM_LDFLAGS) @DYNINST_LDFLAGS@ $(debuginfod_LDFLAGS)
 dynsdt_LDADD = -ldl -lelf -ldyninstAPI -lsymtabAPI -lpthread $(debuginfod_LIBS)
 dynsdt_CFLAGS = $(debuginfod_CFLAGS)
 
diff --git a/staprun/Makefile.am b/staprun/Makefile.am
index 410d2b28f..f3694e592 100644
--- a/staprun/Makefile.am
+++ b/staprun/Makefile.am
@@ -26,10 +26,10 @@ libstrfloctime_a_CFLAGS = $(AM_CFLAGS) -Wno-format-nonliteral
 staprun_SOURCES = staprun.c staprun_funcs.c ctl.c common.c start_cmd.c \
 	../privilege.cxx ../util.cxx
 staprun_CFLAGS = $(AM_CFLAGS) -DSINGLE_THREADED $(debuginfod_CFLAGS)
-staprun_CXXFLAGS = $(AM_CXXFLAGS) -DSINGLE_THREADED
+staprun_CXXFLAGS = $(AM_CXXFLAGS) -DSINGLE_THREADED $(debuginfod_CFLAGS)
 staprun_CPPFLAGS = $(AM_CPPFLAGS)
 staprun_LDADD = libstrfloctime.a $(staprun_LIBS) $(debuginfod_LIBS)
-staprun_LDFLAGS =  $(AM_LDFLAGS) -Wl,--whole-archive,libstrfloctime.a,--no-whole-archive
+staprun_LDFLAGS =  $(AM_LDFLAGS) -Wl,--whole-archive,libstrfloctime.a,--no-whole-archive $(debuginfod_LDFLAGS)
 
 if HAVE_NSS
 staprun_SOURCES += modverify.c ../nsscommon.cxx
-- 
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 [PATCH 1/2] configure.ac: fix broken libdebuginfod library auto detection Victor Kamensky
2023-12-18  5:01 ` Victor Kamensky [this message]
2023-12-21 15:09   ` [PATCH 2/2] Makefile.am: fix build with --with-debuginfod=/path configure option 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-2-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).