All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org,
	"Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
Subject: [PATCH 1/4] kernel-shark: Use correct order when linking all depenancies
Date: Fri, 20 Sep 2019 13:48:28 +0300	[thread overview]
Message-ID: <20190920104831.23475-2-y.karadz@gmail.com> (raw)
In-Reply-To: <20190920104831.23475-1-y.karadz@gmail.com>

I wasn't aware of the importance of the order in which the libraries are
passed to the linker, so in the dependency list in src/CMakeLists.txt
I naively started with the most basic libraries first. This is WRONG.
The linker searches and resolves symbols in the order that they appear.
If library A contains a call to a function from library B, we have to
put A before B, otherwise the linker won't know that something in B
needs to be resolved.

Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
 kernel-shark/src/CMakeLists.txt | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/kernel-shark/src/CMakeLists.txt b/kernel-shark/src/CMakeLists.txt
index 21494cc..e20a030 100644
--- a/kernel-shark/src/CMakeLists.txt
+++ b/kernel-shark/src/CMakeLists.txt
@@ -7,10 +7,10 @@ add_library(kshark SHARED libkshark.c
                           libkshark-configio.c
                           libkshark-collection.c)
 
-target_link_libraries(kshark ${CMAKE_DL_LIBS}
+target_link_libraries(kshark ${TRACEEVENT_LIBRARY}
+                             ${TRACECMD_LIBRARY}
                              ${JSONC_LIBRARY}
-                             ${TRACEEVENT_LIBRARY}
-                             ${TRACECMD_LIBRARY})
+                             ${CMAKE_DL_LIBS})
 
 set_target_properties(kshark  PROPERTIES SUFFIX	".so.${KS_VERSION_STRING}")
 
@@ -23,8 +23,8 @@ if (OPENGL_FOUND AND GLUT_FOUND)
                                      KsPlotTools.cpp)
 
     target_link_libraries(kshark-plot  kshark
-                                       ${OPENGL_LIBRARIES}
-                                       ${GLUT_LIBRARY})
+                                       ${GLUT_LIBRARY}
+                                       ${OPENGL_LIBRARIES})
 
     set_target_properties(kshark-plot PROPERTIES  SUFFIX ".so.${KS_VERSION_STRING}")
 
@@ -65,11 +65,11 @@ if (Qt5Widgets_FOUND AND Qt5Network_FOUND)
                                                             KsAdvFilteringDialog.cpp)
 
     target_link_libraries(kshark-gui kshark-plot
-                                     ${CMAKE_DL_LIBS}
+                                     Qt5::Widgets
+                                     Qt5::Network
                                      ${TRACEEVENT_LIBRARY}
                                      ${TRACECMD_LIBRARY}
-                                     Qt5::Widgets
-                                     Qt5::Network)
+                                     ${CMAKE_DL_LIBS})
 
     set_target_properties(kshark-gui PROPERTIES  SUFFIX ".so.${KS_VERSION_STRING}")
 
-- 
2.20.1


  reply	other threads:[~2019-09-20 10:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-20 10:48 [PATCH 0/4] Fixes needed for KS 1.1 Yordan Karadzhov (VMware)
2019-09-20 10:48 ` Yordan Karadzhov (VMware) [this message]
2019-09-20 10:48 ` [PATCH 2/4] trace-cmd: Correct the install paths of traceevent and trace-cmd libraries Yordan Karadzhov (VMware)
2019-09-20 12:00   ` Yordan Karadzhov (VMware)
2019-09-20 10:48 ` [PATCH 3/4] kernel-shark: Fix the file paths used by Doxygen Yordan Karadzhov (VMware)
2019-09-20 10:48 ` [PATCH 4/4] kernel-shark: Cleanup in KsCaptureDialog Yordan Karadzhov (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=20190920104831.23475-2-y.karadz@gmail.com \
    --to=y.karadz@gmail.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.