-
-
Notifications
You must be signed in to change notification settings - Fork 32k
bpo-45433: Do not link libpython against libcrypt #28881
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
Conversation
Would you mind to add a NEWS entry? See https://devguide.python.org/ IMO it's worth it to mention the change in the "Build Changes" of What's New in Python 3.11: Doc/whatsnew/3.11.rst. |
Added the NEWS entry. |
Can you please also mention the change in the "Build Changes" of What's New in Python 3.11: Doc/whatsnew/3.11.rst? |
Save/restore LIBS when calling AC_SEARCH_LIBS(..., crypt). This avoid linking libpython with libcrypt.
Sorry, I thought adding the NEWS entry would somehow auto-update the whatsnew document. I added an entry to the latter. |
How can I check https://bugs.python.org/issue45433 manually? On Fedora, /usr/lib64/libpython3.10.so.1.0 is not linked to libcrypt. |
I think most distros build with LDFLAGS="-Wl,--as-needed". That causes unused libraries to get automatically dropped by the linker. There are a couple of alternate things to check:
|
I tested manually this PR and I confirm that it works as expected. I build Python with Without this change, libpython is linked to libcrypt by mistake:
With this change, libcrypt is gone as expected:
|
Nicely spotted, thanks for the fix! I prefer to not backport to avoid any risk of regression. In my experience, the build system is fragile. |
Save/restore LIBS when calling AC_SEARCH_LIBS(..., crypt). This avoid linking libpython with libcrypt.
libcrypt.so again makes an unwanted appearance. It turns out CPython's configure up until 3.11 exhibited arguably buggy behavior where as part of searching for libcrypt it always added `-lcrypt` to LIBS, which got picked up by all linker invocations. Partially applying the upstream patch on CPython < 3.11 makes the problem go away. See also python/cpython#28881. Closes #197.
Save/restore LIBS when calling AC_SEARCH_LIBS(..., crypt). This avoid
linking libpython with libcrypt.
https://bugs.python.org/issue45433