Skip to content
GitLab
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 4,106
    • Issues 4,106
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 18
    • Merge requests 18
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and 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
  • CMakeCMake
  • CMakeCMake
  • Issues
  • #17436
Closed
Open
Issue created Nov 06, 2017 by Marc Aldorasi@marcContributor

CMake no longer excludes libgcc_eh from the implicit link libraries

Commit d59e3509 removed gcc.* from the list of filtered implicit link libraries. This causes CMake to add -lgcc_eh to the linker flags when compiling a mixed C/C++ project on mingw, which means libgcc_eh.a is statically linked into every binary. This means that each dll has its own copy of exception handling and TLS code, which can cause problems (see https://public.kitware.com/pipermail/cmake/2017-August/066128.html for an example). In addition, the GCC developers recommend against having multiple copies of libgcc_eh at runtime (see https://gcc.gnu.org/ml/gcc/2012-03/msg00104.html).

As a workaround, adding list(REMOVE_ITEM CMAKE_C_IMPLICIT_LINK_LIBRARIES gcc_eh) will stop it from being implicitly linked.

gcc_eh.* should be added to the list of filtered implicit link libraries to fix this problem.

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