Skip to content

Commit eb9ec94

Browse files
miss-islingtonserhiy-storchakaclaude
authored
[3.15] gh-143632: Fix the musl check for PR_SET_VMA_ANON_NAME (GH-159886) (GH-159919)
The guard added by gh-143730 tested $ac_cv_libc, which is never set, so the check always ran and the build could fail on the struct prctl_mm_map redefinition it was meant to avoid. Match on the host triplet instead. (cherry picked from commit f37e821) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 429ed98 commit eb9ec94

3 files changed

Lines changed: 24 additions & 17 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Fix the check that disables ``PR_SET_VMA_ANON_NAME`` on musl libc: it tested
2+
an unset variable, so it never had any effect and the build could fail with
3+
a redefinition of ``struct prctl_mm_map``.

‎configure‎

Lines changed: 10 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎configure.ac‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5860,15 +5860,17 @@ AC_CHECK_DECLS([UT_NAMESIZE],
58605860
[Define if you have the 'HAVE_UT_NAMESIZE' constant.])],
58615861
[],
58625862
[@%:@include <utmp.h>])
5863-
# musl libc redefines struct prctl_mm_map and conflicts with linux/prctl.h
5864-
AS_IF([test "$ac_cv_libc" != musl], [
5865-
AC_CHECK_DECLS([PR_SET_VMA_ANON_NAME],
5866-
[AC_DEFINE([_Py_HAVE_PR_SET_VMA_ANON_NAME], [1],
5867-
[Define if you have the 'PR_SET_VMA_ANON_NAME' constant.])],
5868-
[],
5869-
[@%:@include <linux/prctl.h>
5870-
@%:@include <sys/prctl.h>])
5871-
])
5863+
# musl libc redefines struct prctl_mm_map and conflicts with linux/prctl.h.
5864+
# The conftest does not reliably catch this, so skip the check on musl.
5865+
AS_CASE([$host],
5866+
[*-musl*], [],
5867+
[AC_CHECK_DECLS([PR_SET_VMA_ANON_NAME],
5868+
[AC_DEFINE([_Py_HAVE_PR_SET_VMA_ANON_NAME], [1],
5869+
[Define if you have the 'PR_SET_VMA_ANON_NAME' constant.])],
5870+
[],
5871+
[@%:@include <linux/prctl.h>
5872+
@%:@include <sys/prctl.h>])]
5873+
)
58725874
# check for openpty, login_tty, and forkpty
58735875

58745876
AC_CHECK_FUNCS([openpty], [],

0 commit comments

Comments
 (0)