lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 20 Dec 2017 20:07:42 +0200
From:   "Vladislav Valtchev (VMware)" <vladislav.valtchev@...il.com>
To:     rostedt@...dmis.org
Cc:     y.karadz@...il.com, linux-trace-devel@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        "Vladislav Valtchev (VMware)" <vladislav.valtchev@...il.com>
Subject: [PATCH 12/18] trace-cmd: Fix the broken target ctracecmdgui.so

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@...il.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

Powered by blists - more mailing lists