From 8e3fde728f547f1d32bde8adf62b4c50bb877b9d Mon Sep 17 00:00:00 2001 From: Pablo Galindo Salgado Date: Fri, 18 Mar 2022 12:03:22 +0000 Subject: [PATCH] bpo-46968: Check for 'sys/auxv.h' in the configure script (GH-31961) --- .../2022-03-17-14-22-23.bpo-46968.4gz4NA.rst | 3 +++ Modules/faulthandler.c | 6 +++--- configure | 2 +- configure.ac | 2 +- pyconfig.h.in | 3 +++ 5 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2022-03-17-14-22-23.bpo-46968.4gz4NA.rst 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 00000000000..bef1d0532b0 --- /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 744698cd7ab..91f96665a4a 100644 --- a/Modules/faulthandler.c +++ b/Modules/faulthandler.c @@ -26,9 +26,9 @@ # define FAULTHANDLER_USE_ALT_STACK #endif -#if defined(FAULTHANDLER_USE_ALT_STACK) && defined(HAVE_LINUX_AUXVEC_H) -# include -# include +#if defined(FAULTHANDLER_USE_ALT_STACK) && defined(HAVE_LINUX_AUXVEC_H) && defined(HAVE_SYS_AUXV_H) +# include // AT_MINSIGSTKSZ +# include // getauxval() #endif /* Allocate at maximum 100 MiB of the stack to raise the stack overflow */ diff --git a/configure b/configure index 4d585eba626..5fa6efaab4f 100755 --- a/configure +++ b/configure @@ -8652,7 +8652,7 @@ $as_echo "#define STDC_HEADERS 1" >>confdefs.h # checks for header files for ac_header in \ alloca.h asm/types.h bluetooth.h conio.h crypt.h direct.h dlfcn.h endian.h errno.h fcntl.h grp.h \ - ieeefp.h io.h langinfo.h libintl.h libutil.h linux/auxvec.h linux/memfd.h linux/random.h linux/soundcard.h \ + ieeefp.h io.h langinfo.h libintl.h libutil.h linux/auxvec.h sys/auxv.h linux/memfd.h linux/random.h linux/soundcard.h \ linux/tipc.h linux/wait.h netinet/in.h netpacket/packet.h poll.h process.h pthread.h pty.h \ sched.h setjmp.h shadow.h signal.h spawn.h stropts.h sys/audioio.h sys/bsdtty.h sys/devpoll.h \ sys/endian.h sys/epoll.h sys/event.h sys/eventfd.h sys/file.h sys/ioctl.h sys/kern_control.h \ diff --git a/configure.ac b/configure.ac index 81262ae38e5..7a37ad279d0 100644 --- a/configure.ac +++ b/configure.ac @@ -2375,7 +2375,7 @@ AC_DEFINE(STDC_HEADERS, 1, [Define to 1 if you have the ANSI C header files.]) # checks for header files AC_CHECK_HEADERS([ \ alloca.h asm/types.h bluetooth.h conio.h crypt.h direct.h dlfcn.h endian.h errno.h fcntl.h grp.h \ - ieeefp.h io.h langinfo.h libintl.h libutil.h linux/auxvec.h linux/memfd.h linux/random.h linux/soundcard.h \ + ieeefp.h io.h langinfo.h libintl.h libutil.h linux/auxvec.h sys/auxv.h linux/memfd.h linux/random.h linux/soundcard.h \ linux/tipc.h linux/wait.h netinet/in.h netpacket/packet.h poll.h process.h pthread.h pty.h \ sched.h setjmp.h shadow.h signal.h spawn.h stropts.h sys/audioio.h sys/bsdtty.h sys/devpoll.h \ sys/endian.h sys/epoll.h sys/event.h sys/eventfd.h sys/file.h sys/ioctl.h sys/kern_control.h \ diff --git a/pyconfig.h.in b/pyconfig.h.in index 1b84ee108fb..40952883853 100644 --- a/pyconfig.h.in +++ b/pyconfig.h.in @@ -1188,6 +1188,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_AUDIOIO_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_AUXV_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_BSDTTY_H