diff --git a/Include/internal/pycore_mmap.h b/Include/internal/pycore_mmap.h index 897816db01077f..63033e30c5cbee 100644 --- a/Include/internal/pycore_mmap.h +++ b/Include/internal/pycore_mmap.h @@ -11,12 +11,17 @@ extern "C" { #include "pycore_pystate.h" -#if defined(HAVE_PR_SET_VMA_ANON_NAME) && defined(__linux__) -# include -# include +#if defined(__linux__) + +#include + +#ifndef PR_SET_VMA +# define PR_SET_VMA 0x53564d41 +#endif +#ifndef PR_SET_VMA_ANON_NAME +# define PR_SET_VMA_ANON_NAME 0 #endif -#if defined(HAVE_PR_SET_VMA_ANON_NAME) && defined(__linux__) static inline int _PyAnnotateMemoryMap(void *addr, size_t size, const char *name) { @@ -33,12 +38,15 @@ _PyAnnotateMemoryMap(void *addr, size_t size, const char *name) } return 0; } + #else + static inline int _PyAnnotateMemoryMap(void *Py_UNUSED(addr), size_t Py_UNUSED(size), const char *Py_UNUSED(name)) { return 0; } + #endif #ifdef __cplusplus diff --git a/configure b/configure index 562bb6860c79a9..5236e420864350 100755 --- a/configure +++ b/configure @@ -24260,30 +24260,6 @@ printf "%s\n" "#define HAVE_UT_NAMESIZE 1" >>confdefs.h fi -# musl libc redefines struct prctl_mm_map and conflicts with linux/prctl.h -if test "$ac_cv_libc" != musl -then : - -ac_fn_check_decl "$LINENO" "PR_SET_VMA_ANON_NAME" "ac_cv_have_decl_PR_SET_VMA_ANON_NAME" "#include - #include -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_PR_SET_VMA_ANON_NAME" = xyes -then : - ac_have_decl=1 -else case e in #( - e) ac_have_decl=0 ;; -esac -fi -printf "%s\n" "#define HAVE_DECL_PR_SET_VMA_ANON_NAME $ac_have_decl" >>confdefs.h -if test $ac_have_decl = 1 -then : - -printf "%s\n" "#define HAVE_PR_SET_VMA_ANON_NAME 1" >>confdefs.h - -fi - - -fi # check for openpty, login_tty, and forkpty diff --git a/configure.ac b/configure.ac index 20e1afc2e9ee14..54e906bbb5aa8f 100644 --- a/configure.ac +++ b/configure.ac @@ -5728,15 +5728,6 @@ AC_CHECK_DECLS([UT_NAMESIZE], [Define if you have the 'HAVE_UT_NAMESIZE' constant.])], [], [@%:@include ]) -# musl libc redefines struct prctl_mm_map and conflicts with linux/prctl.h -AS_IF([test "$ac_cv_libc" != musl], [ -AC_CHECK_DECLS([PR_SET_VMA_ANON_NAME], - [AC_DEFINE([HAVE_PR_SET_VMA_ANON_NAME], [1], - [Define if you have the 'PR_SET_VMA_ANON_NAME' constant.])], - [], - [@%:@include - @%:@include ]) -]) # check for openpty, login_tty, and forkpty AC_CHECK_FUNCS([openpty], [], diff --git a/pyconfig.h.in b/pyconfig.h.in index 9da33c954a52f8..752376263acc48 100644 --- a/pyconfig.h.in +++ b/pyconfig.h.in @@ -224,10 +224,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_DB_H -/* Define to 1 if you have the declaration of 'PR_SET_VMA_ANON_NAME', and to 0 - if you don't. */ -#undef HAVE_DECL_PR_SET_VMA_ANON_NAME - /* Define to 1 if you have the declaration of 'RTLD_DEEPBIND', and to 0 if you don't. */ #undef HAVE_DECL_RTLD_DEEPBIND @@ -1003,9 +999,6 @@ /* Define if your compiler supports function prototype */ #undef HAVE_PROTOTYPES -/* Define if you have the 'PR_SET_VMA_ANON_NAME' constant. */ -#undef HAVE_PR_SET_VMA_ANON_NAME - /* Define to 1 if you have the 'pthread_condattr_setclock' function. */ #undef HAVE_PTHREAD_CONDATTR_SETCLOCK