DynamoRIO / dynamorio

Dynamic Instrumentation Tool Platform
Other
2.57k stars 551 forks source link

DynamoRIOTarget32-noconfig.cmake contains hard-coded path #693

Open derekbruening opened 9 years ago

derekbruening commented 9 years ago

From meph...@gmail.com on February 28, 2012 07:28:51

Version: DynamoRIO-Linux-3.1.0-4

When I try to build project with drsyms extension, I get this:

$ make make[2]: *\ No rule to make target /home/bruening/dr/withwiki/trunk/ext/drsyms/libelftc/lib32/libelf.a', needed bylibdr.so'. Stop.

My CMakeLists.txt:

cmake_minimum_required(VERSION 2.8) find_package(DynamoRIO)

add_library(dr SHARED dr.c) use_DynamoRIO_extension(dr drsyms) configure_DynamoRIO_client(dr)

Original issue: http://code.google.com/p/dynamorio/issues/detail?id=693

derekbruening commented 9 years ago

From bruen...@google.com on February 28, 2012 07:12:16

can you take a look as this was your feature

Status: Accepted
Owner: rnk@google.com

derekbruening commented 9 years ago

From rnk@google.com on February 28, 2012 09:26:35

I can reproduce this using the pre-build exports package. DynamoRIO-Linux-3.1.0-4/cmake/DynamoRIOTarget64.cmake has this in it:

Import target "drsyms" for configuration ""

SET_PROPERTY(TARGET drsyms APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG) SET_TARGET_PROPERTIES(drsyms PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES_NOCONFIG "dynamorio;/home/bruening/dr/withwiki/trunk/ext/drsyms/libelftc/lib64/libelf.a;/home/bruening/dr/withwiki/trunk/ext/drsyms/libelftc/lib64/libdwarf.a;/home/bruening/dr/withwiki/trunk/ext/drsyms/libelftc/lib64/libelftc.a;drcontainers" IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/ext/lib64/release/libdrsyms.so" IMPORTED_SONAME_NOCONFIG "libdrsyms.so" )

I'll look into that.

Labels: Component-Build

derekbruening commented 9 years ago

From rnk@google.com on February 28, 2012 09:51:53

s/pre-build/pre-built/

I don't really know what cmake is trying to do with (IMPORTED_)LINK_INTERFACE_LIBRARIES(_NOCONFIG), but I don't think we want it. Here is someone else with the same problem: http://www.cmake.org/pipermail/cmake/2011-November/047286.html I think cmake wants some way to say, "hey, I included these static .a libs in this .so, so don't link them to your depending lib or exe" or something like that.

There's this other paragraph further down that's disconcerting:

""" Just an additional remark: The files installed by INSTALL(EXPORT ...) describe the installed targets' dependencies on the system where the installation has taken place; using these files on another system within a different environment is usually a rather bad idea. """

I guess their expectation is that users will distribute a package with a cmake install script that the user will run to put it somewhere on their system. We don't do that, and I wouldn't want to do that anyway.

I can fix this problem (removes these IMPORTED_LINK_INTERFACE_LIBRARIES_NOCONFIG vars) by adding 'set_target_properties(drsyms PROPERTIES LINK_INTERFACE_LIBRARIES "")' to the shared config for drsyms.