>From e14729f3c9094731844421bb37c542b05a5b6953 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 3 Oct 2020 12:51:08 -0700 Subject: [PATCH 3/3] c-stack: streamline Solaris configuration * lib/c-stack.c: Omit mention of HAVE_SIGALTSTACK, since the code is used only if a test for sigaltstack worked in some other way. * m4/c-stack.m4 (gl_PREREQ_C_STACK): Do not require gl_LIBSIGSEGV; instead, execute gl_LIBSIGSEGV only if needed (because the XSI heuristic does not work). * modules/c-stack (Files): Add m4/libsigsegv.m4, since we no longer require the libsigsegv module. (Depends-on): Depend on havelib, not libsigsegv. --- ChangeLog | 11 +++++++++++ lib/c-stack.c | 8 +++----- m4/c-stack.m4 | 15 +++++++-------- modules/c-stack | 3 ++- 4 files changed, 23 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7f54b7860..7b528a73d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2020-10-03 Paul Eggert + c-stack: streamline Solaris configuration + * lib/c-stack.c: Omit mention of HAVE_SIGALTSTACK, since + the code is used only if a test for sigaltstack worked + in some other way. + * m4/c-stack.m4 (gl_PREREQ_C_STACK): Do not require gl_LIBSIGSEGV; + instead, execute gl_LIBSIGSEGV only if needed (because the XSI + heuristic does not work). + * modules/c-stack (Files): Add m4/libsigsegv.m4, since + we no longer require the libsigsegv module. + (Depends-on): Depend on havelib, not libsigsegv. + c-stack: stop using SIGSTKSZ It’s been proposed to stop making SIGSTKSZ an integer constant: https://sourceware.org/pipermail/libc-alpha/2020-September/118028.html diff --git a/lib/c-stack.c b/lib/c-stack.c index cf0fe8da0..187bcafff 100644 --- a/lib/c-stack.c +++ b/lib/c-stack.c @@ -107,8 +107,7 @@ static char const * volatile program_error_message; static char const * volatile stack_overflow_message; #if (USE_LIBSIGSEGV \ - || (HAVE_SIGALTSTACK && HAVE_DECL_SIGALTSTACK \ - && HAVE_STACK_OVERFLOW_HANDLING)) + || (HAVE_DECL_SIGALTSTACK && HAVE_STACK_OVERFLOW_HANDLING)) /* Output an error message, then exit with status EXIT_FAILURE if it appears to have been a stack overflow, or with a core dump @@ -236,7 +235,7 @@ c_stack_action (_GL_ASYNC_SAFE void (*action) (int)) return 0; } -#elif HAVE_SIGALTSTACK && HAVE_DECL_SIGALTSTACK && HAVE_STACK_OVERFLOW_HANDLING +#elif HAVE_DECL_SIGALTSTACK && HAVE_STACK_OVERFLOW_HANDLING # if SIGINFO_WORKS @@ -361,8 +360,7 @@ c_stack_action (_GL_ASYNC_SAFE void (*action) (int)) } #else /* ! (USE_LIBSIGSEGV - || (HAVE_SIGALTSTACK && HAVE_DECL_SIGALTSTACK - && HAVE_STACK_OVERFLOW_HANDLING)) */ + || (HAVE_DECL_SIGALTSTACK && HAVE_STACK_OVERFLOW_HANDLING)) */ int c_stack_action (_GL_ASYNC_SAFE void (*action) (int) _GL_UNUSED) diff --git a/m4/c-stack.m4 b/m4/c-stack.m4 index e98f80fff..1523a724d 100644 --- a/m4/c-stack.m4 +++ b/m4/c-stack.m4 @@ -7,7 +7,7 @@ # Written by Paul Eggert. -# serial 18 +# serial 19 AC_DEFUN([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC], [ @@ -351,21 +351,20 @@ int main () AC_DEFUN([gl_PREREQ_C_STACK], [AC_REQUIRE([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC]) - AC_REQUIRE([gl_LIBSIGSEGV]) AC_CHECK_FUNCS_ONCE([sigaltstack]) AC_CHECK_DECLS([sigaltstack], , , [[#include ]]) AC_CHECK_HEADERS_ONCE([ucontext.h]) - AC_CHECK_TYPES([stack_t], , , [#include ]) + AC_CHECK_TYPES([stack_t], , , [[#include ]]) dnl c-stack does not need -lsigsegv if the system has XSI heuristics. - if test "$gl_cv_lib_sigsegv" = yes \ - && test "$gl_cv_sys_xsi_stack_overflow_heuristic" != yes; then - AC_SUBST([LIBCSTACK], [$LIBSIGSEGV]) - AC_SUBST([LTLIBCSTACK], [$LTLIBSIGSEGV]) - fi + AS_IF([test "$gl_cv_sys_xsi_stack_overflow_heuristic" != yes], + [gl_LIBSIGSEGV + AS_IF([test "$gl_cv_lib_sigsegv" = yes], + [AC_SUBST([LIBCSTACK], [$LIBSIGSEGV]) + AC_SUBST([LTLIBCSTACK], [$LTLIBSIGSEGV])])]) ]) AC_DEFUN([gl_C_STACK], diff --git a/modules/c-stack b/modules/c-stack index 5ddf6e6f5..77cf6aab8 100644 --- a/modules/c-stack +++ b/modules/c-stack @@ -5,6 +5,7 @@ Files: lib/c-stack.h lib/c-stack.c m4/c-stack.m4 +m4/libsigsegv.m4 Depends-on: c99 @@ -12,10 +13,10 @@ errno exitfail getprogname gettext-h +havelib ignore-value intprops inttypes -libsigsegv mempcpy raise sigaction -- 2.25.1