From: Steven Rostedt <rostedt@goodmis.org>
To: linux-trace-devel@vger.kernel.org
Subject: [PATCH 4/5] trace-cmd: Have libtracecmd.so include libtraceevent
Date: Wed, 22 Jan 2020 12:12:54 -0500 [thread overview]
Message-ID: <20200122171329.476181697@goodmis.org> (raw)
In-Reply-To: 20200122171250.252248737@goodmis.org
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
Was getting errors with loading libtracecmd.so with undefined symbols
from libtraceevent. Add it to the build process to include what it uses
as well.
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
Makefile | 2 +-
lib/trace-cmd/Makefile | 2 ++
scripts/utils.mk | 12 +++++++-----
3 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/Makefile b/Makefile
index c22aa7847b51..9c74268eddd5 100644
--- a/Makefile
+++ b/Makefile
@@ -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)
diff --git a/lib/trace-cmd/Makefile b/lib/trace-cmd/Makefile
index 6f3e6b1bf935..29c36ca195d0 100644
--- a/lib/trace-cmd/Makefile
+++ b/lib/trace-cmd/Makefile
@@ -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)
diff --git a/scripts/utils.mk b/scripts/utils.mk
index 4da8829159a0..28dcd7b44061 100644
--- a/scripts/utils.mk
+++ b/scripts/utils.mk
@@ -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) \
@@ -135,9 +135,11 @@ define do_install_data
endef
define do_install_ld
- $(print_install) \
- if [ -d '$(DESTDIR_SQ)$2' ]; then \
- echo '$3' >> $(DESTDIR_SQ)$2/$1; \
- ldconfig; \
+ $(print_install) \
+ if [ -d '$(DESTDIR_SQ)$2' ]; then \
+ if ! grep -q $3 $(DESTDIR_SQ)$2/$1 2>/dev/null; then \
+ echo '$3' >> $(DESTDIR_SQ)$2/$1; \
+ ldconfig; \
+ fi \
fi
endef
--
2.24.1
next prev parent reply other threads:[~2020-01-22 17:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-22 17:12 [PATCH 0/5] trace-cmd: A few updates Steven Rostedt
2020-01-22 17:12 ` [PATCH 1/5] trace-cmd: Create TRACECMD_MAGIC macro for magic number of trace-cmd data file Steven Rostedt
2020-01-22 17:12 ` [PATCH 2/5] trace-cmd: Place "trace.dat" into the macro DEFAULT_INPUT_FILE Steven Rostedt
2020-01-22 17:12 ` [PATCH 3/5] trace-cmd: Add installation of ld.conf.d file for library paths Steven Rostedt
2020-01-22 17:22 ` Steven Rostedt
2020-01-22 17:12 ` Steven Rostedt [this message]
2020-01-22 17:12 ` [PATCH 5/5] trace-cmd: Remove unused trace_util function declarations 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=20200122171329.476181697@goodmis.org \
--to=rostedt@goodmis.org \
--cc=linux-trace-devel@vger.kernel.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 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).