All of lore.kernel.org
 help / color / mirror / Atom feed
From: John 'Warthog9' Hawley <warthog9@eaglescrag.net>
To: linux-trace-devel@vger.kernel.org
Cc: rostedt@goodmis.org
Subject: [PATCH] trace-cmd: Add compile time overrides for libraries
Date: Fri, 26 Aug 2022 15:59:04 -0700	[thread overview]
Message-ID: <20220826225904.1824344-1-warthog9@eaglescrag.net> (raw)

Continuing in the ld.lld link issues trace-cmd needs to override
-lrt -lpthread and -ldl.  This adds the ability, from the command line,
adjust LIBS, LRT and LPTHREAD

Signed-off-by: John 'Warthog9' Hawley <warthog9@eaglescrag.net>
---
 Makefile               | 2 +-
 lib/trace-cmd/Makefile | 4 +++-
 tracecmd/Makefile      | 5 ++++-
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 7178d7a9..92ba4ba4 100644
--- a/Makefile
+++ b/Makefile
@@ -216,7 +216,7 @@ export pkgconfig_dir PKG_CONFIG_FILE
 
 export prefix bindir src obj
 
-LIBS = -ldl
+LIBS ?= -ldl
 
 LIBTRACECMD_DIR = $(obj)/lib/trace-cmd
 LIBTRACECMD_STATIC = $(LIBTRACECMD_DIR)/libtracecmd.a
diff --git a/lib/trace-cmd/Makefile b/lib/trace-cmd/Makefile
index 81cde3de..28b4afc6 100644
--- a/lib/trace-cmd/Makefile
+++ b/lib/trace-cmd/Makefile
@@ -52,7 +52,9 @@ $(DEPS): | $(bdir)
 $(LIBTRACECMD_STATIC): $(OBJS)
 	$(Q)$(call do_build_static_lib)
 
-LIBS = $(LIBTRACEEVENT_LDLAGS) $(LIBTRACEFS_LDLAGS) $(ZLIB_LDLAGS) $(LIBZSTD_LDLAGS) -lpthread
+LPTHREAD ?= -lpthread
+
+LIBS = $(LIBTRACEEVENT_LDLAGS) $(LIBTRACEFS_LDLAGS) $(ZLIB_LDLAGS) $(LIBZSTD_LDLAGS) $(LPTHREAD)
 
 $(LIBTRACECMD_SHARED_VERSION): $(LIBTRACECMD_SHARED)
 	@ln -sf $(<F) $@
diff --git a/tracecmd/Makefile b/tracecmd/Makefile
index 8207c54b..66387526 100644
--- a/tracecmd/Makefile
+++ b/tracecmd/Makefile
@@ -49,8 +49,11 @@ ALL_OBJS := $(TRACE_CMD_OBJS:%.o=$(bdir)/%.o)
 all_objs := $(sort $(ALL_OBJS))
 all_deps := $(all_objs:$(bdir)/%.o=$(bdir)/.%.d)
 
+LPTHREAD ?= -lpthread
+LRT ?= -lrt
+
 CONFIG_INCLUDES =
-CONFIG_LIBS	= -lrt -lpthread $(TRACE_LIBS) $(ZLIB_LDLAGS) $(LIBZSTD_LDLAGS)
+CONFIG_LIBS	= $(LRT) $(LPTHREAD) $(TRACE_LIBS) $(ZLIB_LDLAGS) $(LIBZSTD_LDLAGS)
 CONFIG_FLAGS	=
 
 all: $(TARGETS)
-- 
2.37.2


             reply	other threads:[~2022-08-26 22:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-26 22:59 John 'Warthog9' Hawley [this message]
2022-09-22  1:47 ` [PATCH] trace-cmd: Add compile time overrides for libraries Steven Rostedt

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=20220826225904.1824344-1-warthog9@eaglescrag.net \
    --to=warthog9@eaglescrag.net \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.