Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • VTK-m VTK-m
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 205
    • Issues 205
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 35
    • Merge requests 35
  • 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
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • VTKVTK
  • VTK-mVTK-m
  • Merge requests
  • !2616

Don't Force Use

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Li-Ta Lo requested to merge ollielo/vtk-m:no_forced_use into master Oct 27, 2021
  • Overview 11
  • Commits 1
  • Pipelines 4
  • Changes 1

In a previous MR !2604 (merged) tried to fix the problem of symbols being discarded by GCC during linking time when optimization is on. The solution used the used attribute to force a symbol to be considered as used. However, the root cause is very likely not due to a symbol simply been dropped by the linker, it is due to the static keyword in front of these function templates. static keywords makes a function internal linkage and safe to be optimized out during linking if the said function is not used by the translation unit. However, this is not the case. Another downside of static function template is that each translation unit has all the instantiations of the functions and can not be consolidated at linking time, causing bloated binary files.

This has been tested with GCC 11 which was reported to exhibit the problem (and was reproduced).

Edited Oct 27, 2021 by Li-Ta Lo
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: no_forced_use