Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • CMake CMake
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,871
    • Issues 3,871
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 19
    • Merge requests 19
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMake
  • CMakeCMake
  • Issues
  • #16561
Closed
Open
Created Jan 12, 2017 by Eduard Valeyev@evaleevContributor

additional linker flags may be necessary even if POSITION_INDEPENDENT_CODE is OFF

when applied to executables setting property POSITION_INDEPENDENT_CODE to ON leads to creation of position-independent executables (PIE). Some platforms (OS X) and/or compilers (gcc6) do or can be configured to create position-independent executables by default (e.g. see recent Ubuntu). Some codes rely on disabled PIE, and it is logical to do this by setting POSITION_INDEPENDENT_CODE target property to OFF. However, this does not work since setting property POSITION_INDEPENDENT_CODE to OFF for executables may require additional linker flags (-no_pie on OS X, -no-pie gcc5+ option, etc.). The additional linker flags are not currently added by CMake, i.e., POSITION_INDEPENDENT_CODE does not fully control the PIE/non-PIE behavior.

p.s. INTERFACE_POSITION_INDEPENDENT_CODE needs to handle this also.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking