@@ -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
@@ -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) $@
@@ -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)
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(-)