Skip to content

bpo-44458: Ensure BUFFER_BLOCK_SIZE symbol is statically allocated. #26808

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

Merged
merged 2 commits into from
Jun 22, 2021

Conversation

freakboy3742
Copy link
Contributor

@freakboy3742 freakboy3742 commented Jun 20, 2021

Modifies the declaration of BUFFER_BLOCK_SIZE to be static, so that if multiple modules include the pycore_blocks_output_buffer.h header file, the resulting Python executable is able to link.

Without this declaration, if two or more of the bz2, lzma or zlib modules are compiled as statically linked modules (i.e., added to Lib/Setup.local), linking the Python executable results in a duplicate symbol error:

duplicate symbol '_BUFFER_BLOCK_SIZE' in:
    libpython3.10.a(_bz2module.o)
    libpython3.10.a(_lzmamodule.o)
duplicate symbol '_BUFFER_BLOCK_SIZE' in:
    libpython3.10.a(_bz2module.o)
    libpython3.10.a(zlibmodule.o)

https://bugs.python.org/issue44458

@gpshead gpshead added the needs backport to 3.10 only security fixes label Jun 22, 2021
@gpshead gpshead merged commit 92c2e91 into python:main Jun 22, 2021
@miss-islington
Copy link
Contributor

Thanks @freakboy3742 for the PR, and @gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-26844 is a backport of this pull request to the 3.10 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Jun 22, 2021
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 22, 2021
…ythonGH-26808)

* bpo-44458: Ensure BUFFER_BLOCK_SIZE symbol is statically allocated.
(cherry picked from commit 92c2e91)

Co-authored-by: Russell Keith-Magee <[email protected]>
gpshead pushed a commit that referenced this pull request Jun 22, 2021
…H-26808) (GH-26844)

* bpo-44458: Ensure BUFFER_BLOCK_SIZE symbol is statically allocated.
(cherry picked from commit 92c2e91)

Co-authored-by: Russell Keith-Magee <[email protected]>
@freakboy3742 freakboy3742 deleted the buffer-block-size-fix branch June 23, 2021 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants