* [PATCH] trace-cmd: Add compile time overrides for libraries
@ 2022-08-26 22:59 John 'Warthog9' Hawley
2022-09-22 1:47 ` Steven Rostedt
0 siblings, 1 reply; 2+ messages in thread
From: John 'Warthog9' Hawley @ 2022-08-26 22:59 UTC (permalink / raw)
To: linux-trace-devel; +Cc: rostedt
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] trace-cmd: Add compile time overrides for libraries
2022-08-26 22:59 [PATCH] trace-cmd: Add compile time overrides for libraries John 'Warthog9' Hawley
@ 2022-09-22 1:47 ` Steven Rostedt
0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2022-09-22 1:47 UTC (permalink / raw)
To: John 'Warthog9' Hawley; +Cc: linux-trace-devel
On Fri, 26 Aug 2022 15:59:04 -0700
John 'Warthog9' Hawley <warthog9@eaglescrag.net> wrote:
> 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>
> ---
Applied. Thanks John!
-- Steve
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-09-22 1:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-26 22:59 [PATCH] trace-cmd: Add compile time overrides for libraries John 'Warthog9' Hawley
2022-09-22 1:47 ` Steven Rostedt
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).