[DynInst_API:] [dyninst/dyninst] 739ad5: CMake modernization (#1391)


Date: Tue, 25 Apr 2023 10:03:57 -0700
From: Tim Haines <noreply@xxxxxxxxxx>
Subject: [DynInst_API:] [dyninst/dyninst] 739ad5: CMake modernization (#1391)
  Branch: refs/heads/master
  Home:   https://github.com/dyninst/dyninst
  Commit: 739ad57883f032fb18a6c741f0c2f98e9a766bc7
      https://github.com/dyninst/dyninst/commit/739ad57883f032fb18a6c741f0c2f98e9a766bc7
  Author: Tim Haines <thaines.astro@xxxxxxxxx>
  Date:   2023-04-25 (Tue, 25 Apr 2023)

  Changed paths:
    M .cmake-format.yaml
    M .github/workflows/dependency-version.yaml
    M .gitignore
    M CMakeLists.txt
    R DyninstConfigVersion.cmake
    M README.md
    R cmake/Boost.cmake
    A cmake/DyninstCapArchDef.cmake
    M cmake/DyninstConfig.cmake.in
    R cmake/DyninstConfigVersion.cmake.in
    A cmake/DyninstInstall.cmake
    A cmake/DyninstLanguageStandards.cmake
    A cmake/DyninstLibrary.cmake
    A cmake/DyninstLibrarySettings.cmake
    A cmake/DyninstOptimization.cmake
    A cmake/DyninstOptions.cmake
    A cmake/DyninstPlatform.cmake
    A cmake/DyninstWarnings.cmake
    R cmake/ElfUtils.cmake
    R cmake/LanguageStandards.cmake
    R cmake/LibIberty.cmake
    R cmake/Modules/DyninstSystemPaths.cmake
    R cmake/Modules/FindBoost.cmake
    A cmake/Modules/FindElfutils.cmake
    A cmake/Modules/FindLibDW.cmake
    M cmake/Modules/FindLibDebuginfod.cmake
    R cmake/Modules/FindLibDwarf.cmake
    A cmake/Modules/FindLibELF.cmake
    R cmake/Modules/FindLibElf.cmake
    M cmake/Modules/FindLibIberty.cmake
    R cmake/Modules/FindTBB.cmake
    R cmake/Modules/FindThreadDB.cmake
    A cmake/Modules/FindThread_DB.cmake
    M cmake/Modules/FindValgrind.cmake
    R cmake/ThreadingBuildingBlocks.cmake
    R cmake/ThreadingBuildingBlocks.install.cmake
    R cmake/cap_arch_def.cmake
    A cmake/dyninstversion.h.in
    R cmake/optimization.cmake
    R cmake/options.cmake
    R cmake/platform.cmake
    R cmake/platform_unix.cmake
    R cmake/platform_windows.cmake
    R cmake/shared.cmake
    A cmake/tpls/DyninstBoost.cmake
    A cmake/tpls/DyninstElfUtils.cmake
    A cmake/tpls/DyninstLibIberty.cmake
    A cmake/tpls/DyninstOpenMP.cmake
    A cmake/tpls/DyninstTBB.cmake
    A cmake/tpls/DyninstThread_DB.cmake
    A cmake/tpls/DyninstThreads.cmake
    A cmake/tpls/DyninstValgrind.cmake
    R cmake/version.h.in
    R cmake/visibility.cmake
    R cmake/warnings.cmake
    M common/CMakeLists.txt
    M docker/dependencies.versions
    M dwarf/CMakeLists.txt
    M dynC_API/CMakeLists.txt
    M dyninstAPI/CMakeLists.txt
    M dyninstAPI/h/BPatch_addressSpace.h
    M dyninstAPI/h/BPatch_instruction.h
    M dyninstAPI/src/Relocation/CFG/RelocBlock.C
    M dyninstAPI/src/Relocation/Transformers/Instrumenter.C
    M dyninstAPI/src/Relocation/Transformers/Modification.C
    M dyninstAPI/src/Relocation/Transformers/Movement-adhoc.C
    M dyninstAPI/src/Relocation/Transformers/Movement-analysis.C
    M dyninstAPI/src/Relocation/Widgets/ASTWidget.C
    M dyninstAPI/src/Relocation/Widgets/CFWidget-aarch64.C
    M dyninstAPI/src/Relocation/Widgets/CFWidget-ppc.C
    M dyninstAPI/src/Relocation/Widgets/CFWidget-x86.C
    M dyninstAPI/src/Relocation/Widgets/CFWidget.C
    M dyninstAPI/src/Relocation/Widgets/CallbackWidget.C
    M dyninstAPI/src/Relocation/Widgets/InstWidget.C
    M dyninstAPI/src/Relocation/Widgets/PCWidget-aarch64.C
    M dyninstAPI/src/Relocation/Widgets/PCWidget-ppc.C
    M dyninstAPI/src/Relocation/Widgets/PCWidget-x86.C
    M dyninstAPI/src/Relocation/Widgets/PCWidget.C
    M dyninstAPI/src/Relocation/Widgets/RelDataWidget.C
    M dyninstAPI/src/Relocation/Widgets/StackModWidget.C
    M dyninstAPI_RT/CMakeLists.txt
    M elf/CMakeLists.txt
    M instructionAPI/CMakeLists.txt
    M parseAPI/CMakeLists.txt
    M parseAPI/src/debug_parse.C
    M parseAPI/src/debug_parse.h
    M parseThat/CMakeLists.txt
    M patchAPI/CMakeLists.txt
    M proccontrol/CMakeLists.txt
    R scripts/dynsysname
    R scripts/sysname
    M stackwalk/CMakeLists.txt
    M symlite/CMakeLists.txt
    M symlite/h/SymLite-elf.h
    M symlite/src/SymLite-elf.C
    M symtabAPI/CMakeLists.txt

  Log Message:
  -----------
  CMake modernization (#1391)

# Changes to building Dyninst
- Minimum CMake version is 3.14.0
- STERILE_BUILD is now deprecated
- ENABLE_LTO was renamed to DYNINST_ENABLE_LTO
- CMAKE_EXPORT_COMPILE_COMMANDS is no longer set
- Platform detection is done natively in CMake
  - full support for Linux on x86, AMD64, ppc64le, and aarch64/ARMv8
  - experimental support for 32-bit FreeBSD and Windows on x86
- Custom install targets <target>-install have been removed
- Installation subpaths (bin, lib, include, etc.)  are no longer user-configurable
- Static versions of Dyninst libraries now depend on other static Dyninst libraries
  - For example, libDynElf.a now depends on libcommon.a, not libcommon.so
- Libraries that cannot build with symlight now warn when LIGHTWEIGHT_SYMTAB=ON
- User build options passed via CMAKE_<LANG>_FLAGS are correctly preserved and override the builtin options
- <PackageName>_ROOT_DIR now implies <PackageName>_NO_SYSTEM_PATHS and sets <PackageName>_ROOT
  - This forces CMake to find the package at the given location or in CMAKE_PREFIX_PATH
  - When using CMake >= 3.16, searching CMAKE_PREFIX_PATH can be disabled with CMAKE_FIND_USE_CMAKE_PATH=OFF
  - For example, -DElfUtils_ROOT_DIR=/some/path sets ElfUtils_NO_SYSTEM_PATHS=ON and ElfUtils_ROOT=/some/path

## RPATH handling
- CMP0060 is active and so libraries are linked by their full paths even in implicit directories (e.g., /usr/lib/foo.so instead of -lfoo)
- Populate RPATHs for binaries in the build tree: set(CMAKE_SKIP_BUILD_RPATH FALSE)
- Do not use the install path as the RPATH: set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
  - $ORIGIN is used instead
- Add paths to any directories outside the project that are in the linker search path or contain linked library files: set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

## Third-party libraries (tpl)
- The ability to build tpls from source has been removed
- All libraries must have a CMakeConfig.cmake
- Minimum versions
  - Boost: 1.71.0
  - TBB/oneapi-tbb: 2019.9
  - elfutils: 0.186
- An imported interface named Dyninst::<library> is created for each library
  - includes are marked SYSTEM so they don't produce warnings
  - exported in DyninstConfig.cmake as per https://cmake.org/cmake/help/latest/guide/importing-exporting/index.html
- pkgconfig is used to find elfutils and valgrind
  - if pkgconfig fails, a manual search is done
  - This can be disabled with  ElfUtils_NO_SYSTEM_PATHS=ON

# Changes to consuming Dyninst as a CMake project
- All targets are in the Dyninst namespace; e.g., symtabAPI is now Dyninst::symtabAPI
- Each third-party library has an associated imported interface named Dyninst::<library>, e.g., Dyninst::Boost
  - Users are encouraged to use these, if the same library is need in their applications
- DYNINST_LIBRARIES has been removed
- DYNINST_INCLUDE_DIR is now deprecated and will be removed in a future version
  - Use the provided targets, instead
- DYNINST_INTERNAL_DEFINES is now deprecated and will be removed in a future version
- DYNINST_PLATFORM is now deprecated and will be removed in a future version
- find_package(Dyninst ... COMPONENTS ...) now works correctly
- Version constraints for find_package(Dyninst X.Y.Z) now work correctly
  - Dyninst only guarantees ABI compatibility between major releases, so only the same major versions are compatible

Users who are not ready to fully migrate to the new Dyninst CMake package may use the following to preserve backward compatibility:

cmake
if(TARGET Dyninst::common)
  foreach(t common symtabapi ...)
    add_library(${t} INTERFACE IMPORTED)
    target_link_libraries(${t} INTERFACE Dyninst::${t})
  endforeach()
endif()

* Update minimum CMake version to 3.13.0

* Rename CMake files to prevent name collisions

When consumed as a subproject, the CMake files could be imported into the parent project where the filenames could collide.

* Prepend to CMAKE_MODULE_PATH instead of overwriting

* Fix capitalization error in FindThread_DB

This should silence the warning about Thread_Db versus Thread_DB

* Require CMake package for TBB (#1322)

* Make libdl/dbghelp private linkage

* Remove TBB flags from toolkits that don't use TBB

* Remove FindTBB.cmake

All supported TBB versions ship as CMake packages, so this is no longer
needed.

* Remove from-source build option

* Create an imported target for TBB used by Dyninst

This is needed to force the include directories to be considered 'system' directories so that compiler warnings from TBB sources are ignored

* Rename cmake/ThreadingBuildingBlocks.cmake -> cmake/tpls/DyninstTBB.cmake

This is needed to keep the namespace clean for DyninstConfig.cmake

* Export TBB as part of the Dyninst CMake package

This is required by the CMake guidelines:
  https://cmake.org/cmake/help/latest/guide/importing-exporting/index.html

In particular,
  "All required dependencies of a package must also be found in the package configuration file"

* Format DyninstTBB.cmake

* Boost CMake modernization (#1330)

* Remove FindBoost.cmake

Use the one provided by CMake so we don't have to maintain this one.

* Remove from-source build

* Remove user-configurable version

* Force use of multithreaded libraries

We don't need to include Threads here. Boost will do that.

* Disable use of statically-linked runtime

* Remove Boost_DEBUG

* Always enable searching system paths

* Unify path calculations, pass to find_package as hints

* Clean up comments

* Use include_guard

* Allow using Boost's CMake package

It is now provided by default since 1.70.0 which is the current minimum
acceptable version.

* Remove rest of cache variables

* Remove MSVC-specific template define

We can add this back, if we find there are newer VCs still affected.

* Make Dyninst::Boost imported interface target

This is needed to make the include directories be "system" directories
so that warnings in their headers do not propagate into Dyninst.

* Do not add Boost as a dependency for all libs

* Make find_package QUIET

* Use Boost_* variables instead of calculating includes, libs, etc.

* Make a header-only wrapper target

* Add to Dyninst package

* Update CMakeLists

* Set Boost_NO_WARN_NEW_VERSIONS

* Bump minimum version to 1.71.0

* Elfutils cmake modernization (#1333)

* Rename FindLibDwarf -> FindLibDW

* Update FindLibDW

* Rename FindLibElf -> FindLibELF

* Update FindLibELF

* Create FindElfutils

* Update FindLibDebuginfod

* Update DyninstElfUtils

* Update the CMakeLists to use new targets

* Use CMP0074 in updated Find modules

This enables use of <Package>_ROOT variables when find_package is
invoked.

* Provide default dummy interface target for ElfUtils::ElfUtils

Needed for non-Unix platforms.

* Fix rebase bug in CMakeLists.txt

* Export DyninstElfUtils

* Forward QUIET flag to pkg_check_modules

* Forward version to pkg_check_modules

* Use lib from pkg-config, if found

* Clean up internal variables

* Simplify cache variable handling

* Use full linkage name for libs returned by pkg-config

* Separate out dependent libraries in FindLibDW

Some platforms include libelf as a dependency, but IMPORTED_LOCATION accepts only a single entry. Store the rest in IMPORTED_LINK_DEPENDENT_LIBRARIES.

* Fix quoting bug in FindLibDW

* Fix lib check in FindLibDW

* Manually set PC_<XXX>_INCLUDE_DIRS when FindPkgConfig misses it

FindPkgConfig uses the output from pkg-config --cflags-only-I <lib> to set PC_<XXX>_INCLUDE_DIRS. Because libelf is usually in a system directory, pkg-config will return nothing for this. FindPkgConfig stores the actual includedir variable from the PC file, so we can fetch it from there.

* Libiberty cmake modernization (#1334)

* LibIberty cmake modernization

* Use INCLUDE_DIRS directly

* Threaddb cmake modernization (#1338)

* Update FindThread_DB

* Update thread_db

* Update docs URL

* Use OpenMP target (#1339)

This also provides a dummy target so we don't have to do any additional checking when USE_OpenMP=OFF. We only use OpenMP_CXX, so I didn't create a target for the other languages (C,Fortran).

* Valgrind cmake modernization (#1340)

* Update valgrind

* Add version check in Find module

* Remove Valgrind_LIBRARIES

They are versioned by architecture, so are hard to nail down with
find_library. We also don't need them (at least not yet).

* Make dummy when ADD_VALGRIND_ANNOTATIONS=OFF

* Add compile defs

* Update CMakeLists.txt

* Make the dummy IMPORTED

* Fix bug with version handling in DyninstBoost

* Use _min_version in DyninstBoost

This is so the CI version check will work uniformly

* Add existence check for Dyninst::Boost before creating target

* Clean up find_package flag handling in Find modules

* Make variable exports uniform across Find modules

* Coalesce calls to set_target_properties in Find modules

* Fix bug in DyninstElfutils when calling find_package LibDebuginfod

* Make just one exported target in FindElfutils

* Add target existence check in DyninstTBB

* Add SYSTEM property to Elfutils includes

* Remove export of DYNINST_LIBRARIES

* Preserve user's module path when looking for Dyninst modules

* Manually set legacy DYNINST_INCLUDE_DIR

This is now deprecated.

* Use CMAKE_CURRENT_LIST_DIR intead of DYNINST_CMAKE_DIR

* Install Find modules for third-party libraries

* Remove unused DyninstConfigVersion.cmake

* Remove unneeded comments in DyninstOptions

* Move all options to DyninstOptions

* Remove modification of CMAKE_CONFIGURATION_TYPES

We just support the usual configs.

* Move Dyninst version strings to base CMakeLists.txt

* Move internal includes into base CMakeListst.txt

This ensures that all user options and internal settings are in place
before third-party dependencies are configured.

* Clean up 3rd party includes in base CMakeLists.txt

* Remove unused version strings

* Remove unneeded 'add_dependencies(common boost)' in base CMakeListst.txt

This is now handled directly in CMake recipe for common.

* Remove unused testsuite include in base CMakeLists.txt

* Update the project declaration

* Move setting of CMAKE_BUILD_TYPE to base CMakeLists.txt

This keeps all CMake-level variables in one place.

* Don't set CMAKE_EXPORT_COMPILE_COMMANDS

The user should set this.

* Move BUILD_SHARED_LIBS into base CMakeLists.txt

* Remove unused INSTALL_DOC_DIR

* Make cmake_minimum_required a FATAL_ERROR

* Move rpath and shared lib settings into DyninstLibrary

* Move installation items into DyninstInstall.cmake

* Automatically generate DyninstConfigVersion.cmake

* Use configure_package_config_file to generate DyninstConfig.cmake

This will provide more utilities to make a more robust Config.cmake

* Use INSTALL_INCLUDE_DIR to set DYNINST_INCLUDE_DIR

* Use PACKAGE_INIT in Config.cmake.in

Also use it for DYNINST_INCLUDE_DIR

* Don't explicitly set Dyninst_FOUND

The caller's find_package will do this.

* Remove unused DyninstSystemPaths.cmake

* Simplify visibility settings and move to DyninstLibrary

* Move SYMREADER calculation to base CMakeLists.txt

It is needed in several places before DyninstLibrary is included.

* Merge platform calculations into a DyninstPlatform.cmake

* Remove DyninstVisibility include

* Moved configure_file back to base CMakeListst

The ordering matters until common gets an explicit list of header files (currently uses a glob).

* Remove DyninstConfigVersion.cmake.in

This isn't needed anymore since the version file is generated automatically.

* Remove custom target install

cmake_install.cmake isn't intended to be used that way.

* Remove install logic from dyninst_library

That is now handled in DyninstInstall.

* cmake-format: set tab size to 2

* cmake-format: don't format comments

* Calculate platform from CMake-provided mechanisms

These are equivalent to the existing bash, but more adaptable.

* Map stringy names into CMake variables

* Replace Windows platform check with DYNINST_OS_Windows

* Replace Linux platform check with DYNINST_OS_Linux

* Replace FreeBSD platform check with DYNINST_OS_FreeBSD

* Replace x86 platform check with DYNINST_OS_x86_64

* Replace ppc platform check with DYNINST_ARCH_ppc64le

* Replace aarch64 platform check with DYNINST_ARCH_aarch64

* Replace mangled platform checks with explicit DYNINST_{OS,ARCH}

* Rename PLATFORM to DYNINST_PLATFORM and export it as legacy

This is only used in the test suite.

* Don't pass -m64 explicitly on ppc64le

We only support 64-bit ppc, so this is redundant and non-portable.

* Remove commented-out define for aarch64

* Simplify CapArchDef

With the new variables, only one pass over the OS names is needed.

* Allow FreeBSD to build on i386

I previously thought it was only allowed on x86_64, but there is an old platform called i386-unknown-freebsd7.2.

* Add Windows to DYNINST_PLATFORM

* Replace usage of WIN32 with DYNINST_OS_Windows

* Replace usage of UNIX with DYNINST_OS_UNIX

* Merge Linux+FreeBSD checks into UNIX check

* symtabAPI - replace i386 check

* Use 'option' instead of 'set(... CACHE ...)'

* Deprecate STERILE_BUILD

* DyninstOptions - use 'OFF' instead of 'NO'

* Get rid of dyninst_link_private_library

We require CMake >= 3.13.0 so this is no longer needed.

* Rename SOVERSION to DYNINST_SOVERSION

SOVERSION is a keyword.

* Replace LIBVERSION with DYNINST_LIBVERSION

For clarity and consistency.

* Replace DYNINST_ROOT with PROJECT_SOURCE_DIR

* Move library settings into DyninstLibrarySettings.cmake

* DyninstLibrarySettings - don't make INSTALL_*_DIR absolute

In 'install', they are relative to CMAKE_INSTALL_PREFIX by default.

* DyninstLibrarySettings - don't make INSTALL_*_DIR cache variables

There's no need to let the user modify these locations.

* DyninstLibrarySettings - reuse INSTALL vars

This just makes sure changes are propagated.

* DyninstLibrarySettings - remove INSTALL_BIN_DIR

It's not used.

* DyninstLibrary - rename INSTALL_*_DIR -> DYNINST_INSTALL_*DIR

This is more in line with the naming convention of GNUInstallDirs. We
could use GNUInstallDirs directly, but there's no need to let the user
configure the install directory layout.

* DyninstLibrarySettings - Use 'Dyninst' instead of PROJECT_NAME

This is the only placed PROJECT_NAME is used, so make it consistent.

* DyninstLibrarySettings - update RPATH handling

* DyninstLibrary - don't manually create cmake_install.cmake

These are automatically created and installed by 'install'.

* DyninstLibrary - Merge calls to set_target_properties

* DyninstLibrary - Cleanup superfluous variable usage

* DyninstLibrary - add Windows defines to targets instead of directories

* DyninstLibrary - add LIGHTWEIGHT_SYMTAB, SW_ANALYSIS_STEPPER to targets

* DyninstLibrary - add DYNINST_DIAGNOSTIC_NO_SUPPRESSIONS to targets

* DyninstLibrary - export all targets to DyninstTargets.cmake

* DyninstLibrary - don't treat each library as a separate component

'COMPONENT' in 'install' is used to group targets into "bags" of useful
features that can be independently installed using cmake --install .
--component .... That doesn't work for Dyninst. Note: This is
orthogonal to the concept of a COMPONENT in find_package.

* DyninstLibrary - remove CLEAN_DIRECT_OUTPUT

We no longer offer per-library build targets.

* DyninstLibrary - remove WITHOUT_SYMTAB_API and WITHOUT_SYMLITE

These are never used.

* DyninstLibrary - refactor global defines in 'dyninst_library'

* DyninstLibrary - Move calculation of SYMREADER

* DyninstLibrary - rename 'target' to '_target'

'target' is a keyword

* DyninstLibrary - add named arguments

* DyninstLibrary - rename SRC_LIST with _target_SOURCE_FILES

The latter is created from the named argument 'SOURCE_FILES'.

* DyninstLibrary - Replace ACTUAL_TARGETS with _all_targets

* DyninstLibrary - make headers part of library declaration

This tracks file changes to signal rebuilds.

* DyninstLibrary - add links, properties, includes to all targets

This synchronizes the SHARED and STATIC libraries.

* DyninstLibrary - link private and public deps separately

* DyninstLibrary - Set include directories on interfaces

This replaces using PUBLIC_HEADERS which is really intended for use with
MacOS Framework targets.

* DyninstLibrary - remove LIBRARY_OUTPUT_DIRECTORY

The default is CMAKE_CURRENT_BINARY_DIR, so no need to specify it.

* DyninstLibrary - Apply DEFINES passed to dyninst_library

* DyninstLibrary - make SHARED library explicit

* DyninstLibrary - don't deref Boolean variable

* DyninstLibrary - update message

* DyninstLibrary - Install headers, preserving the directory structure

* DyninstLibrary - "return" the list of generated target names

* DyninstLibrary - add directory-level include guard

* common - remove spurious files

Added in 2015.

* common - move generation of dyninstversion.h into CMakeLists.txt

* common - add global include guard in CMakeLists

* common - explicitly list header files in CMakeLists

This makes it easier to see what the actual public files are.

* common - refactor source list calculation

* common - move include of DyninstLibrary into subdirectory

* common - use new dyninst_library

* common - set includes and Windows stuff on all targets

* common - write 'dyninstverison.h' into source dir

* elf - make a dummy target for non-Unix OSes

* elf - use new dyninst_library

* dwarf - use new dyninst_library

The changes here are the same as for elf/CMakeLists

* symlite - make symlite/h/SymLite-elf.h publicly consumable

It refers to files in the build tree that aren't available in the
install tree. Although this file is in the install tree, it was never
consumable by users. Updating this is of questionable utility, but it at
least gives us the opportunity to write tests against the public
interface.

* symlite - use new dyninst_library

* instructionAPI - use new dyninst_library

* symtabAPI - use new dyninst_library

* proccontrol - use new dyninst_library

* parseAPI - use full path to common/h/util.h.

This prevents confusion with parseAPI/h/util.h.

* parseAPI - use new dyninst_library

This one is different from the rest because parseAPI and dataflowAPI
have circular dependencies on each other, so it's not currently possible
to split them up.

* stackwalk - use new dyninst_library

Previously, FORCE_FRAME_POINTER was applied to _all_ of Dyninst. The
commit comments said it was supposed to be just for the stackwalk
sources, so that is the new behavior.

* stackwalk - incorporate check of SW_ANALYSIS_STEPPER

It only affects stackwalk, so no need to put it on all of the targets.

* stackwalk - put SW_ANALYSIS_STEPPER check in post-processing

This tidies up the code a bit.

* patchAPI - use new dyninst_library

* dyninstAPI - use absolute include path for 'debug.h'

* dyninstAPI - add missing include for Dyninst::Address

This was transitively included, but breaks when reording includes.

* dyninstAPI - add missing include for std::set

* dyninstAPI - use new dyninst_library

* dynC_API - use new dyninst_library

* parseThat - use new dyninst_library

* dyninstAPI_RT - use new dyninst_library

1. SRC_ASSEMBLY was never used. The assembly files have always been
explicitly listed.

2. We are still linking libdl.so on the static versions of the runtime.
This hasn't been an issue in the past, so we'll leave it.

3. The creation of the lists of source files has redundant checks in it,
but this version is much clearer on what is actually happening.

4. CHECK_C_COMPILER_FLAG_EXTENDED was removed since CMake now supports a
much larger set of compilers and Dyninst has dropped support for HP,
Sun, and XL.

5. The config is much less noisy. There was no reason to determine if
32-bit support would work when the user didn't ask for it. Now, the
config will fail if the user asks for 32-bit libraries and the compiler
can't create them.

* Remove top-level project includes

All of the necessary includes are now handled by each toolkit via
explicit import/export of targets and include directories.

* Remove top-level check for SYMREADER

The respective CMakeLists now handle this.

* Add better handling of Threads/pthread

1. Move Threads include into a tpls module

2. Link against Threads::Threads instead of 'pthread'

3. Add explicit dependencies in dyninstAPI and dyninstAPI_RT (they were
implicit before).

* DyninstConfig - Correctly detect presence of COMPONENTS on import

This previously didn't work at all because DYNINST_${COMP}_FOUND should
have been spelled Dyninst_${COMP}_FOUND. This is simpler and allows the
use of check_required_components directly.

* DyninstConfig - Remove unneeded and (now) incorrect comments

* Make an OpenMP tpl module

This will make it easier to export OpenMP in DyninstConfig. It also makes CMakeLists.txt have just straight-line code.

* Include all third-party libraries in DyninstConfig

This is explicitly required by the CMake documentation:

  "All required dependencies of a package must also be found in the
package configuration file."

  https://cmake.org/cmake/help/latest/guide/importing-exporting/index.html

This also ensures that the custom Dyninst:: targets are always available
to consumers.

* Ensure static libraries depend on static Dyninst libraries

When creating a static Dyninst library, ensure that it depends on the
corresponding static Dyninst library. For example, libDynElf.a should
depend on libcommon.a, not libcommon.so.

* DyninstWarnings - Ignore no-pragma warnings for non-Werror builds

* DyninstCapArchDef - rename UNIFIED_DEFINES

DYNINST_PLATFORM_CAPABILITIES is more descriptive.

* DyninstCapArchDef - add include guard

* DyninstLibrary - add DYNINST_PLATFORM_CAPABILITIES to all targets

* DyninstLibrary - add documentation

* DyninstLibrary - update comment about install dir structure

* DyninstLibrary - install runtime in 'bin'

* Include 'src' and 'h' subdirectories in BUILD_INTERFACE

Every toolkit has a similar directory structure, so we can do this
in just one location instead of in each CMakeLists.

* Unswitch loops for platform-specific target updates in CMakeLists

This is really a code beautification.

* Remove DYNINST_LIBVERSION

It's never different from DYNINST_VERSION and has no special purpose.

* Remove system path detection in RPATH calculations

We use CMAKE_BUILD_WITH_INSTALL_RPATH to ensure the install path is not
in RPATH/RUNPATH, but then this code would add it back if the install
directory isn't a system path.

* DyninstLibrary - simplify regex for header install

* Rename cmake/version.h.in to cmake/dyninstversion.h.in

This makes the generated file match the generator file name.

* DyninstLibrary - install from _target_PUBLIC_HEADER_FILES

_public_headers was only incidentally present from the file including
this one.

* parseAPI - make headers PRIVATE in dyninst_library

We manually install them because of how dataflowAPI is consumed.

* Issues warning when toolkit cannot be built with LIGHTWEIGHT_SYMTAB

* CMake modernization - update compiler flags (#1374)

* Fix spelling of LibDW_INCLUDE_DIRS when marking it as advanced

* Mark STERILE_BUILD as advanced

* Mark Boost_DIR as advanced

* Mark TBB_DIR as advanced

* Mark Thread_DB_{INCLUDE_DIRS,LIBRARIES} and as advanced

* Update README

* Add gfx908 public headers

These somehow didn't make it through the rebase

* Make flags for RelWithDebInfo and Release match

* Disable cmake-format for extra flags in DyninstWarnings

* Propagate ElfUtils_ROOT_DIR to FindLib{ELF,DW,Debuginfod}

* Use 'set' instead of 'option' for stringy options

* Add more cmake-format exceptions in DyninstWarnings

* Add <Package>_NO_SYSTEM_PATHS to elf, dw, debuginfod

This is used to exclude system directories from the search process.

* Have ElfUtils_ROOT_DIR override search paths

If the user provides a value, then no system paths (aside from the ones
in CMAKE_PREFIX_PATH) are searched. This lets the user 'force' a
location for elfutils.

* Remove explicit version fail check in elfutils find-modules

* Move ElfUtils_ROOT_DIR check into DyninstElfutils

* Add LibIberty_NO_SYSTEM_PATHS

* Add Valgrind_NO_SYSTEM_PATHS

* Remove explicit version check from FindValgrind

* Boost - use new meaning of Boost_ROOT_DIR

* Fix typo in DyninstElfUtils

* Fix bug when setting path flags

* TBB - use new meaning of TBB_ROOT_DIR

* Add support for common/h/unaligned_memory_access.h

* Set default DYNINST_LINKER to empty

This will use the default linker. lld is the LLVM linker.

* Make requesting an unknown component an error

* Always build libdyninstAPI_RT.a

This is always needed by the test suite and keeps the old behavior of having it built by default.

* Add DYNINST_FORCE_RUNPATH option

Setting this flag forces the linker to use RUNPATH instead of RPATH.
This is most useful for working with older RedHat distros.

* Reduce number of public link dependencies

This reduces the number of transitive links that have to be done by
binaries linking against Dyninst.

* Make elfutils dependency public for symtab

It's needed in the Module.h public header.

* Require TBB >=2019.9

When building from source, versions before 2019.9 incorrectly set the
version in TBBConfigVersion.cmake. For example, 2018.6 sets the version
to 2018.0 because it uses the TBB_{MAJOR,MINOR}_VERSION from tbb_stddef.h
instead of doing the calculation based on the engineering version.

This also unifies the versions required when compiling with gcc and clang.

TBB 2018.6 was released in Oct 2018 and 2019.9 was released in Oct 2019,
so this just bumps the requirement by just a year even though there are
at least 9 releases in between.

* Update Boost version in docker/dependencies.versions

* Update filenames in dependency-version CI check

* Update variable names in dependency-version CI check

* Make elfutils dependency public for dynElf

* bump CMake minimum version to 3.14.0

The 3.13.* family requires every 'install' to specify a "LIBRARY
DESTINATION". We don't need or want that in the custome parseAPI install
(line ~130) for exporting the public headers.

* Add cmake to dependency-version CI check

* Rename cdna2 -> gfx90a in new layout

* Always create list of static-only sources in dyninstAPI_RT

* Add common/h to BUILD_INTERFACE in 32-bit libdyninstAPI_RT

* Fix building with symLite

The headers from symtabAPI are still required, even when building with symLite.


[← Prev in Thread] Current Thread [Next in Thread→]
  • [DynInst_API:] [dyninst/dyninst] 739ad5: CMake modernization (#1391), Tim Haines <=