[Python-checkins] [3.9] bpo-46968: Check for 'sys/auxv.h' in the configure script (GH-31961). (GH-31975)

pablogsal webhook-mailer at python.org
Fri Mar 18 09:33:12 EDT 2022


https://github.com/python/cpython/commit/a12ef81231d65da5efbef4fa1434716270a19af6
commit: a12ef81231d65da5efbef4fa1434716270a19af6
branch: 3.9
author: Pablo Galindo Salgado <Pablogsal at gmail.com>
committer: pablogsal <Pablogsal at gmail.com>
date: 2022-03-18T13:33:03Z
summary:

[3.9] bpo-46968: Check for 'sys/auxv.h' in the configure script (GH-31961). (GH-31975)

(cherry picked from commit 8e3fde728f547f1d32bde8adf62b4c50bb877b9d)

Co-authored-by: Pablo Galindo Salgado <Pablogsal at gmail.com>

files:
A Misc/NEWS.d/next/Core and Builtins/2022-03-17-14-22-23.bpo-46968.4gz4NA.rst
M Modules/faulthandler.c
M configure
M configure.ac
M pyconfig.h.in

diff --git a/Misc/NEWS.d/next/Core and Builtins/2022-03-17-14-22-23.bpo-46968.4gz4NA.rst b/Misc/NEWS.d/next/Core and Builtins/2022-03-17-14-22-23.bpo-46968.4gz4NA.rst
new file mode 100644
index 0000000000000..bef1d0532b098
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2022-03-17-14-22-23.bpo-46968.4gz4NA.rst	
@@ -0,0 +1,3 @@
+Check for the existence of the "sys/auxv.h" header in :mod:`faulthandler` to
+avoid compilation problems in systems where this header doesn't exist. Patch
+by Pablo Galindo
diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c
index 764ff439d77d9..16f98ace3bb05 100644
--- a/Modules/faulthandler.c
+++ b/Modules/faulthandler.c
@@ -21,9 +21,9 @@
 #  define FAULTHANDLER_USE_ALT_STACK
 #endif
 
-#if defined(FAULTHANDLER_USE_ALT_STACK) && defined(HAVE_LINUX_AUXVEC_H)
-#  include <linux/auxvec.h>
-#  include <sys/auxv.h>
+#if defined(FAULTHANDLER_USE_ALT_STACK) && defined(HAVE_LINUX_AUXVEC_H) && defined(HAVE_SYS_AUXV_H)
+#  include <linux/auxvec.h>       // AT_MINSIGSTKSZ
+#  include <sys/auxv.h>           // getauxval()
 #endif
 
 /* Allocate at maximum 100 MiB of the stack to raise the stack overflow */
diff --git a/configure b/configure
index 7f9749091dc01..b7be60eaa37dd 100755
--- a/configure
+++ b/configure
@@ -8042,7 +8042,7 @@ sys/stat.h sys/syscall.h sys/sys_domain.h sys/termio.h sys/time.h \
 sys/times.h sys/types.h sys/uio.h sys/un.h sys/utsname.h sys/wait.h pty.h \
 libutil.h sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
 linux/tipc.h linux/random.h spawn.h util.h alloca.h endian.h \
-sys/endian.h sys/sysmacros.h linux/auxvec.h linux/memfd.h linux/wait.h sys/memfd.h sys/mman.h
+sys/endian.h sys/sysmacros.h linux/auxvec.h sys/auxv.h linux/memfd.h linux/wait.h sys/memfd.h sys/mman.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
diff --git a/configure.ac b/configure.ac
index 1354cc0a8dd68..aa515da46553a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2228,7 +2228,7 @@ sys/stat.h sys/syscall.h sys/sys_domain.h sys/termio.h sys/time.h \
 sys/times.h sys/types.h sys/uio.h sys/un.h sys/utsname.h sys/wait.h pty.h \
 libutil.h sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
 linux/tipc.h linux/random.h spawn.h util.h alloca.h endian.h \
-sys/endian.h sys/sysmacros.h linux/auxvec.h linux/memfd.h linux/wait.h sys/memfd.h sys/mman.h)
+sys/endian.h sys/sysmacros.h linux/auxvec.h sys/auxv.h linux/memfd.h linux/wait.h sys/memfd.h sys/mman.h)
 AC_HEADER_DIRENT
 AC_HEADER_MAJOR
 
diff --git a/pyconfig.h.in b/pyconfig.h.in
index ce850fcad8280..bf695e9e58200 100644
--- a/pyconfig.h.in
+++ b/pyconfig.h.in
@@ -1113,6 +1113,9 @@
 /* Define to 1 if you have the <sys/audioio.h> header file. */
 #undef HAVE_SYS_AUDIOIO_H
 
+/* Define to 1 if you have the <sys/auxv.h> header file. */
+#undef HAVE_SYS_AUXV_H
+
 /* Define to 1 if you have the <sys/bsdtty.h> header file. */
 #undef HAVE_SYS_BSDTTY_H
 



More information about the Python-checkins mailing list