@@ -301,7 +301,7 @@ $(LIBTRACEEVENT_STATIC): force $(obj)/lib/traceevent/plugins/trace_python_dir \
$(LIBTRACECMD_STATIC): force
$(Q)$(MAKE) -C $(src)/lib/trace-cmd $@
-$(LIBTRACECMD_SHARED): force
+$(LIBTRACECMD_SHARED): force $(LIBTRACEEVENT_SHARED)
$(Q)$(MAKE) -C $(src)/lib/trace-cmd $@
libtraceevent.so: $(LIBTRACEEVENT_SHARED)
@@ -35,6 +35,8 @@ $(DEPS): | $(bdir)
$(bdir)/libtracecmd.a: $(OBJS)
$(Q)$(call do_build_static_lib)
+LIBS = -L$(obj)/lib/traceevent -ltraceevent
+
$(bdir)/libtracecmd.so: $(OBJS)
$(Q)$(call do_compile_shared_library)
@@ -61,7 +61,7 @@ do_build_static_lib = \
do_compile_shared_library = \
($(print_shared_lib_compile) \
- $(CC) --shared $^ -Wl,-soname,$(@F) -o $@)
+ $(CC) --shared $^ $(LIBS) -Wl,-soname,$(@F) -o $@)
do_compile_plugin_obj = \
($(print_plugin_obj_compile) \