Skip to content

_ctypes fails to import on NetBSD due to a missing alloca symbol #134486

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

Closed
collinfunk opened this issue May 22, 2025 · 0 comments
Closed

_ctypes fails to import on NetBSD due to a missing alloca symbol #134486

collinfunk opened this issue May 22, 2025 · 0 comments
Labels
OS-netbsd topic-ctypes type-bug An unexpected behavior, bug, or error

Comments

@collinfunk
Copy link
Contributor

collinfunk commented May 22, 2025

Bug report

Bug description:

After running ./configure && gmake on a NetBSD 10 machine, the build finishes with the following warning:

Written build/lib.netbsd-10.0-evbarm-3.15/_sysconfigdata__netbsd10_.py
Written build/lib.netbsd-10.0-evbarm-3.15/_sysconfig_vars__netbsd10_.json
./python -E -c 'import sys ; from sysconfig import get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' >platform
./python -E ./Tools/build/generate-build-details.py `cat pybuilddir.txt`/build-details.json
[ERROR] _ctypes failed to import: /home/collinfunk/cpython/build/lib.netbsd-10.0-evbarm-3.15/_ctypes.cpython-315.so: Undefined PLT symbol "alloca" (symnum = 48)

This is due to an incomplete check for alloca in the _ctypes.h module.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Other

Linked PRs

@collinfunk collinfunk added the type-bug An unexpected behavior, bug, or error label May 22, 2025
collinfunk added a commit to collinfunk/cpython that referenced this issue May 22, 2025
Previously the module would fail to load because the ``alloca`` symbol
was undefined. Now we check for GCC/Clang builtins for systems who do
not define ``alloca`` in headers.
@AA-Turner AA-Turner changed the title _ctypes fails to import on NetBSD due to a missing alloca symbol _ctypes fails to import on NetBSD due to a missing alloca symbol May 22, 2025
collinfunk added a commit to collinfunk/cpython that referenced this issue May 23, 2025
Previously the module would fail to load because the ``alloca`` symbol
was undefined. Now we check for GCC/Clang builtins for systems who do
not define ``alloca`` in headers.
collinfunk added a commit to collinfunk/cpython that referenced this issue May 23, 2025
Previously the module would fail to load because the ``alloca`` symbol
was undefined. Now we check for GCC/Clang builtins for systems who do
not define ``alloca`` in headers.
vstinner pushed a commit that referenced this issue May 23, 2025
Previously the module would fail to load because the `alloca()` symbol
was undefined. Now we check for GCC/Clang builtins for systems who do
not define `alloca()` in headers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-netbsd topic-ctypes type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

4 participants