Skip to content

Commit f37e821

Browse files
gh-143632: Fix the musl check for PR_SET_VMA_ANON_NAME (GH-159886)
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. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent c874649 commit f37e821

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
@@ -6008,15 +6008,17 @@ AC_CHECK_DECLS([UT_NAMESIZE],
60086008
[Define if you have the 'HAVE_UT_NAMESIZE' constant.])],
60096009
[],
60106010
[@%:@include <utmp.h>])
6011-
# musl libc redefines struct prctl_mm_map and conflicts with linux/prctl.h
6012-
AS_IF([test "$ac_cv_libc" != musl], [
6013-
AC_CHECK_DECLS([PR_SET_VMA_ANON_NAME],
6014-
[AC_DEFINE([_Py_HAVE_PR_SET_VMA_ANON_NAME], [1],
6015-
[Define if you have the 'PR_SET_VMA_ANON_NAME' constant.])],
6016-
[],
6017-
[@%:@include <linux/prctl.h>
6018-
@%:@include <sys/prctl.h>])
6019-
])
6011+
# musl libc redefines struct prctl_mm_map and conflicts with linux/prctl.h.
6012+
# The conftest does not reliably catch this, so skip the check on musl.
6013+
AS_CASE([$host],
6014+
[*-musl*], [],
6015+
[AC_CHECK_DECLS([PR_SET_VMA_ANON_NAME],
6016+
[AC_DEFINE([_Py_HAVE_PR_SET_VMA_ANON_NAME], [1],
6017+
[Define if you have the 'PR_SET_VMA_ANON_NAME' constant.])],
6018+
[],
6019+
[@%:@include <linux/prctl.h>
6020+
@%:@include <sys/prctl.h>])]
6021+
)
60206022
# check for openpty, login_tty, and forkpty
60216023

60226024
AC_CHECK_FUNCS([openpty], [],

0 commit comments

Comments
 (0)