Skip to content

CPython does not record and propagate linker flags to LDCXXSHARED in sysconfig #123297

Closed

Description

@pablogsal

CPython records and propagates several compilation-related flags from the time CPython is built, which in turn are used by distutils and setuptools to pass them to extension modules.

Unfortunately after pypa/distutils#228, distutils now introduced a new LDCXXSHARED, and are using that in preference to LDSHARED when linking C++ code. We do set LDCXXSHARED but we don't propagate LDFLAGS to that variable if the user has set in the environment.

This is a problem because many distributions use the old variable LDFLAGS to propagate linker flags to extension modules (such as hardening and configuration flags) and now these are silently failing for C++ extension modules.

Linked PRs

Activity

  1. changed the title [-]CPython does not record and propagate LDCXXSHARED in sysconfig[/-] [+]CPython does not record and propagate linker flags to LDCXXSHARED in sysconfig[/+] on Aug 24, 2024
  2. added a commit that references this issue on Aug 24, 2024
  3. added
    buildThe build process and cross-build
    type-bugAn unexpected behavior, bug, or error
    on Aug 24, 2024
  4. added a commit that references this issue on Aug 25, 2024
  5. added 2 commits that reference this issue on Aug 25, 2024
  6. added 2 commits that reference this issue on Aug 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildThe build process and cross-buildtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions