diff --git a/.devtoolset-10-dyninst.metadata b/.devtoolset-10-dyninst.metadata index 104a9f6..176f20f 100644 --- a/.devtoolset-10-dyninst.metadata +++ b/.devtoolset-10-dyninst.metadata @@ -1,4 +1,4 @@ 9e870040323cec2c367b1598351a66a6574eb7c2 SOURCES/2018_U6.tar.gz b6b284acde2ad7ed49b44e856955d7b1ea4e9459 SOURCES/boost_1_66_0.tar.bz2 -02029d0224460f866f92ef54221efa37ee1ba164 SOURCES/dyninst-10.1.0.tar.gz +3e842456203d4702acd4771ae648f4cf382b9a12 SOURCES/dyninst-10.2.1.tar.gz cbafd2da77de24180cb9c2fb5b600fd8d2cb2fa1 SOURCES/testsuite-10.1.0.tar.gz diff --git a/.gitignore b/.gitignore index aa83d4e..b413119 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ SOURCES/2018_U6.tar.gz SOURCES/boost_1_66_0.tar.bz2 -SOURCES/dyninst-10.1.0.tar.gz +SOURCES/dyninst-10.2.1.tar.gz SOURCES/testsuite-10.1.0.tar.gz diff --git a/SOURCES/dyninst-10.1.0-cmake.patch b/SOURCES/dyninst-10.1.0-cmake.patch deleted file mode 100644 index 46d33d9..0000000 --- a/SOURCES/dyninst-10.1.0-cmake.patch +++ /dev/null @@ -1,314 +0,0 @@ -# rhel6 and rhel7 need more recent tbb and boost libraries. The dyninst external project setup -# will download, build, and install to the final location. We change that to build from source.tar -# included in the src.rpm, install in the rpmbuild/BUILD tree and finally install into rpmbuild/BUILDTREE -# We also remove the dependency on cmake 3 - - ---- dyninst-10.1.0/dyninst-10.1.0/CMakeLists.txt.orig 2019-07-16 22:08:06.406557467 -0400 -+++ dyninst-10.1.0/dyninst-10.1.0/CMakeLists.txt 2019-07-16 22:07:50.790557717 -0400 -@@ -1,2 +1,2 @@ --cmake_minimum_required (VERSION 3.4.0) -+cmake_minimum_required (VERSION 2.8) - project (Dyninst) -@@ -227,1 +227,24 @@ - install(FILES ${PROJECT_BINARY_DIR}/CMakeCache.txt DESTINATION ${INSTALL_CMAKE_DIR}) -+ -+# RHEL 6/7 need more recent TBB and BOOST libraries, cmake will build them as an external project. -+# Copy resulting libraries from temp install dir to dyninst install dir -+# Note: FILE GLOB does not work as make has not yet run so we need to explicitly set the list -+ -+set(TBB_AND_BOOST_LIBS tbb/install/lib/libtbbmalloc_proxy.so.2 tbb/install/lib/libtbbmalloc.so.2 tbb/install/lib/libtbb.so.2 boost/install/lib/libboost_atomic.so.1.66.0 boost/install/lib/libboost_chrono.so.1.66.0 boost/install/lib/libboost_date_time.so.1.66.0 boost/install/lib/libboost_filesystem.so.1.66.0 boost/install/lib/libboost_system.so.1.66.0 boost/install/lib/libboost_thread.so.1.66.0 boost/install/lib/libboost_timer.so.1.66.0) -+ -+get_filename_component(install_lib_dir_dir ${INSTALL_LIB_DIR} DIRECTORY) -+get_filename_component(dyninst_dir ${INSTALL_LIB_DIR} NAME) -+get_filename_component(lib_dir ${install_lib_dir_dir} NAME) -+get_filename_component(install_include_dir_dir ${INSTALL_INCLUDE_DIR} DIRECTORY) -+get_filename_component(include_dir ${install_include_dir_dir} NAME) -+foreach(F ${TBB_AND_BOOST_LIBS}) -+ # DESTDIR is prefixed to the install dir -+ message("install ${Dyninst_BINARY_DIR}/${F} into ${CMAKE_INSTALL_PREFIX}/${lib_dir}/${dyninst_dir}") -+ install(PROGRAMS "${Dyninst_BINARY_DIR}/${F}" DESTINATION "${CMAKE_INSTALL_PREFIX}/${lib_dir}/${dyninst_dir}") -+endforeach() -+message("install tbb/install/include into ${CMAKE_INSTALL_PREFIX}/${include_dir}/tbb}") -+install(DIRECTORY DESTINATION "${CMAKE_INSTALL_PREFIX}/${include_dir}/tbb/") -+install(DIRECTORY "tbb/install/include/" DESTINATION "${CMAKE_INSTALL_PREFIX}/${include_dir}") -+# message("install boost/install/include into ${CMAKE_INSTALL_PREFIX}/${include_dir}/boost}") -+# install(DIRECTORY DESTINATION "${CMAKE_INSTALL_PREFIX}/${include_dir}/boost/") -+# install(DIRECTORY "boost/install/include/" DESTINATION "${CMAKE_INSTALL_PREFIX}/${include_dir}/") ---- dyninst-10.1.0/dyninst-10.1.0/cmake/ElfUtils.cmake.orig 2019-07-04 15:29:42.310512456 -0400 -+++ dyninst-10.1.0/dyninst-10.1.0/cmake/ElfUtils.cmake 2019-05-16 14:40:05.000000000 -0400 -@@ -35,3 +35,3 @@ - # Minimum acceptable version of elfutils --set(_min_version 0.173) -+set(_min_version 0.170) - set(ElfUtils_MIN_VERSION ${_min_version} - - ---- dyninst-10.1.0/dyninst-10.1.0/cmake/ThreadingBuildingBlocks.cmake.orig 2019-07-15 22:26:08.788921240 -0400 -+++ dyninst-10.1.0/dyninst-10.1.0/cmake/ThreadingBuildingBlocks.cmake 2019-07-16 20:37:56.804643938 -0400 -@@ -105,7 +105,8 @@ - endif() - - # Forcibly update the cache variables -- set(TBB_ROOT_DIR ${CMAKE_INSTALL_PREFIX} CACHE PATH "TBB root directory" FORCE) -+# set(TBB_ROOT_DIR ${CMAKE_INSTALL_PREFIX} CACHE PATH "TBB root directory" FORCE) -+ set(TBB_ROOT_DIR "${CMAKE_BINARY_DIR}/tbb/install" CACHE PATH "TBB root directory" FORCE) - set(TBB_INCLUDE_DIRS ${TBB_ROOT_DIR}/include CACHE PATH "TBB include directory" FORCE) - set(TBB_LIBRARY_DIRS ${TBB_ROOT_DIR}/lib CACHE PATH "TBB library directory" FORCE) - set(TBB_DEFINITIONS "" CACHE STRING "TBB compiler definitions" FORCE) -@@ -142,7 +143,7 @@ - ExternalProject_Add( - TBB - PREFIX ${_tbb_prefix_dir} -- URL https://github.com/01org/tbb/archive/${_tbb_ver_major}_U${_tbb_ver_minor}.tar.gz -+ URL /tmp/2018_U6.tar.gz - BUILD_IN_SOURCE 1 - CONFIGURE_COMMAND "" - BUILD_COMMAND - - ---- dyninst-10.1.0/dyninst-10.1.0/cmake/Boost.cmake.orig 2019-07-15 22:26:08.789921240 -0400 -+++ dyninst-10.1.0/dyninst-10.1.0/cmake/Boost.cmake 2019-07-16 09:32:52.921281788 -0400 -@@ -49,3 +49,3 @@ - # Need at least Boost-1.61 for filesytem components --set(_boost_min_version 1.61.0) -+set(_boost_min_version 1.66.0) - -@@ -176,3 +176,4 @@ - # Change the base directory -- set(Boost_ROOT_DIR ${CMAKE_INSTALL_PREFIX} CACHE PATH "Base directory the of Boost installation" FORCE) -+# set(Boost_ROOT_DIR ${CMAKE_INSTALL_PREFIX} CACHE PATH "Base directory the of Boost installation" FORCE) -+ set(Boost_ROOT_DIR "${CMAKE_BINARY_DIR}/boost/install" CACHE PATH "TBB root directory" FORCE) - -@@ -210,3 +211,3 @@ - # list(JOIN ...) is in cmake 3.12 -- string(CONCAT _boost_lib_names "${_boost_lib_names}${c},") -+ set(_boost_lib_names "${_boost_lib_names}${c},") - endforeach() -@@ -218,3 +219,3 @@ - PREFIX ${CMAKE_BINARY_DIR}/boost -- URL http://downloads.sourceforge.net/project/boost/boost/${_boost_download_version}/boost_${_boost_download_filename}.zip -+ URL /tmp/boost_${_boost_download_filename}.tar.bz2 - BUILD_IN_SOURCE 1 ---- dyninst-10.1.0/dyninst-10.1.0/cmake/Modules/FindBoost.cmake.orig 2019-07-04 13:11:35.161644923 -0400 -+++ dyninst-10.1.0/dyninst-10.1.0/cmake/Modules/FindBoost.cmake 2019-07-04 13:13:25.646643157 -0400 -@@ -242,3 +242,3 @@ - cmake_policy(PUSH) --cmake_policy(SET CMP0057 NEW) # if IN_LIST -+# cmake_policy(SET CMP0057 NEW) # if IN_LIST - -@@ -338,3 +338,3 @@ - if("x${basename}" STREQUAL "xTHREAD" AND NOT TARGET Threads::Threads) -- string(APPEND Boost_ERROR_REASON_THREAD " (missing dependency: Threads)") -+ set(Boost_ERROR_REASON_THREAD "${Boost_ERROR_REASON_THREAD} (missing dependency: Threads)") - set(Boost_THREAD_FOUND OFF) -@@ -1021,4 +1021,8 @@ - foreach(componentdep ${_Boost_${uppercomponent}_DEPENDENCIES}) -- if (NOT ("${componentdep}" IN_LIST _boost_processed_components OR "${componentdep}" IN_LIST _boost_new_components)) -- list(APPEND _boost_new_components ${componentdep}) -+ list (FIND _boost_processed_components ${componentdep} _index) -+ if (${_index} EQUAL -1) -+ list (FIND _boost_new_components ${componentdep} _index) -+ if (${_index} EQUAL -1) -+ list(APPEND _boost_new_components ${componentdep}) -+ endif() - endif() -@@ -1199,9 +1203,9 @@ - # enable dynamic linking. --if(NOT TARGET Boost::diagnostic_definitions) -- add_library(Boost::diagnostic_definitions INTERFACE IMPORTED) -- add_library(Boost::disable_autolinking INTERFACE IMPORTED) -- add_library(Boost::dynamic_linking INTERFACE IMPORTED) -- set_target_properties(Boost::dynamic_linking PROPERTIES -- INTERFACE_COMPILE_DEFINITIONS "BOOST_ALL_DYN_LINK") --endif() -+# if(NOT TARGET Boost::diagnostic_definitions) -+# add_library(Boost::diagnostic_definitions INTERFACE IMPORTED) -+# add_library(Boost::disable_autolinking INTERFACE IMPORTED) -+# add_library(Boost::dynamic_linking INTERFACE IMPORTED) -+# set_target_properties(Boost::dynamic_linking PROPERTIES -+# INTERFACE_COMPILE_DEFINITIONS "BOOST_ALL_DYN_LINK") -+# endif() - if(WIN32) -@@ -1387,4 +1391,5 @@ - -- string(APPEND Boost_ERROR_REASON -- "Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}\nBoost include path: ${Boost_INCLUDE_DIR}") -+ set(Boost_ERROR_REASON -+ "${Boost_ERROR_REASON} -+ Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}\nBoost include path: ${Boost_INCLUDE_DIR}") - if(Boost_DEBUG) -@@ -1410,4 +1415,5 @@ - # State that we found a version of Boost that is too new or too old. -- string(APPEND Boost_ERROR_REASON -- "\nDetected version of Boost is too ${_Boost_VERSION_AGE}. Requested version was ${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}") -+ set(Boost_ERROR_REASON -+ "${Boost_ERROR_REASON} -+ \nDetected version of Boost is too ${_Boost_VERSION_AGE}. Requested version was ${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}") - if (Boost_FIND_VERSION_PATCH) -@@ -1417,5 +1423,5 @@ - if (NOT Boost_FIND_VERSION_EXACT) -- string(APPEND Boost_ERROR_REASON " (or newer)") -+ set(Boost_ERROR_REASON "${Boost_ERROR_REASON} (or newer)") - endif () -- string(APPEND Boost_ERROR_REASON ".") -+ set(Boost_ERROR_REASON "${Boost_ERROR_REASON}.") - endif () -@@ -1427,4 +1433,5 @@ - set(Boost_FOUND 0) -- string(APPEND Boost_ERROR_REASON -- "Unable to find the Boost header files. Please set BOOST_ROOT to the root directory containing Boost or BOOST_INCLUDEDIR to the directory containing Boost's headers.") -+ set(Boost_ERROR_REASON -+ "${Boost_ERROR_REASON} -+ Unable to find the Boost header files. Please set BOOST_ROOT to the root directory containing Boost or BOOST_INCLUDEDIR to the directory containing Boost's headers.") - endif() -@@ -1518,3 +1525,3 @@ - OR "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xIntel") -- string(APPEND _boost_DEBUG_ABI_TAG "g") -+ set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}g") - endif() -@@ -1523,6 +1530,6 @@ - if(Boost_USE_DEBUG_PYTHON) -- string(APPEND _boost_DEBUG_ABI_TAG "y") -+ set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}y") - endif() - # d using a debug version of your code --string(APPEND _boost_DEBUG_ABI_TAG "d") -+set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}d") - # p using the STLport standard library rather than the -@@ -1530,4 +1537,4 @@ - if(Boost_USE_STLPORT) -- string(APPEND _boost_RELEASE_ABI_TAG "p") -- string(APPEND _boost_DEBUG_ABI_TAG "p") -+ set(_boost_RELEASE_ABI_TAG "${_boost_RELEASE_ABI_TAG}p") -+ set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}p") - endif() -@@ -1537,4 +1544,4 @@ - if(Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS) -- string(APPEND _boost_RELEASE_ABI_TAG "n") -- string(APPEND _boost_DEBUG_ABI_TAG "n") -+ set(_boost_RELEASE_ABI_TAG "${_boost_RELEASE_ABI_TAG}n") -+ set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}n") - endif() -@@ -1554,3 +1561,3 @@ - if(NOT "x${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "x" AND NOT Boost_VERSION VERSION_LESS 106600) -- string(APPEND _boost_ARCHITECTURE_TAG "-") -+ set(_boost_ARCHITECTURE_TAG "${_boost_ARCHITECTURE_TAG}-") - # This needs to be kept in-sync with the section of CMakePlatformId.h.in -@@ -1558,10 +1565,10 @@ - if(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "IA64") -- string(APPEND _boost_ARCHITECTURE_TAG "i") -+ set(_boost_ARCHITECTURE_TAG "${_boost_ARCHITECTURE_TAG}i") - elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "X86" - OR CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "x64") -- string(APPEND _boost_ARCHITECTURE_TAG "x") -+ set(_boost_ARCHITECTURE_TAG "${_boost_ARCHITECTURE_TAG}x") - elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID MATCHES "^ARM") -- string(APPEND _boost_ARCHITECTURE_TAG "a") -+ set(_boost_ARCHITECTURE_TAG "${_boost_ARCHITECTURE_TAG}a") - elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "MIPS") -- string(APPEND _boost_ARCHITECTURE_TAG "m") -+ set(_boost_ARCHITECTURE_TAG "${_boost_ARCHITECTURE_TAG}m") - endif() -@@ -1569,5 +1576,5 @@ - if(CMAKE_SIZEOF_VOID_P EQUAL 8) -- string(APPEND _boost_ARCHITECTURE_TAG "64") -+ set(_boost_ARCHITECTURE_TAG "${_boost_ARCHITECTURE_TAG}64") - else() -- string(APPEND _boost_ARCHITECTURE_TAG "32") -+ set(_boost_ARCHITECTURE_TAG "${_boost_ARCHITECTURE_TAG}32") - endif() -@@ -1696,3 +1703,4 @@ - # If thread is required, get the thread libs as a dependency --if("thread" IN_LIST Boost_FIND_COMPONENTS) -+list (FIND Boost_FIND_COMPONENTS "thread" _index) -+if (${_index} GREATER -1) - if(Boost_FIND_QUIETLY) -@@ -1974,4 +1982,5 @@ - # error message that lists the libraries we were unable to find. -- string(APPEND Boost_ERROR_REASON -- "\nCould not find the following") -+ set(Boost_ERROR_REASON -+ "${Boost_ERROR_REASON} -+ \nCould not find the following") - if(Boost_USE_STATIC_LIBS) -@@ -1979,8 +1988,10 @@ - endif() -- string(APPEND Boost_ERROR_REASON -- " Boost libraries:\n") -+ set(Boost_ERROR_REASON -+ "${Boost_ERROR_REASON} -+ Boost libraries:\n") - foreach(COMPONENT ${_Boost_MISSING_COMPONENTS}) - string(TOUPPER ${COMPONENT} UPPERCOMPONENT) -- string(APPEND Boost_ERROR_REASON -- " ${Boost_NAMESPACE}_${COMPONENT}${Boost_ERROR_REASON_${UPPERCOMPONENT}}\n") -+ set(Boost_ERROR_REASON -+ "${Boost_ERROR_REASON} -+ ${Boost_NAMESPACE}_${COMPONENT}${Boost_ERROR_REASON_${UPPERCOMPONENT}}\n") - endforeach() -@@ -1990,7 +2001,9 @@ - if (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS}) -- string(APPEND Boost_ERROR_REASON -- "No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.") -+ set(Boost_ERROR_REASON -+ "${Boost_ERROR_REASON} -+ No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.") - else () -- string(APPEND Boost_ERROR_REASON -- "Some (but not all) of the required Boost libraries were found. You may need to install these additional Boost libraries. Alternatively, set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.") -+ set(Boost_ERROR_REASON -+ "${Boost_ERROR_REASON} -+ Some (but not all) of the required Boost libraries were found. You may need to install these additional Boost libraries. Alternatively, set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.") - endif () -@@ -2017,5 +2030,5 @@ - if(EXISTS "${_boost_LIB_DIR}/lib") -- string(APPEND _boost_LIB_DIR /lib) -+ set(_boost_LIB_DIR "_boost_LIB_DIR/lib") - elseif(EXISTS "${_boost_LIB_DIR}/stage/lib") -- string(APPEND _boost_LIB_DIR "/stage/lib") -+ set(_boost_LIB_DIR "${_boost_LIB_DIR}/stage/lib") - else() ---- dyninst-10.1.0/dyninst-10.1.0/cmake/Modules/DyninstSystemPaths.cmake.orig 2019-07-15 22:26:08.783921240 -0400 -+++ dyninst-10.1.0/dyninst-10.1.0/cmake/Modules/DyninstSystemPaths.cmake 2019-07-18 13:53:48.726269387 -0400 -@@ -1,2 +1,3 @@ - set(DYNINST_SYSTEM_INCLUDE_PATHS -+ ${INCLUDE_INSTALL_DIR} - /usr/include -@@ -11,2 +12,3 @@ - set(DYNINST_SYSTEM_LIBRARY_PATHS -+ ${LIB_INSTALL_DIR} - /usr/lib -@@ -22,1 +24,4 @@ - ENV PATH) -+foreach(F ${DYNINST_SYSTEM_LIBRARY_PATHS}) -+ message("DYNINST_SYSTEM_LIBRARY_PATHS " ${F}) -+endforeach() ---- dyninst-10.1.0/dyninst-10.1.0/cmake/Modules/FindLibElf.cmake.orig 2019-05-16 14:40:05.000000000 -0400 -+++ dyninst-10.1.0/dyninst-10.1.0/cmake/Modules/FindLibElf.cmake 2019-07-17 16:45:41.082644142 -0400 -@@ -45,5 +45,4 @@ - find_library(LibElf_LIBRARIES -- NAMES libelf.so.1 libelf.so -- HINTS ${LibElf_ROOT_DIR}/lib ${LibElf_ROOT_DIR} ${LibElf_LIBRARYDIR} -- PATHS ${DYNINST_SYSTEM_LIBRARY_PATHS} -+ NAMES libelf.so.dts.1 libelf.so.1 libelf.so -+ HINTS ${DYNINST_SYSTEM_LIBRARY_PATHS} ${LibElf_ROOT_DIR}/lib ${LibElf_ROOT_DIR} ${LibElf_LIBRARYDIR} - PATH_SUFFIXES ${_path_suffixes}) ---- dyninst-10.1.0/dyninst-10.1.0/cmake/Modules/FindLibDwarf.cmake.orig 2019-05-16 14:40:05.000000000 -0400 -+++ dyninst-10.1.0/dyninst-10.1.0/cmake/Modules/FindLibDwarf.cmake 2019-07-17 21:53:14.098297367 -0400 -@@ -42,5 +42,4 @@ - find_library(LibDwarf_LIBRARIES -- NAMES libdw.so.1 libdw.so -- HINTS ${LibDwarf_ROOT_DIR}/lib ${LibDwarf_ROOT_DIR} ${LibDwarf_LIBRARYDIR} -- PATHS ${DYNINST_SYSTEM_LIBRARY_PATHS} -+ NAMES libdw.so.dts.1 libdw.so.1 libdw.so -+ HINTS ${DYNINST_SYSTEM_LIBRARY_PATHS} ${LibDwarf_ROOT_DIR}/lib ${LibDwarf_ROOT_DIR} ${LibDwarf_LIBRARYDIR} - PATH_SUFFIXES ${_path_suffixes}) ---- dyninst-10.1.0/testsuite-10.1.0/CMakeLists.txt.orig 2019-07-17 14:29:17.614616431 -0400 -+++ dyninst-10.1.0/testsuite-10.1.0/CMakeLists.txt 2019-07-17 14:29:34.865616156 -0400 -@@ -1,4 +1,4 @@ --cmake_minimum_required(VERSION 3.4.0) -+cmake_minimum_required(VERSION 2.8) - project(Dyninst-TestSuite) - - # User must provide location of Dyninst cmake files either as a cache or diff --git a/SOURCES/dyninst-10.1.0-elfstatic.patch b/SOURCES/dyninst-10.1.0-elfstatic.patch deleted file mode 100644 index 14a4755..0000000 --- a/SOURCES/dyninst-10.1.0-elfstatic.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- dyninst-10.1.0/dyninst-10.1.0/symtabAPI/src/emitElfStatic-x86.C.orig 2019-07-15 22:26:08.996921237 -0400 -+++ dyninst-10.1.0/dyninst-10.1.0/symtabAPI/src/emitElfStatic-x86.C 2019-07-15 22:26:08.995921237 -0400 -@@ -275,10 +275,12 @@ - break; - case R_X86_64_PLT32: - case R_X86_64_PC32: -+ /* - case R_X86_64_REX_GOTPCRELX: - fieldSize = sizeof(Elf64_Word); - relocation = symbolOffset + addend - relOffset; - break; -+ */ - case R_X86_64_GOT32: // The address is computed when the GOT is built - fieldSize = sizeof(Elf64_Word); - result = lmap.gotSymbols.find(rel.getDynSym()); diff --git a/SOURCES/dyninst-10.1.0-result.patch b/SOURCES/dyninst-10.1.0-result.patch deleted file mode 100644 index 2738cf2..0000000 --- a/SOURCES/dyninst-10.1.0-result.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- dyninst-10.1.0/dyninst-10.1.0/instructionAPI/h/Result.h.sv 2018-11-09 11:48:08.000000000 -0500 -+++ dyninst-10.1.0/dyninst-10.1.0/instructionAPI/h/Result.h 2018-12-04 22:12:47.369579566 -0500 -@@ -449,10 +449,10 @@ - snprintf(hex, 20, "%x", val.s32val); - break; - case u64: -- snprintf(hex, 20, "%lx", val.u64val); -+ snprintf(hex, 20, "%" PRIx64, val.u64val); - break; - case s64: -- snprintf(hex, 20, "%lx", val.s64val); -+ snprintf(hex, 20, "%" PRIx64, val.s64val); - break; - case sp_float: - snprintf(hex, 20, "%f", val.floatval); -@@ -464,10 +464,10 @@ - snprintf(hex, 20, "%x", val.bitval); - break; - case u48: -- snprintf(hex, 20, "%lx", val.s48val); -+ snprintf(hex, 20, "%" PRIx64, val.s48val); - break; - case s48: -- snprintf(hex, 20, "%lx", val.s48val); -+ snprintf(hex, 20, "%" PRIx64, val.s48val); - break; - case m512: - snprintf(hex, 20, "%p", val.m512val); diff --git a/SOURCES/dyninst-10.2.1-cmake.patch b/SOURCES/dyninst-10.2.1-cmake.patch new file mode 100644 index 0000000..e207127 --- /dev/null +++ b/SOURCES/dyninst-10.2.1-cmake.patch @@ -0,0 +1,305 @@ +# rhel6 and rhel7 need more recent tbb and boost libraries. The dyninst external project setup +# will download, build, and install to the final location. We change that to build from source.tar +# included in the src.rpm, install in the rpmbuild/BUILD tree and finally install into rpmbuild/BUILDTREE +# We also remove the dependency on cmake 3 + + +--- dyninst-10.2.1/dyninst-10.2.1/CMakeLists.txt.orig 2019-07-16 22:08:06.406557467 -0400 ++++ dyninst-10.2.1/dyninst-10.2.1/CMakeLists.txt 2019-07-16 22:07:50.790557717 -0400 +@@ -1,2 +1,2 @@ +-cmake_minimum_required (VERSION 3.4.0) ++cmake_minimum_required (VERSION 2.8) + project (Dyninst) +@@ -227,1 +227,24 @@ + install(FILES ${PROJECT_BINARY_DIR}/CMakeCache.txt DESTINATION ${INSTALL_CMAKE_DIR}) ++ ++# RHEL 6/7 need more recent TBB and BOOST libraries, cmake will build them as an external project. ++# Copy resulting libraries from temp install dir to dyninst install dir ++# Note: FILE GLOB does not work as make has not yet run so we need to explicitly set the list ++ ++set(TBB_AND_BOOST_LIBS tbb/install/lib/libtbbmalloc_proxy.so.2 tbb/install/lib/libtbbmalloc.so.2 tbb/install/lib/libtbb.so.2 boost/install/lib/libboost_atomic.so.1.66.0 boost/install/lib/libboost_chrono.so.1.66.0 boost/install/lib/libboost_date_time.so.1.66.0 boost/install/lib/libboost_filesystem.so.1.66.0 boost/install/lib/libboost_system.so.1.66.0 boost/install/lib/libboost_thread.so.1.66.0 boost/install/lib/libboost_timer.so.1.66.0) ++ ++get_filename_component(install_lib_dir_dir ${INSTALL_LIB_DIR} DIRECTORY) ++get_filename_component(dyninst_dir ${INSTALL_LIB_DIR} NAME) ++get_filename_component(lib_dir ${install_lib_dir_dir} NAME) ++get_filename_component(install_include_dir_dir ${INSTALL_INCLUDE_DIR} DIRECTORY) ++get_filename_component(include_dir ${install_include_dir_dir} NAME) ++foreach(F ${TBB_AND_BOOST_LIBS}) ++ # DESTDIR is prefixed to the install dir ++ message("install ${Dyninst_BINARY_DIR}/${F} into ${CMAKE_INSTALL_PREFIX}/${lib_dir}/${dyninst_dir}") ++ install(PROGRAMS "${Dyninst_BINARY_DIR}/${F}" DESTINATION "${CMAKE_INSTALL_PREFIX}/${lib_dir}/${dyninst_dir}") ++endforeach() ++message("install tbb/install/include into ${CMAKE_INSTALL_PREFIX}/${include_dir}/tbb}") ++install(DIRECTORY DESTINATION "${CMAKE_INSTALL_PREFIX}/${include_dir}/tbb/") ++install(DIRECTORY "tbb/install/include/" DESTINATION "${CMAKE_INSTALL_PREFIX}/${include_dir}") ++# message("install boost/install/include into ${CMAKE_INSTALL_PREFIX}/${include_dir}/boost}") ++# install(DIRECTORY DESTINATION "${CMAKE_INSTALL_PREFIX}/${include_dir}/boost/") ++# install(DIRECTORY "boost/install/include/" DESTINATION "${CMAKE_INSTALL_PREFIX}/${include_dir}/") +--- dyninst-10.2.1/dyninst-10.2.1/cmake/ThreadingBuildingBlocks.cmake.orig 2019-07-15 22:26:08.788921240 -0400 ++++ dyninst-10.2.1/dyninst-10.2.1/cmake/ThreadingBuildingBlocks.cmake 2019-07-16 20:37:56.804643938 -0400 +@@ -107,7 +107,8 @@ + endif() + + # Forcibly update the cache variables +- set(TBB_ROOT_DIR ${CMAKE_INSTALL_PREFIX} CACHE PATH "TBB root directory" FORCE) ++# set(TBB_ROOT_DIR ${CMAKE_INSTALL_PREFIX} CACHE PATH "TBB root directory" FORCE) ++ set(TBB_ROOT_DIR "${CMAKE_BINARY_DIR}/tbb/install" CACHE PATH "TBB root directory" FORCE) + set(TBB_INCLUDE_DIRS ${TBB_ROOT_DIR}/include CACHE PATH "TBB include directory" FORCE) + set(TBB_LIBRARY_DIRS ${TBB_ROOT_DIR}/lib CACHE PATH "TBB library directory" FORCE) + set(TBB_DEFINITIONS "" CACHE STRING "TBB compiler definitions" FORCE) +@@ -152,7 +153,7 @@ + ExternalProject_Add( + TBB + PREFIX ${_tbb_prefix_dir} +- URL https://github.com/01org/tbb/archive/${_tbb_ver_major}_U${_tbb_ver_minor}.tar.gz ++ URL /tmp/2018_U6.tar.gz + BUILD_IN_SOURCE 1 + CONFIGURE_COMMAND "" + BUILD_COMMAND + + +--- dyninst-10.2.1/dyninst-10.2.1/cmake/Boost.cmake.orig 2019-07-15 22:26:08.789921240 -0400 ++++ dyninst-10.2.1/dyninst-10.2.1/cmake/Boost.cmake 2019-07-16 09:32:52.921281788 -0400 +@@ -49,3 +49,3 @@ + # Need at least Boost-1.61 for filesytem components +-set(_boost_min_version 1.61.0) ++set(_boost_min_version 1.66.0) + +@@ -176,3 +176,4 @@ + # Change the base directory +- set(Boost_ROOT_DIR ${CMAKE_INSTALL_PREFIX} CACHE PATH "Base directory the of Boost installation" FORCE) ++# set(Boost_ROOT_DIR ${CMAKE_INSTALL_PREFIX} CACHE PATH "Base directory the of Boost installation" FORCE) ++ set(Boost_ROOT_DIR "${CMAKE_BINARY_DIR}/boost/install" CACHE PATH "TBB root directory" FORCE) + +@@ -210,3 +211,3 @@ + # list(JOIN ...) is in cmake 3.12 +- string(CONCAT _boost_lib_names "${_boost_lib_names}${c},") ++ set(_boost_lib_names "${_boost_lib_names}${c},") + endforeach() +@@ -218,3 +219,3 @@ + PREFIX ${CMAKE_BINARY_DIR}/boost +- URL http://downloads.sourceforge.net/project/boost/boost/${_boost_download_version}/boost_${_boost_download_filename}.zip ++ URL /tmp/boost_${_boost_download_filename}.tar.bz2 + BUILD_IN_SOURCE 1 +--- dyninst-10.2.1/dyninst-10.2.1/cmake/Modules/FindBoost.cmake.orig 2019-07-04 13:11:35.161644923 -0400 ++++ dyninst-10.2.1/dyninst-10.2.1/cmake/Modules/FindBoost.cmake 2019-07-04 13:13:25.646643157 -0400 +@@ -242,3 +242,3 @@ + cmake_policy(PUSH) +-cmake_policy(SET CMP0057 NEW) # if IN_LIST ++# cmake_policy(SET CMP0057 NEW) # if IN_LIST + +@@ -338,3 +338,3 @@ + if("x${basename}" STREQUAL "xTHREAD" AND NOT TARGET Threads::Threads) +- string(APPEND Boost_ERROR_REASON_THREAD " (missing dependency: Threads)") ++ set(Boost_ERROR_REASON_THREAD "${Boost_ERROR_REASON_THREAD} (missing dependency: Threads)") + set(Boost_THREAD_FOUND OFF) +@@ -1021,4 +1021,8 @@ + foreach(componentdep ${_Boost_${uppercomponent}_DEPENDENCIES}) +- if (NOT ("${componentdep}" IN_LIST _boost_processed_components OR "${componentdep}" IN_LIST _boost_new_components)) +- list(APPEND _boost_new_components ${componentdep}) ++ list (FIND _boost_processed_components ${componentdep} _index) ++ if (${_index} EQUAL -1) ++ list (FIND _boost_new_components ${componentdep} _index) ++ if (${_index} EQUAL -1) ++ list(APPEND _boost_new_components ${componentdep}) ++ endif() + endif() +@@ -1199,9 +1203,9 @@ + # enable dynamic linking. +-if(NOT TARGET Boost::diagnostic_definitions) +- add_library(Boost::diagnostic_definitions INTERFACE IMPORTED) +- add_library(Boost::disable_autolinking INTERFACE IMPORTED) +- add_library(Boost::dynamic_linking INTERFACE IMPORTED) +- set_target_properties(Boost::dynamic_linking PROPERTIES +- INTERFACE_COMPILE_DEFINITIONS "BOOST_ALL_DYN_LINK") +-endif() ++# if(NOT TARGET Boost::diagnostic_definitions) ++# add_library(Boost::diagnostic_definitions INTERFACE IMPORTED) ++# add_library(Boost::disable_autolinking INTERFACE IMPORTED) ++# add_library(Boost::dynamic_linking INTERFACE IMPORTED) ++# set_target_properties(Boost::dynamic_linking PROPERTIES ++# INTERFACE_COMPILE_DEFINITIONS "BOOST_ALL_DYN_LINK") ++# endif() + if(WIN32) +@@ -1387,4 +1391,5 @@ + +- string(APPEND Boost_ERROR_REASON +- "Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}\nBoost include path: ${Boost_INCLUDE_DIR}") ++ set(Boost_ERROR_REASON ++ "${Boost_ERROR_REASON} ++ Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}\nBoost include path: ${Boost_INCLUDE_DIR}") + if(Boost_DEBUG) +@@ -1410,4 +1415,5 @@ + # State that we found a version of Boost that is too new or too old. +- string(APPEND Boost_ERROR_REASON +- "\nDetected version of Boost is too ${_Boost_VERSION_AGE}. Requested version was ${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}") ++ set(Boost_ERROR_REASON ++ "${Boost_ERROR_REASON} ++ \nDetected version of Boost is too ${_Boost_VERSION_AGE}. Requested version was ${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}") + if (Boost_FIND_VERSION_PATCH) +@@ -1417,5 +1423,5 @@ + if (NOT Boost_FIND_VERSION_EXACT) +- string(APPEND Boost_ERROR_REASON " (or newer)") ++ set(Boost_ERROR_REASON "${Boost_ERROR_REASON} (or newer)") + endif () +- string(APPEND Boost_ERROR_REASON ".") ++ set(Boost_ERROR_REASON "${Boost_ERROR_REASON}.") + endif () +@@ -1427,4 +1433,5 @@ + set(Boost_FOUND 0) +- string(APPEND Boost_ERROR_REASON +- "Unable to find the Boost header files. Please set BOOST_ROOT to the root directory containing Boost or BOOST_INCLUDEDIR to the directory containing Boost's headers.") ++ set(Boost_ERROR_REASON ++ "${Boost_ERROR_REASON} ++ Unable to find the Boost header files. Please set BOOST_ROOT to the root directory containing Boost or BOOST_INCLUDEDIR to the directory containing Boost's headers.") + endif() +@@ -1518,3 +1525,3 @@ + OR "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xIntel") +- string(APPEND _boost_DEBUG_ABI_TAG "g") ++ set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}g") + endif() +@@ -1523,6 +1530,6 @@ + if(Boost_USE_DEBUG_PYTHON) +- string(APPEND _boost_DEBUG_ABI_TAG "y") ++ set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}y") + endif() + # d using a debug version of your code +-string(APPEND _boost_DEBUG_ABI_TAG "d") ++set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}d") + # p using the STLport standard library rather than the +@@ -1530,4 +1537,4 @@ + if(Boost_USE_STLPORT) +- string(APPEND _boost_RELEASE_ABI_TAG "p") +- string(APPEND _boost_DEBUG_ABI_TAG "p") ++ set(_boost_RELEASE_ABI_TAG "${_boost_RELEASE_ABI_TAG}p") ++ set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}p") + endif() +@@ -1537,4 +1544,4 @@ + if(Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS) +- string(APPEND _boost_RELEASE_ABI_TAG "n") +- string(APPEND _boost_DEBUG_ABI_TAG "n") ++ set(_boost_RELEASE_ABI_TAG "${_boost_RELEASE_ABI_TAG}n") ++ set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}n") + endif() +@@ -1554,3 +1561,3 @@ + if(NOT "x${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "x" AND NOT Boost_VERSION VERSION_LESS 106600) +- string(APPEND _boost_ARCHITECTURE_TAG "-") ++ set(_boost_ARCHITECTURE_TAG "${_boost_ARCHITECTURE_TAG}-") + # This needs to be kept in-sync with the section of CMakePlatformId.h.in +@@ -1558,10 +1565,10 @@ + if(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "IA64") +- string(APPEND _boost_ARCHITECTURE_TAG "i") ++ set(_boost_ARCHITECTURE_TAG "${_boost_ARCHITECTURE_TAG}i") + elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "X86" + OR CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "x64") +- string(APPEND _boost_ARCHITECTURE_TAG "x") ++ set(_boost_ARCHITECTURE_TAG "${_boost_ARCHITECTURE_TAG}x") + elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID MATCHES "^ARM") +- string(APPEND _boost_ARCHITECTURE_TAG "a") ++ set(_boost_ARCHITECTURE_TAG "${_boost_ARCHITECTURE_TAG}a") + elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "MIPS") +- string(APPEND _boost_ARCHITECTURE_TAG "m") ++ set(_boost_ARCHITECTURE_TAG "${_boost_ARCHITECTURE_TAG}m") + endif() +@@ -1569,5 +1576,5 @@ + if(CMAKE_SIZEOF_VOID_P EQUAL 8) +- string(APPEND _boost_ARCHITECTURE_TAG "64") ++ set(_boost_ARCHITECTURE_TAG "${_boost_ARCHITECTURE_TAG}64") + else() +- string(APPEND _boost_ARCHITECTURE_TAG "32") ++ set(_boost_ARCHITECTURE_TAG "${_boost_ARCHITECTURE_TAG}32") + endif() +@@ -1696,3 +1703,4 @@ + # If thread is required, get the thread libs as a dependency +-if("thread" IN_LIST Boost_FIND_COMPONENTS) ++list (FIND Boost_FIND_COMPONENTS "thread" _index) ++if (${_index} GREATER -1) + if(Boost_FIND_QUIETLY) +@@ -1974,4 +1982,5 @@ + # error message that lists the libraries we were unable to find. +- string(APPEND Boost_ERROR_REASON +- "\nCould not find the following") ++ set(Boost_ERROR_REASON ++ "${Boost_ERROR_REASON} ++ \nCould not find the following") + if(Boost_USE_STATIC_LIBS) +@@ -1979,8 +1988,10 @@ + endif() +- string(APPEND Boost_ERROR_REASON +- " Boost libraries:\n") ++ set(Boost_ERROR_REASON ++ "${Boost_ERROR_REASON} ++ Boost libraries:\n") + foreach(COMPONENT ${_Boost_MISSING_COMPONENTS}) + string(TOUPPER ${COMPONENT} UPPERCOMPONENT) +- string(APPEND Boost_ERROR_REASON +- " ${Boost_NAMESPACE}_${COMPONENT}${Boost_ERROR_REASON_${UPPERCOMPONENT}}\n") ++ set(Boost_ERROR_REASON ++ "${Boost_ERROR_REASON} ++ ${Boost_NAMESPACE}_${COMPONENT}${Boost_ERROR_REASON_${UPPERCOMPONENT}}\n") + endforeach() +@@ -1990,7 +2001,9 @@ + if (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS}) +- string(APPEND Boost_ERROR_REASON +- "No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.") ++ set(Boost_ERROR_REASON ++ "${Boost_ERROR_REASON} ++ No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.") + else () +- string(APPEND Boost_ERROR_REASON +- "Some (but not all) of the required Boost libraries were found. You may need to install these additional Boost libraries. Alternatively, set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.") ++ set(Boost_ERROR_REASON ++ "${Boost_ERROR_REASON} ++ Some (but not all) of the required Boost libraries were found. You may need to install these additional Boost libraries. Alternatively, set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.") + endif () +@@ -2017,5 +2030,5 @@ + if(EXISTS "${_boost_LIB_DIR}/lib") +- string(APPEND _boost_LIB_DIR /lib) ++ set(_boost_LIB_DIR "_boost_LIB_DIR/lib") + elseif(EXISTS "${_boost_LIB_DIR}/stage/lib") +- string(APPEND _boost_LIB_DIR "/stage/lib") ++ set(_boost_LIB_DIR "${_boost_LIB_DIR}/stage/lib") + else() +--- dyninst-10.2.1/dyninst-10.2.1/cmake/Modules/DyninstSystemPaths.cmake.orig 2019-07-15 22:26:08.783921240 -0400 ++++ dyninst-10.2.1/dyninst-10.2.1/cmake/Modules/DyninstSystemPaths.cmake 2019-07-18 13:53:48.726269387 -0400 +@@ -1,2 +1,3 @@ + set(DYNINST_SYSTEM_INCLUDE_PATHS ++ ${INCLUDE_INSTALL_DIR} + /usr/include +@@ -11,2 +12,3 @@ + set(DYNINST_SYSTEM_LIBRARY_PATHS ++ ${LIB_INSTALL_DIR} + /usr/lib +@@ -22,1 +24,4 @@ + ENV PATH) ++foreach(F ${DYNINST_SYSTEM_LIBRARY_PATHS}) ++ message("DYNINST_SYSTEM_LIBRARY_PATHS " ${F}) ++endforeach() +--- dyninst-10.2.1/dyninst-10.2.1/cmake/Modules/FindLibElf.cmake.orig 2019-05-16 14:40:05.000000000 -0400 ++++ dyninst-10.2.1/dyninst-10.2.1/cmake/Modules/FindLibElf.cmake 2019-07-17 16:45:41.082644142 -0400 +@@ -45,5 +45,4 @@ + find_library(LibElf_LIBRARIES +- NAMES libelf.so.1 libelf.so +- HINTS ${LibElf_ROOT_DIR}/lib ${LibElf_ROOT_DIR} ${LibElf_LIBRARYDIR} +- PATHS ${DYNINST_SYSTEM_LIBRARY_PATHS} ++ NAMES libelf.so.dts.1 libelf.so.1 libelf.so ++ HINTS ${DYNINST_SYSTEM_LIBRARY_PATHS} ${LibElf_ROOT_DIR}/lib ${LibElf_ROOT_DIR} ${LibElf_LIBRARYDIR} + PATH_SUFFIXES ${_path_suffixes}) +--- dyninst-10.2.1/dyninst-10.2.1/cmake/Modules/FindLibDwarf.cmake.orig 2019-05-16 14:40:05.000000000 -0400 ++++ dyninst-10.2.1/dyninst-10.2.1/cmake/Modules/FindLibDwarf.cmake 2019-07-17 21:53:14.098297367 -0400 +@@ -42,5 +42,4 @@ + find_library(LibDwarf_LIBRARIES +- NAMES libdw.so.1 libdw.so +- HINTS ${LibDwarf_ROOT_DIR}/lib ${LibDwarf_ROOT_DIR} ${LibDwarf_LIBRARYDIR} +- PATHS ${DYNINST_SYSTEM_LIBRARY_PATHS} ++ NAMES libdw.so.dts.1 libdw.so.1 libdw.so ++ HINTS ${DYNINST_SYSTEM_LIBRARY_PATHS} ${LibDwarf_ROOT_DIR}/lib ${LibDwarf_ROOT_DIR} ${LibDwarf_LIBRARYDIR} + PATH_SUFFIXES ${_path_suffixes}) +--- dyninst-10.2.1/testsuite-10.1.0/CMakeLists.txt.orig 2019-07-17 14:29:17.614616431 -0400 ++++ dyninst-10.2.1/testsuite-10.1.0/CMakeLists.txt 2019-07-17 14:29:34.865616156 -0400 +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 3.4.0) ++cmake_minimum_required(VERSION 2.8) + project(Dyninst-TestSuite) + + # User must provide location of Dyninst cmake files either as a cache or diff --git a/SOURCES/dyninst-10.2.1-dbid.patch b/SOURCES/dyninst-10.2.1-dbid.patch new file mode 100644 index 0000000..78f3997 --- /dev/null +++ b/SOURCES/dyninst-10.2.1-dbid.patch @@ -0,0 +1,317 @@ +Debuginfod is a lightweight web service that indexes ELF/DWARF debugging +resources by build-id and serves them over HTTP. + +This patch enables dyninst to query debuginfod servers for a file's +separate debuginfo when it otherwise cannot be found. + +This patch also adds a cmake option -DENABLE_DEBUGINFOD to control +whether dyninst is built with debuginfod support. + +This requires having the debuginfod client library (libdebuginfod) +and header installed. + +Debuginfod is distributed with elfutils, for more information see +https://sourceware.org/elfutils/Debuginfod.html +--- + cmake/ElfUtils.cmake | 37 ++++++++--- + cmake/Modules/FindLibDebuginfod.cmake | 76 +++++++++++++++++++++ + cmake/options.cmake | 2 + + elf/CMakeLists.txt | 3 + + elf/src/Elf_X.C | 95 ++++++++++++++++++++------- + 5 files changed, 178 insertions(+), 35 deletions(-) + create mode 100644 cmake/Modules/FindLibDebuginfod.cmake + +--- dyninst-10.2.1/dyninst-10.2.1/cmake/ElfUtils.cmake ++++ dyninst-10.2.1/dyninst-10.2.1/cmake/ElfUtils.cmake +@@ -28,7 +28,7 @@ + # + #====================================================================================== + +-if(LibElf_FOUND AND LibDwarf_FOUND) ++if(LibElf_FOUND AND LibDwarf_FOUND AND (LibDebuginfod_FOUND OR NOT ENABLE_DEBUGINFOD)) + return() + endif() + +@@ -37,7 +37,12 @@ if(NOT UNIX) + endif() + + # Minimum acceptable version of elfutils +-set(_min_version 0.178) ++if(ENABLE_DEBUGINFOD) ++ set(_min_version 0.179) ++else() ++ set(_min_version 0.178) ++endif() ++ + set(ElfUtils_MIN_VERSION ${_min_version} + CACHE STRING "Minimum acceptable elfutils version") + if(${ElfUtils_MIN_VERSION} VERSION_LESS ${_min_version}) +@@ -62,7 +67,7 @@ set(ElfUtils_LIBRARYDIR "${ElfUtils_ROOT_DIR}/lib" + CACHE PATH "Hint directory that contains the elfutils library files") + + # libelf/dwarf-specific directory hints +-foreach(l LibElf LibDwarf) ++foreach(l LibElf LibDwarf LibDebuginfod) + foreach(d ROOT_DIR INCLUDEDIR LIBRARYDIR) + set(${l}_${d} ${ElfUtils_${d}}) + endforeach() +@@ -72,18 +77,30 @@ endforeach() + + find_package(LibElf ${ElfUtils_MIN_VERSION}) + +-# Don't search for libdw if we didn't find a suitable libelf ++# Don't search for libdw or libdebuginfod if we didn't find a suitable libelf + if(LibElf_FOUND) + find_package(LibDwarf ${ElfUtils_MIN_VERSION}) ++ if (ENABLE_DEBUGINFOD) ++ find_package(LibDebuginfod ${ElfUtils_MIN_VERSION}) ++ endif() + endif() + + # -------------- SOURCE BUILD ------------------------------------------------- +-if(LibElf_FOUND AND LibDwarf_FOUND) +- set(_eu_root ${ElfUtils_ROOT_DIR}) +- set(_eu_inc_dirs ${LibElf_INCLUDE_DIRS} ${LibDwarf_INCLUDE_DIRS}) +- set(_eu_lib_dirs ${LibElf_LIBRARY_DIRS} ${LibDwarf_LIBRARY_DIRS}) +- set(_eu_libs ${LibElf_LIBRARIES} ${LibDwarf_LIBRARIES}) ++if(LibElf_FOUND AND LibDwarf_FOUND AND (NOT ENABLE_DEBUGINFOD OR LibDebuginfod_FOUND)) ++ if(ENABLE_DEBUGINFOD AND LibDebuginfod_FOUND) ++ set(_eu_root ${ElfUtils_ROOT_DIR}) ++ set(_eu_inc_dirs ${LibElf_INCLUDE_DIRS} ${LibDwarf_INCLUDE_DIRS} ${LibDebuginfod_INCLUDE_DIRS}) ++ set(_eu_lib_dirs ${LibElf_LIBRARY_DIRS} ${LibDwarf_LIBRARY_DIRS} ${LibDebuginfod_LIBRARY_DIRS}) ++ set(_eu_libs ${LibElf_LIBRARIES} ${LibDwarf_LIBRARIES} ${LibDebuginfod_LIBRARIES}) ++ else() ++ set(_eu_root ${ElfUtils_ROOT_DIR}) ++ set(_eu_inc_dirs ${LibElf_INCLUDE_DIRS} ${LibDwarf_INCLUDE_DIRS}) ++ set(_eu_lib_dirs ${LibElf_LIBRARY_DIRS} ${LibDwarf_LIBRARY_DIRS}) ++ set(_eu_libs ${LibElf_LIBRARIES} ${LibDwarf_LIBRARIES}) ++ endif() + add_library(ElfUtils SHARED IMPORTED) ++elseif(ENABLE_DEBUGINFOD AND NOT LibDebuginfod_FOUND) ++ message(FATAL_ERROR "Debuginfod enabled but not found") + elseif(NOT (LibElf_FOUND AND LibDwarf_FOUND) AND STERILE_BUILD) + message(FATAL_ERROR "Elfutils not found and cannot be downloaded because build is sterile.") + else() + +--- /dev/null ++++ dyninst-10.2.1/dyninst-10.2.1/cmake/Modules/FindLibDebuginfod.cmake +@@ -0,0 +1,76 @@ ++#======================================================================================== ++# FindDebuginfod ++# ----------- ++# ++# Find debuginfod library and headers ++# ++# The module defines the following variables: ++# ++# This module reads hints about search locations from variables:: ++# ++# LibDebuginfod_ROOT_DIR - Base directory the of libdebuginfod installation ++# LibDebuginfod_INCLUDEDIR - Hint directory that contains the libdebuginfod headers files ++# LibDebuginfod_LIBRARYDIR - Hint directory that contains the libdebuginfod library files ++# ++# and saves search results persistently in CMake cache entries:: ++# ++# LibDebuginfod_FOUND - True if headers and requested libraries were found ++# LibDebuginfod_INCLUDE_DIRS - libdebuginfod include directories ++# LibDebuginfod_LIBRARY_DIRS - Link directories for libdebuginfod libraries ++# LibDebuginfod_LIBRARIES - libdebuginfod library files ++# ++# Utilize package config (e.g. /usr/lib64/pkgconfig/libdebuginfod.pc) to fetch ++# version information. ++# ++#======================================================================================== ++ ++find_package(PkgConfig QUIET) ++pkg_check_modules(PC_Debuginfod QUIET REQUIRED libdebuginfod>=${ElfUtils_MIN_VERSION}) ++set(LibDebuginfod_VERSION "${PC_Debuginfod_VERSION}") ++ ++find_path(LibDebuginfod_INCLUDE_DIRS ++ NAMES ++ debuginfod.h ++ HINTS ++ ${PC_Debuginfod_INCLUDEDIR} ++ ${PC_Debuginfod_INCLUDE_DIRS} ++ ${LibDebuginfod_ROOT_DIR}/include ++ ${LibDebuginfod_ROOT_DIR} ++ ${LibDebuginfod_INCLUDEDIR} ++ PATHS ++ ${DYNINST_SYSTEM_INCLUDE_PATHS} ++ PATH_SUFFIXES ++ ${_path_suffixes} ++ DOC ++ "libdebuginfod include directories") ++ ++find_library(LibDebuginfod_LIBRARIES ++ NAMES ++ libdebuginfod.so.1 libdebuginfod.so ++ HINTS ++ ${PC_Debuginfod_LIBDIR} ++ ${PC_Debuginfod_LIBRARY_DIRS} ++ ${LibDebuginfod_ROOT_DIR}/lib ++ ${LibDebuginfod_ROOT_DIR} ++ ${LibDebuginfod_LIBRARYDIR} ++ PATHS ++ ${DYNINST_SYSTEM_LIBRARY_PATHS} ++ PATH_SUFFIXES ++ ${_path_suffixes}) ++ ++include(FindPackageHandleStandardArgs) ++find_package_handle_standard_args(LibDebuginfod ++ FOUND_VAR ++ LibDebuginfod_FOUND ++ REQUIRED_VARS ++ LibDebuginfod_INCLUDE_DIRS ++ LibDebuginfod_LIBRARIES ++ VERSION_VAR ++ LibDebuginfod_VERSION) ++ ++if(LibDebuginfod_FOUND) ++ set(LibDebuginfod_INCLUDE_DIRS ${LibDebuginfod_INCLUDE_DIRS}) ++ set(LibDebuginfod_LIBRARIES ${LibDebuginfod_LIBRARIES}) ++ get_filename_component(_debuginfod_dir ${LibDebuginfod_LIBRARIES} DIRECTORY) ++ set(LibDebuginfod_LIBRARY_DIRS ${_debuginfod_dir} "${_debuginfod_dir}/elfutils") ++endif() + +--- dyninst-10.2.1/dyninst-10.2.1/cmake/options.cmake ++++ dyninst-10.2.1/dyninst-10.2.1/cmake/options.cmake +@@ -16,6 +16,8 @@ option(USE_COTIRE "Enable Cotire precompiled headers") + + option (ENABLE_LTO "Enable Link-Time Optimization" OFF) + ++option(ENABLE_DEBUGINFOD "Enable debuginfod support" OFF) ++ + # Some global on/off switches + if (LIGHTWEIGHT_SYMTAB) + add_definitions (-DWITHOUT_SYMTAB_API -DWITH_SYMLITE) + +--- dyninst-10.2.1/dyninst-10.2.1/elf/CMakeLists.txt ++++ dyninst-10.2.1/dyninst-10.2.1/elf/CMakeLists.txt +@@ -27,5 +27,8 @@ endif() + add_dependencies(dynElf ElfUtils) + target_link_private_libraries(dynElf ${ElfUtils_LIBRARIES}) + ++if (ENABLE_DEBUGINFOD AND LibDebuginfod_FOUND) ++ add_definitions(-DDEBUGINFOD_LIB) ++endif() + + add_definitions(-DDYNELF_LIB) + + +--- dyninst-10.2.1/dyninst-10.2.1/elf/src/Elf_X.C ++++ dyninst-10.2.1/dyninst-10.2.1/elf/src/Elf_X.C +@@ -47,6 +47,9 @@ + #include + #include + ++#if DEBUGINFOD_LIB ++#include ++#endif + + using namespace std; + using boost::crc_32_type; +@@ -1722,37 +1725,79 @@ bool Elf_X::findDebugFile(std::string origfilename, string &output_name, char* & + } + } + +- if (debugFileFromDebugLink.empty()) +- return false; ++ if (!debugFileFromDebugLink.empty()) { ++ char *mfPathNameCopy = strdup(origfilename.c_str()); ++ string objectFileDirName = dirname(mfPathNameCopy); + +- char *mfPathNameCopy = strdup(origfilename.c_str()); +- string objectFileDirName = dirname(mfPathNameCopy); ++ vector fnames = list_of ++ (objectFileDirName + "/" + debugFileFromDebugLink) ++ (objectFileDirName + "/.debug/" + debugFileFromDebugLink) ++ ("/usr/lib/debug/" + objectFileDirName + "/" + debugFileFromDebugLink); + +- vector fnames = list_of +- (objectFileDirName + "/" + debugFileFromDebugLink) +- (objectFileDirName + "/.debug/" + debugFileFromDebugLink) +- ("/usr/lib/debug/" + objectFileDirName + "/" + debugFileFromDebugLink); ++ free(mfPathNameCopy); + +- free(mfPathNameCopy); ++ for(unsigned i = 0; i < fnames.size(); i++) { ++ bool result = loadDebugFileFromDisk(fnames[i], output_buffer, output_buffer_size); ++ if (!result) ++ continue; + +- for(unsigned i = 0; i < fnames.size(); i++) { +- bool result = loadDebugFileFromDisk(fnames[i], output_buffer, output_buffer_size); +- if (!result) +- continue; +- +- boost::crc_32_type crcComputer; +- crcComputer.process_bytes(output_buffer, output_buffer_size); +- if(crcComputer.checksum() != debugFileCrc) { +- munmap(output_buffer, output_buffer_size); +- continue; +- } ++ boost::crc_32_type crcComputer; ++ crcComputer.process_bytes(output_buffer, output_buffer_size); ++ if(crcComputer.checksum() != debugFileCrc) { ++ munmap(output_buffer, output_buffer_size); ++ continue; ++ } ++ ++ output_name = fnames[i]; ++ cached_debug_buffer = output_buffer; ++ cached_debug_size = output_buffer_size; ++ cached_debug_name = output_name; ++ return true; ++ } ++ } + +- output_name = fnames[i]; +- cached_debug_buffer = output_buffer; +- cached_debug_size = output_buffer_size; +- cached_debug_name = output_name; +- return true; ++#ifdef DEBUGINFOD_LIB ++ if (!debugFileFromBuildID.empty()) { ++ // Given /usr/lib/debug/.buildid/XX/YYYYYY.debug, isolate XXYYYYYY. ++ size_t idx1 = debugFileFromBuildID.find_last_of("/"); ++ size_t idx2 = debugFileFromBuildID.find_last_of("."); ++ ++ if (idx1 == string::npos || idx2 == string::npos ++ || idx1 < 2 || idx1 > idx2) ++ return false; ++ ++ idx1 -= 2; ++ string buildid(debugFileFromBuildID.substr(idx1, idx2 - idx1)); ++ buildid.erase(2, 1); ++ ++ debuginfod_client *client = debuginfod_begin(); ++ if (client == NULL) ++ return false; ++ ++ char *filename; ++ int fd = debuginfod_find_debuginfo(client, ++ (const unsigned char *)buildid.c_str(), ++ 0, &filename); ++ debuginfod_end(client); ++ ++ if (fd >= 0) { ++ string fname = string(filename); ++ free(filename); ++ close(fd); ++ ++ bool result = loadDebugFileFromDisk(fname, ++ output_buffer, ++ output_buffer_size); ++ if (result) { ++ output_name = fname; ++ cached_debug_buffer = output_buffer; ++ cached_debug_size = output_buffer_size; ++ cached_debug_name = output_name; ++ return true; ++ } ++ } + } ++#endif + + return false; + } diff --git a/SOURCES/dyninst-10.2.1-elfstatic.patch b/SOURCES/dyninst-10.2.1-elfstatic.patch new file mode 100644 index 0000000..77525f5 --- /dev/null +++ b/SOURCES/dyninst-10.2.1-elfstatic.patch @@ -0,0 +1,15 @@ +--- dyninst-10.2.1/dyninst-10.2.1/symtabAPI/src/emitElfStatic-x86.C.orig 2019-07-15 22:26:08.996921237 -0400 ++++ dyninst-10.2.1/dyninst-10.2.1/symtabAPI/src/emitElfStatic-x86.C 2019-07-15 22:26:08.995921237 -0400 +@@ -275,10 +275,12 @@ + break; + case R_X86_64_PLT32: + case R_X86_64_PC32: ++ /* + case R_X86_64_REX_GOTPCRELX: + fieldSize = sizeof(Elf64_Word); + relocation = symbolOffset + addend - relOffset; + break; ++ */ + case R_X86_64_GOT32: // The address is computed when the GOT is built + fieldSize = sizeof(Elf64_Word); + result = lmap.gotSymbols.find(rel.getDynSym()); diff --git a/SOURCES/testsuite-10.1.0-386.patch b/SOURCES/testsuite-10.1.0-386.patch index 38dcd3a..7fbee48 100644 --- a/SOURCES/testsuite-10.1.0-386.patch +++ b/SOURCES/testsuite-10.1.0-386.patch @@ -1,5 +1,20 @@ ---- dyninst-10.1.0/testsuite-10.1.0/src/instruction/test_instruction_farcall.C -+++ dyninst-10.1.0/testsuite-10.1.0/src/instruction/test_instruction_farcall.C +--- dyninst-10.2.0/testsuite-10.1.0/CMakeLists.txt ++++ dyninst-10.2.0/testsuite-10.1.0/CMakeLists.txt +@@ -111,7 +111,8 @@ + if(UNIX) + enable_language(ASM-ATT) +- if("${DYNINST_PLATFORM}" MATCHES "i386") +- enable_language(ASM_NASM) +- endif() ++# nasm/yasm are deprecated ++# if("${DYNINST_PLATFORM}" MATCHES "i386") ++# enable_language(ASM_NASM) ++# endif() + elseif(WIN32) + enable_language(ASM_MASM) + +--- dyninst-10.2.0/testsuite-10.1.0/src/instruction/test_instruction_farcall.C ++++ dyninst-10.2.0/testsuite-10.1.0/src/instruction/test_instruction_farcall.C @@ -96,21 +96,21 @@ test_results_t test_instruction_farcall_Mutator::executeTest() if(decodedInsns.size() != expectedInsns) // six valid, one invalid { diff --git a/SOURCES/testsuite-10.1.0-gcc11.patch b/SOURCES/testsuite-10.1.0-gcc11.patch new file mode 100644 index 0000000..8fc536c --- /dev/null +++ b/SOURCES/testsuite-10.1.0-gcc11.patch @@ -0,0 +1,13 @@ +diff --git a/testsuite-10.1.0/src/dyninst/test1_3.C b/testsuite-10.1.0/src/dyninst/test1_3.C +index d32f630..b9bd0ba 100644 +--- a/testsuite-10.1.0/src/dyninst/test1_3.C ++++ b/testsuite-10.1.0/src/dyninst/test1_3.C +@@ -134,7 +134,7 @@ test_results_t test1_3_Mutator::executeTest() + } + + // see if we can find the address +- if (expr3_1->getBaseAddr() <= 0) ++ if (expr3_1->getBaseAddr() == 0) + { + logerror("*Error*: address %p for %s is not valid\n", + expr3_1->getBaseAddr(), globalVar); diff --git a/SOURCES/testsuite-10.1.0-gettid.patch b/SOURCES/testsuite-10.1.0-gettid.patch new file mode 100644 index 0000000..9b75b25 --- /dev/null +++ b/SOURCES/testsuite-10.1.0-gettid.patch @@ -0,0 +1,15 @@ +--- dyninst-10.1.0/testsuite-10.1.0/src/proccontrol/pcontrol_mutatee_tools.c.orig 2019-05-31 05:20:00.492379706 +0200 ++++ dyninst-10.1.0/testsuite-10.1.0/src/proccontrol/pcontrol_mutatee_tools.c 2019-05-31 05:10:11.354826668 +0200 +@@ -62,9 +62,9 @@ + #if !defined(os_windows_test) + #include + +-static unsigned int gettid(){ +- return (unsigned int)pthread_self(); +-} ++// static unsigned int gettid(){ ++// return (unsigned int)pthread_self(); ++// } + #endif + + thread_t threads[MAX_POSSIBLE_THREADS]; diff --git a/SOURCES/testsuite-10.1.0-throw.patch b/SOURCES/testsuite-10.1.0-throw.patch new file mode 100644 index 0000000..886e9b5 --- /dev/null +++ b/SOURCES/testsuite-10.1.0-throw.patch @@ -0,0 +1,14 @@ +--- dyninst-10.2.0/testsuite-10.1.0/src/test_lib.h ++++ dyninst-10.2.0/testsuite-10.1.0/src/test_lib.h +@@ -158,3 +158,3 @@ + +- TESTLIB_DLL_EXPORT virtual ~LocErr() THROW; ++ TESTLIB_DLL_EXPORT virtual ~LocErr() throw(); + +--- dyninst-10.2.0/testsuite-10.1.0/src/test_lib.C ++++ dyninst-10.2.0/testsuite-10.1.0/src/test_lib.C +@@ -112,3 +112,3 @@ + +-LocErr::~LocErr() THROW ++LocErr::~LocErr() throw() + {} diff --git a/SPECS/dyninst.spec b/SPECS/dyninst.spec index cfe8a01..d25315a 100644 --- a/SPECS/dyninst.spec +++ b/SPECS/dyninst.spec @@ -4,27 +4,31 @@ Summary: An API for Run-time Code Generation License: LGPLv2+ Name: %{?scl_prefix}dyninst Group: Development/Libraries -Release: 5%{?dist} +Release: 1%{?dist} URL: http://www.dyninst.org -Version: 10.1.0 +Version: 10.2.1 Exclusiveos: linux ExclusiveArch: %{ix86} x86_64 +%define __testsuite_version 10.1.0 Source0: https://github.com/dyninst/dyninst/archive/v%{version}/dyninst-%{version}.tar.gz -Source1: https://github.com/dyninst/testsuite/archive/v%{version}/testsuite-%{version}.tar.gz +Source1: https://github.com/dyninst/testsuite/archive/v%{__testsuite_version}/testsuite-%{__testsuite_version}.tar.gz Source2: https://sourceforge.net/projects/boost/files/boost/1.66.0/boost_1_66_0.tar.bz2 Source3: https://github.com/01org/tbb/archive/2018_U6.tar.gz -Patch1: dyninst-10.1.0-result.patch -Patch2: testsuite-10.1.0-386.patch -Patch3: dyninst-10.1.0-cmake.patch -Patch4: dyninst-10.1.0-elfstatic.patch +Patch1: dyninst-10.2.1-cmake.patch +Patch2: dyninst-10.2.1-elfstatic.patch +Patch3: dyninst-10.2.1-dbid.patch +Patch4: testsuite-10.1.0-386.patch +Patch5: testsuite-10.1.0-gcc11.patch +Patch6: testsuite-10.1.0-gettid.patch +Patch7: testsuite-10.1.0-throw.patch %if 0%{?rhel} <= 7 -Patch5: testsuite-10.1.0-mutateecompiler.patch +Patch8: testsuite-10.1.0-mutateecompiler.patch %endif %global dyninst_base dyninst-%{version} -%global testsuite_base testsuite-%{version} +%global testsuite_base testsuite-%{__testsuite_version} BuildRequires: zlib-devel @@ -42,7 +46,7 @@ BuildRequires: tbb tbb-devel %if 0%{?rhel} >= 7 BuildRequires: libstdc++-static %endif -BuildRequires: gcc-gfortran glibc-static nasm libxml2-devel +BuildRequires: gcc-gfortran glibc-static libxml2-devel %if 0%{?rhel} <= 7 # C++11 requires devtoolset gcc. @@ -50,10 +54,12 @@ BuildRequires: %{?scl_prefix}gcc-c++ BuildRequires: %{?scl_prefix}elfutils BuildRequires: %{?scl_prefix}elfutils-devel BuildRequires: %{?scl_prefix}elfutils-libelf-devel +BuildRequires: %{?scl_prefix}elfutils-debuginfod-client-devel Requires: %{?scl_prefix}elfutils %else BuildRequires: elfutils-devel BuildRequires: elfutils-libelf-devel +BuildRequires: elfutils-debuginfod-client-devel %endif # Testsuite files should not provide/require anything @@ -117,12 +123,15 @@ cp %{_topdir}/SOURCES/boost_1_66_0.tar.bz2 /tmp # setup source4 tbb by copying where cmake can find it to build its own copy cp %{_topdir}/SOURCES/2018_U6.tar.gz /tmp -%patch1 -p1 -b.result -%patch2 -p1 -b.386 -%patch3 -p1 -b.cmake -%patch4 -p1 -b.elfstatic +%patch1 -p1 -b.cmake +%patch2 -p1 -b.elfstatyic +%patch3 -p1 -b.dbid +%patch4 -p1 -b.386 +%patch5 -p1 -b.gcc11 +%patch6 -p1 -b.gettid +%patch7 -p1 -b.throw %if 0%{?rhel} <= 7 -%patch5 -p1 -b.mutateecompiler +%patch8 -p1 -b.mutateecompiler %endif # cotire seems to cause non-deterministic gcc errors @@ -134,39 +143,48 @@ sed -i.cotire -e 's/USE_COTIRE true/USE_COTIRE false/' \ cd %{dyninst_base} -%if 0%{?rhel} == 6 +%if 0%{?rhel} <= 7 # C++11 requires devtoolset gcc. %{?scl:PATH=%{_bindir}${PATH:+:${PATH}}} %endif +CFLAGS="$CFLAGS $RPM_OPT_FLAGS" +LDFLAGS="$LDFLAGS $RPM_LD_FLAGS" %if 0%{?scl:1} -CPPFLAGS="-I%{_includedir}" -export CPPFLAGS -LDFLAGS="-L%{_libdir} -L%{_libdir}/elfutils" -export LDFLAGS + CPPFLAGS="-I%{_includedir}" + LDFLAGS="-L%{_libdir} -L%{_libdir}/elfutils" +%endif +%ifarch %{ix86} + CFLAGS="$CFLAGS -fno-lto -march=i686" + LDFLAGS="$LDFLAGS -fno-lto" %endif +CXXFLAGS="$CFLAGS" +export CPPFLAGS CFLAGS CXXFLAGS LDFLAGS + %cmake \ -DENABLE_STATIC_LIBS=1 \ + -DENABLE_DEBUGINFOD=1 \ -DCMAKE_BUILD_TYPE:STRING=None \ -DINSTALL_LIB_DIR:PATH=%{_libdir}/dyninst \ -DINSTALL_INCLUDE_DIR:PATH=%{_includedir}/dyninst \ -DINSTALL_CMAKE_DIR:PATH=%{_libdir}/cmake/Dyninst \ - -DLIBDWARF_LIBRARIES:FILEPATH="$libdwarf_builddir/libdwarf.a;-lz" \ - -DLIBDWARF_INCLUDE_DIR:PATH=$libdwarf_builddir \ -DBoost_NO_BOOST_CMAKE=ON \ - -DCMAKE_SKIP_RPATH:BOOL=YES + -DCMAKE_SKIP_RPATH:BOOL=YES \ + . # Dependencies building tbb, boost before dyninst are not correct # make %{?_smp_mflags} LD_RUN_PATH="%{_libdir}" export LD_RUN_PATH +# %make_build make -j1 # Hack to install dyninst nearby, so the testsuite can use it make DESTDIR=../install install find ../install -name '*.cmake' -execdir \ sed -i -e 's!%{_prefix}!../install&!' '{}' '+' - +# cmake mistakenly looks for libtbb.so in the dyninst install dir +sed -i '/libtbb.so/ s/".*usr/"\/usr/' $PWD/../install%{_libdir}/cmake/Dyninst/commonTargets.cmake cd ../%{testsuite_base} %cmake \ @@ -176,19 +194,26 @@ cd ../%{testsuite_base} -DBoost_NO_BOOST_CMAKE=ON \ -DCMAKE_SKIP_RPATH:BOOL=YES \ . -make %{?_smp_mflags} +%make_build %install cd %{dyninst_base} -make DESTDIR=$RPM_BUILD_ROOT install +%make_install # It doesn't install docs the way we want, so remove them. # We'll just grab the pdfs later, directly from the build dir. rm -v %{buildroot}%{_docdir}/*-%{version}.pdf cd ../%{testsuite_base} -make DESTDIR=$RPM_BUILD_ROOT install +%make_install + +# Ugly hack to mask testsuite files from debuginfo extraction. Running the +# testsuite requires debuginfo, so extraction is useless. However, debuginfo +# extraction is still nice for the main libraries, so we don't want to disable +# it package-wide. The permissions are restored by attr(755,-,-) in files. +find %{buildroot}%{_libdir}/dyninst/testsuite/ \ + -type f '!' -name '*.a' -execdir chmod 644 '{}' '+' %files %defattr(-,root,root,-) @@ -230,22 +255,15 @@ make DESTDIR=$RPM_BUILD_ROOT install %files testsuite %defattr(-,root,root,-) %{_bindir}/parseThat -# Remove example tools packaged with dyninst -%exclude %{_bindir}/cfg_to_dot -%exclude %{_bindir}/codeCoverage -%exclude %{_bindir}/unstrip -%exclude %{_bindir}/ddb.db -%exclude %{_bindir}/params.db -%exclude %{_bindir}/unistd.db -# and the corresponding debuginfo -%exclude /usr/lib/debug/%{_bindir}/codeCoverage*debug -%exclude /usr/lib/debug/%{_bindir}/unstrip*debug %dir %{_libdir}/dyninst/testsuite/ %attr(755,root,root) %{_libdir}/dyninst/testsuite/*[!a] %attr(644,root,root) %{_libdir}/dyninst/testsuite/*.a %changelog +* Fri Jan 22 2021 Stan Cox - 10.2.1-1 +- Update to 10.2.1 + * Wed Jul 22 2020 Stan Cox - 10.1.0-5 - Patch checkMutateeCompiler.cmake to force use of %{?scl_prefix}gcc-c++