From: "Vladislav Valtchev (VMware)" <vladislav.valtchev@gmail.com>
To: rostedt@goodmis.org
Cc: y.karadz@gmail.com, linux-trace-devel@vger.kernel.org,
linux-kernel@vger.kernel.org,
"Vladislav Valtchev (VMware)" <vladislav.valtchev@gmail.com>
Subject: [PATCH 12/18] trace-cmd: Fix the broken target ctracecmdgui.so
Date: Wed, 20 Dec 2017 20:07:42 +0200 [thread overview]
Message-ID: <20171220180748.17273-13-vladislav.valtchev@gmail.com> (raw)
In-Reply-To: <20171220180748.17273-1-vladislav.valtchev@gmail.com>
Currenly the ctracecmdgui.so target is broken beacause the object files
trace-view.o trace-view-store.o are not built with -fPIC. This patch just fixes
the kernel-shark/Makefile in order to those files to be built with -fPIC.
Signed-off-by: Vladislav Valtchev (VMware) <vladislav.valtchev@gmail.com>
---
kernel-shark/Makefile | 10 +++++++---
scripts/utils.mk | 10 +++++-----
2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/kernel-shark/Makefile b/kernel-shark/Makefile
index 247f4d1..8e3ba8b 100644
--- a/kernel-shark/Makefile
+++ b/kernel-shark/Makefile
@@ -34,9 +34,11 @@ TRACE_GRAPH_MAIN_OBJS = trace-graph-main.o $(TRACE_GRAPH_OBJS) $(TRACE_GUI_OBJS)
KERNEL_SHARK_OBJS = $(TRACE_VIEW_OBJS) $(TRACE_GRAPH_OBJS) $(TRACE_GUI_OBJS) \
trace-capture.o kernel-shark.o
-GUI_OBJS = $(KERNEL_SHARK_OBJS) $(TRACE_VIEW_MAIN_OBJS) $(TRACE_GRAPH_MAIN_OBJS)
+ALL_OBJS = $(KERNEL_SHARK_OBJS) $(TRACE_VIEW_MAIN_OBJS) $(TRACE_GRAPH_MAIN_OBJS)
+PIC_OBJS = $(TRACE_VIEW_OBJS)
-all_objs := $(sort $(GUI_OBJS))
+all_objs := $(sort $(ALL_OBJS))
+pic_objs = $(sort $(PIC_OBJS))
all_deps := $(all_objs:%.o=.%.d)
# Temporary HACK!
@@ -61,6 +63,8 @@ trace-view: $(TRACE_VIEW_MAIN_OBJS)
trace-graph: $(TRACE_GRAPH_MAIN_OBJS)
$(Q)$(do_app_build)
+$(pic_objs): GENERATE_PIC := 1
+
%.o: %.c
$(Q)$(call do_compile)
@@ -69,7 +73,7 @@ $(all_deps): .%.d: %.c
$(all_deps): $(KS_VERSION)
-$(GUI_OBJS): %.o : .%.d
+$(all_objs): %.o : .%.d
dep_includes := $(wildcard $(DEPS))
diff --git a/scripts/utils.mk b/scripts/utils.mk
index 31fc9e9..043a68a 100644
--- a/scripts/utils.mk
+++ b/scripts/utils.mk
@@ -33,15 +33,15 @@ else
print_install = echo ' $(GUI)INSTALL '$(GSPACE)$1' to $(DESTDIR_SQ)$2';
endif
-
-do_compile = \
- ($(print_compile) \
- $(CC) -c $(CPPFLAGS) $(CFLAGS) $(EXT) $< -o $@)
-
do_fpic_compile = \
($(print_fpic_compile) \
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(EXT) -fPIC $< -o $@)
+do_compile = \
+ ($(if $(GENERATE_PIC), $(do_fpic_compile), \
+ $(print_compile) \
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $(EXT) $< -o $@))
+
do_app_build = \
($(print_app_build) \
$(CC) $^ -rdynamic -o $@ $(LDFLAGS) $(CONFIG_LIBS) $(LIBS))
--
2.14.1
next prev parent reply other threads:[~2017-12-20 18:08 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-20 18:07 [PATCH 00/18] trace-cmd: restructure the project's source tree Vladislav Valtchev (VMware)
2017-12-20 18:07 ` [PATCH 01/18] trace-cmd: Rename libparsevent to libtraceevent Vladislav Valtchev (VMware)
2017-12-20 18:07 ` [PATCH 02/18] trace-cmd: Move libtraceevent headers in include/traceevent Vladislav Valtchev (VMware)
2017-12-20 18:07 ` [PATCH 03/18] trace-cmd: Move trace-cmd headers in include/trace-cmd Vladislav Valtchev (VMware)
2017-12-20 18:07 ` [PATCH 04/18] trace-cmd: Move event-utils.h in lib/traceevent/include Vladislav Valtchev (VMware)
2017-12-20 18:07 ` [PATCH 05/18] trace-cmd: Extract part of Makefile in scripts/utils.mk Vladislav Valtchev (VMware)
2017-12-20 18:07 ` [PATCH 06/18] trace-cmd: Move libtraceevent *.c files in lib/traceevent Vladislav Valtchev (VMware)
2017-12-20 18:07 ` [PATCH 07/18] trace-cmd: Move trace-hash-local.h in lib/trace-cmd/include Vladislav Valtchev (VMware)
2017-12-20 18:07 ` [PATCH 08/18] trace-cmd: Move libtracecmd *.c files in lib/trace-cmd Vladislav Valtchev (VMware)
2017-12-20 18:07 ` [PATCH 09/18] trace-cmd: Move GUI headers in kernel-shark/include Vladislav Valtchev (VMware)
2017-12-20 18:07 ` [PATCH 10/18] trace-cmd: Move GUI *.c files in kernel-shark/ Vladislav Valtchev (VMware)
2017-12-20 18:07 ` [PATCH 11/18] trace-cmd: Move plugin_* files in plugins/ Vladislav Valtchev (VMware)
2017-12-20 18:07 ` Vladislav Valtchev (VMware) [this message]
2017-12-20 18:07 ` [PATCH 13/18] trace-cmd: Move python-related files in python/ Vladislav Valtchev (VMware)
2017-12-20 18:07 ` [PATCH 14/18] trace-cmd: Move tracecmd headers in tracecmd/include Vladislav Valtchev (VMware)
2017-12-20 18:07 ` [PATCH 15/18] trace-cmd: Move version.h in include/ Vladislav Valtchev (VMware)
2017-12-20 18:07 ` [PATCH 16/18] trace-cmd: Move trace-cmd app files in tracecmd/ Vladislav Valtchev (VMware)
2017-12-20 18:07 ` [PATCH 17/18] trace-cmd: Fix the logic behind SWIG_DEFINED in the Makefile Vladislav Valtchev (VMware)
2017-12-20 18:07 ` [PATCH 18/18] trace-cmd: Make the build to tell when python-dev is missing Vladislav Valtchev (VMware)
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=20171220180748.17273-13-vladislav.valtchev@gmail.com \
--to=vladislav.valtchev@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-devel@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=y.karadz@gmail.com \
/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).