-
-
Notifications
You must be signed in to change notification settings - Fork 32k
The configure script incorrectly detects crypt() when it doesn't exist #123917
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
Comments
Sounds like a reasonable thing to fix, even if it's not necessarily technically a supported platform. Are you interested in submitting a PR? |
Note: 3.12 is the last version to actually include the |
Hm. I have worked around my issue by adding a patch with the above change to my local Python build environment. I don't anticipate taking a new build of Python 3.12.x; the next time I import a Python it will be >=3.13. If this change is not needed there, and I'm the only one who has ever run into this, I'm not sure it's worth trying to create a fix just for that branch. |
I wrote PR gh-123952 to fix the issue in the 3.12 branch. @madscientist: Would you mind to test the fix in your setup? |
Use the volatile keyword when checking crypt_r() or crypt() function in the configure script. Without volatile, the assignment can be removed by an optimization. Co-Authored-By: Paul Smith <[email protected]>
Use the volatile keyword when checking crypt_r() or crypt() function in the configure script. Without volatile, the assignment can be removed by an optimization. Co-Authored-By: Paul Smith <[email protected]>
Check if the function is not NULL to use the variable. Otherwise, a compiler can remove the variable making the check useless. Co-Authored-By: Paul Smith <[email protected]>
Use a global volatile variable and check if the function is not NULL to use the variable. Otherwise, a compiler optimization can remove the variable making the check useless. Co-Authored-By: Paul Smith <[email protected]>
Use a global volatile variable and check if the function is not NULL to use the variable. Otherwise, a compiler optimization can remove the variable making the check useless. Co-authored-by: Paul Smith <[email protected]>
Fixed by 53af5b2. Thanks for your bug report and your fix @madscientist. |
Closing as completed since this only affected Python 3.12. |
Bug report
Bug description:
I'm trying to build Python in a very limited sysroot, with limited functionality. In particular, there is no crypt library in this restricted system.
Unfortunately, Python configure detects that there IS a crypt() and then the build fails:
I believe the problem is that this test is insufficient (from configure.ac):
If you compile and link the above with CFLAGS=-O2 then the assignment will be optimized away. I think you can force it by changing the test like this:
If I do this then the link fails as expected even with
-O2
.CPython versions tested on:
3.12
Operating systems tested on:
Linux
Linked PRs
The text was updated successfully, but these errors were encountered: