From 09e3d62ad188c18ace9d7ee6274dc0dcf52f0ce5 Mon Sep 17 00:00:00 2001 From: Derek Bruening Date: Fri, 2 Oct 2015 12:32:22 -0400 Subject: [PATCH] DRi#1781: add pdb files for exported static libraries Updates DR to 29cc677 for pdb files for DR's static libraries, and adds pdb files for DRMF static libraries for CMake 3.1+ via the COMPILE_PDB_* properties. Review-URL: https://codereview.appspot.com/269080043 --- CMakeLists.txt | 15 +++++++++++++++ drfuzz/CMakeLists.txt | 1 + drsymcache/CMakeLists.txt | 1 + drsyscall/CMakeLists.txt | 1 + dynamorio | 2 +- umbra/CMakeLists.txt | 1 + 6 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d8fb39c5a..b731815c6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -277,6 +277,21 @@ endif () string(TOUPPER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_UPPER) +# i#1781: cmake 2.8.12+ fails to create static lib pdb by default +# XXX: we should share this with DR's copy +macro(add_static_lib_debug_info target dest_dir) + if (WIN32) + if ("${CMAKE_VERSION}" VERSION_EQUAL "3.1" OR + "${CMAKE_VERSION}" VERSION_GREATER "3.1") + append_property_string(TARGET ${target} + COMPILE_PDB_NAME${location_suffix} "${target}" + COMPILE_PDB_OUTPUT_DIRECTORY{location_suffix} "${dest_dir}") + else () + # We just don't support it for < 3.1 + endif () + endif () +endmacro() + if (UNIX) # there's no cmake warning control so we hardcode it # disabling strict aliasing since giving weird warning I'm not sure how to fix: diff --git a/drfuzz/CMakeLists.txt b/drfuzz/CMakeLists.txt index ba77a88ad..e361e2e27 100644 --- a/drfuzz/CMakeLists.txt +++ b/drfuzz/CMakeLists.txt @@ -96,6 +96,7 @@ add_library(drfuzz_static STATIC ${srcs_static} ${external_srcs}) # Set a preferred base to avoid conflict if we can configure_DynamoRIO_client(drfuzz_static) configure_drfuzz_target(drfuzz_static "drwrap_static" "drmgr_static" "drsyms_static") +add_static_lib_debug_info(drfuzz_static ${DRMF_INSTALL_BIN}) export_drfuzz_target(drfuzz_static "drwrap_static" "drmgr_static") # We build a separate static target for internal use that has our diff --git a/drsymcache/CMakeLists.txt b/drsymcache/CMakeLists.txt index fda572394..f0284e1fd 100644 --- a/drsymcache/CMakeLists.txt +++ b/drsymcache/CMakeLists.txt @@ -99,6 +99,7 @@ install(FILES drsymcache.h DESTINATION ${DRMF_INSTALL_INC}) add_library(drsymcache_static STATIC ${srcs_static} ${external_srcs}) configure_DynamoRIO_client(drsymcache_static) configure_drsymcache_target(drsymcache_static "drmgr_static" "drsyms_static") +add_static_lib_debug_info(drsymcache_static ${DRMF_INSTALL_BIN}) export_drsymcache_target(drsymcache_static "drmgr_static" "drsyms_static") # We build a separate static target for internal use that has our diff --git a/drsyscall/CMakeLists.txt b/drsyscall/CMakeLists.txt index c27980e96..30cd3f7a1 100644 --- a/drsyscall/CMakeLists.txt +++ b/drsyscall/CMakeLists.txt @@ -138,6 +138,7 @@ configure_DynamoRIO_client(drsyscall_static) use_DynamoRIO_extension(drsyscall_static drmgr_static) use_DynamoRIO_extension(drsyscall_static drcontainers) configure_drsyscall_target(drsyscall_static) +add_static_lib_debug_info(drsyscall_static ${DRMF_INSTALL_BIN}) export_drsyscall_target(drsyscall_static "drmgr_static") # We build a separate static target for internal use that has our diff --git a/dynamorio b/dynamorio index 4cd4cb52e..29cc6778b 160000 --- a/dynamorio +++ b/dynamorio @@ -1 +1 @@ -Subproject commit 4cd4cb52e6279dea8ac57cbd0d15b829b17e5558 +Subproject commit 29cc6778b48915fdf43054b22a5976b8c6a7df49 diff --git a/umbra/CMakeLists.txt b/umbra/CMakeLists.txt index bdbf4bc41..75dbbd696 100644 --- a/umbra/CMakeLists.txt +++ b/umbra/CMakeLists.txt @@ -106,6 +106,7 @@ configure_DynamoRIO_client(umbra_static) use_DynamoRIO_extension(umbra_static drmgr_static) use_DynamoRIO_extension(umbra_static drcontainers) configure_umbra_target(umbra_static) +add_static_lib_debug_info(umbra_static ${DRMF_INSTALL_BIN}) export_umbra_target(umbra_static "drmgr_static") # We build a separate static target for internal use that has our