Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
pablogsal opened this issue Aug 24, 2024 · 0 comments
Closed
Labels
build The build process and cross-build type-bug An unexpected behavior, bug, or error

Comments

@pablogsal
Copy link
Member

pablogsal commented Aug 24, 2024

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

@pablogsal pablogsal changed the title CPython does not record and propagate LDCXXSHARED in sysconfig CPython does not record and propagate linker flags to LDCXXSHARED in sysconfig Aug 24, 2024
pablogsal added a commit to pablogsal/cpython that referenced this issue Aug 24, 2024
@picnixz picnixz added build The build process and cross-build type-bug An unexpected behavior, bug, or error labels Aug 24, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Aug 25, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Aug 25, 2024
pablogsal added a commit that referenced this issue Aug 25, 2024
…123298) (#123320)

gh-123297: Propagate LD_FLAGS to LDCXXSHARED in sysconfig (GH-123298)
(cherry picked from commit c535a49)

Co-authored-by: Pablo Galindo Salgado <[email protected]>
pablogsal added a commit that referenced this issue Aug 25, 2024
…123298) (#123319)

gh-123297: Propagate LD_FLAGS to LDCXXSHARED in sysconfig (GH-123298)
(cherry picked from commit c535a49)

Co-authored-by: Pablo Galindo Salgado <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants