Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-134486: Fix missing alloca symbol in _ctypes on NetBSD.#134487

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
vstinner merged 1 commit intopython:mainfromcollinfunk:fix-alloca-definition
May 23, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-134486: Fix missing alloca symbol in _ctypes on NetBSD.
Previously the module would fail to load because the ``alloca`` symbolwas undefined. Now we check for GCC/Clang builtins for systems who donot define ``alloca`` in headers.
  • Loading branch information
@collinfunk
collinfunk committedMay 23, 2025
commit93f6e60fc156cdab5d19ff840a73255013a504a5
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
The :mod:`ctypes` module now performs a more portable test for the
definition of :manpage:`alloca(3)`, fixing a compilation failure on
NetBSD.
9 changes: 0 additions & 9 deletionsModules/_ctypes/callbacks.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,18 +11,9 @@
#include"pycore_call.h"// _PyObject_CallNoArgs()
#include"pycore_runtime.h"// _Py_ID()

#ifdefMS_WIN32
# include<malloc.h>
#endif

#include<ffi.h>
#include"ctypes.h"

#ifdefHAVE_ALLOCA_H
/* AIX needs alloca.h for alloca() */
#include<alloca.h>
#endif

/**************************************************************/

staticint
Expand Down
8 changes: 0 additions & 8 deletionsModules/_ctypes/callproc.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -77,16 +77,8 @@ module _ctypes
#include<mach-o/dyld.h>
#endif

#ifdefMS_WIN32
#include<malloc.h>
#endif

#include<ffi.h>
#include"ctypes.h"
#ifdefHAVE_ALLOCA_H
/* AIX needs alloca.h for alloca() */
#include<alloca.h>
#endif

#ifdef_Py_MEMORY_SANITIZER
#include<sanitizer/msan_interface.h>
Expand Down
14 changes: 13 additions & 1 deletionModules/_ctypes/ctypes.h
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
#if defined (__SVR4) && defined (__sun)
/* Get a definition of alloca(). */
#if (defined (__SVR4) && defined (__sun)) || defined(HAVE_ALLOCA_H)
# include <alloca.h>
#elif defined(MS_WIN32)
# include <malloc.h>
#endif

/* If the system does not define alloca(), we have to hope for a compiler builtin. */
#ifndef alloca
# if defined __GNUC__ || (__clang_major__ >= 4)
# define alloca __builtin_alloca
# else
# error "Could not define alloca() on your platform."
# endif
#endif

#include <stdbool.h>
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp