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@xxxxxxxxxxxxxx> --- 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