Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • D dynamorio
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,467
    • Issues 1,467
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 44
    • Merge requests 44
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • DynamoRIO
  • dynamorio
  • Merge requests
  • !4582

i#4370: Fix CMake 3.18 and 3.19 build failures

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Derek Bruening requested to merge i4370-cmake-3.18 into master Dec 03, 2020
  • Overview 16
  • Commits 6
  • Pipelines 0
  • Changes 35

Fixes several problems encountered with CMake 3.18+:

  1. Deprecated old version support. Solved by updating our minimums everywhere to 3.7 which was already our top-level minimum. At this point it should be fine to require clients to use 3.7 too.

  2. Assembly compilation breakage from two factors:

A) The CMake-generated define -Ddynamorio_EXPORTS is being passed as --defsym dynamorio_EXPORTS in for asm targets, but we pass that to cpp.

B) Various compiler flags like --MD are in and cpp does not like them.

My solution for assembly is to:

  1. set(CMAKE_ASM_DEFINE_FLAG "-D")

  2. Remove from the cpp command for asm. We do end up needing "-mavx*" to set the built-in defines AVX, etc. I put in explicit setting of "-mavx*" using the existing avx support queries, shifted earlier during config.

  3. Move all of our preprocessor defines from COMPILE_FLAGS properties with explicit -D to COMPILE_DEFINITIONS properites without -D so we get them in .

    This was a little involved:

    • There were a number of places pasing defines as flags.

    • COMPILE_FLAGS is a string while COMPILE_DEFINITIONS is a list, necessitating some conversions and changes in handling.

    • I had to split out a new function DynamoRIO_extra_defines from DynamoRIO_extra_cflags. I maintained the get_DynamoRIO_defines interface.

    • I had to update several places like in test setup where we remove defines to avoid duplicates from the command line and configure.h.

Fixes #4370 (closed)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: i4370-cmake-3.18