summaryrefslogtreecommitdiff
path: root/m4
Commit message (Collapse)AuthorAgeFilesLines
* string, wchar: Don't cause link errors for rpl_free (regr. 2021-09-07).Bruno Haible2021-09-182-2/+6
| | | | | | | | | | * lib/string.in.h (free, rpl_free): Consider GNULIB_FREE_POSIX variable. * lib/wchar.in.h (free, rpl_free): Likewise. * m4/string_h.m4 (gl_STRING_H_REQUIRE_DEFAULTS): Require module indicator variable initializations from the stdlib module. * m4/wchar_h.m4 (gl_WCHAR_H_REQUIRE_DEFAULTS): Likewise. * modules/string (Makefile.am): Substitute GNULIB_FREE_POSIX in string.h. * modules/wchar (Makefile.am): Substitute GNULIB_FREE_POSIX in wchar.h.
* threadlib: Avoid crashes in thread-related functions on Cygwin 3.2.0.Bruno Haible2021-09-171-26/+36
| | | | | | | | Reported by Brian Inglis via Akim Demaille in <https://lists.gnu.org/archive/html/bug-gnulib/2021-09/msg00063.html>. * m4/threadlib.m4 (gl_WEAK_SYMBOLS): Force a "guessing no" result on Cygwin.
* stdint-tests: long long preproc on recent Sun CPaul Eggert2021-09-121-1/+2
| | | | | * tests/test-stdint.c: Test long long preprocessor constants on Oracle Developer Studio 12.6, where they should work.
* extern-inline: Fix syntax error on macOS with GCC 11 (regr. 2021-08-22).Bruno Haible2021-09-131-2/+2
| | | | | | | | Reported by Akim Demaille in <https://lists.gnu.org/archive/html/bug-gnulib/2021-09/msg00052.html>. * m4/extern-inline.m4 (_GL_INLINE, _GL_EXTERN_INLINE): Put _GL_UNUSED before, not after, 'static'.
* strerror_r-posix: port even better to AndroidPaul Eggert2021-09-082-2/+7
| | | | | | | | | | | | | | | | * lib/strerror_r.c: Use STRERROR_R_CHAR_P to decide whether the system strerror_r returns char *, and HAVE_DECL_STRERROR_R to decide whether it either does that or returns an integer. In the former case, use the system strerror_r even on platforms like Android API level 23 that don’t have __xpg_strerror_r; also check for strerror_r failure just in case. * m4/error.m4 (gl_PREREQ_ERROR): * m4/strerror_r.m4 (gl_PREREQ_STRERROR_R): Use system extensions on Android, to avoid mishandling strerror_r on API level 23 and later. * modules/error, modules/strerror_r-posix (configure.ac): Surround gl_PREREQ_ERROR with AS_IF instead of plain if, so that AC_REQUIREs are propagated out.
* strerror_r-posix: port better to AndroidPaul Eggert2021-09-081-4/+6
| | | | | | | | | | | * m4/strerror_r.m4 (gl_FUNC_STRERROR_R): Move requirement of gl_USE_SYSTEM_EXTENSIONS from here ... (gl_FUNC_STRERROR_R_WORKS): ... to here, which is the macro that actually needs it. This avoids a bug where 'configure' tests whether strerror_r has the POSIX API before enabling GNU extensions. On Android, enabling GNU extensions switches from the POSIX to the GNU API. Problem reported by Lucy Phipps in: https://lists.gnu.org/r/bug-gnulib/2021-09/msg00026.html
* string, wchar: avoid some namespace pollutionPaul Eggert2021-09-071-1/+1
| | | | | | | | | | | * lib/string.in.h, lib/wchar.in.h: (free): Declare by hand instead of including stdlib.h. This avoids some namespace pollution. It should also avoid some nested-include problems described by Lucy Phipps in: https://lists.gnu.org/r/bug-gnulib/2021-09/msg00018.html * modules/string, modules/wchar: (Depends-on): Add stdlib, so that REPLACE_FREE has the right value. (Makefile.am): Replace @REPLACE_FREE@ when creating the include file.
* sigsegv: Improve cross-compilation support for LoongArch CPU.Sun Haiyong2021-09-041-1/+2
| | | | | * m4/stack-direction.m4 (SV_STACK_DIRECTION): Assume the stack grows down on LoongArch.
* gnulib-common.m4: Clarify logic behind _GL_UNUSED_LABEL.Bruno Haible2021-08-221-1/+3
| | | | | | | Reported by Paul Eggert. * m4/gnulib-common.m4 (gl_COMMON_BODY): Add comment and write the condition in a way that is close to the comment.
* gnulib-common.m4: Make _GL_UNUSED_LABEL effective for clang.Bruno Haible2021-08-221-1/+1
| | | | | * m4/gnulib-common.m4 (gl_COMMON_BODY): Make _GL_UNUSED_LABEL use _GL_ATTRIBUTE_UNUSED also for clang.
* gnulib-common.m4: Use C2x [[maybe_unused]] when possible.Bruno Haible2021-08-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * m4/gnulib-common.m4 (gl_COMMON_BODY): Define _GL_UNUSED as an alias of _GL_ATTRIBUTE_MAYBE_UNUSED, not of _GL_ATTRIBUTE_UNUSED. * lib/binary-io.h (__gl_setmode): Put _GL_UNUSED before, not after, the declaration. * lib/c-stack.c (null_action, segv_handler, overflow_handler, c_stack_action): Likewise. * lib/chown.c (chown): Likewise. * lib/clean-temp-simple.c (cleanup_action): Likewise. * lib/fts.c (dirent_inode_sort_may_be_useful, leaf_optimization, fts_set): Likewise. * lib/getgroups.c (getgroups): Likewise. * lib/getopt.c (_getopt_initialize): Likewise. * lib/getugroups.c (getugroups): Likewise. * lib/localename.c (gl_locale_name_thread_unsafe, gl_locale_name_thread, gl_locale_name_posix, gl_locale_name_environ): Likewise. * lib/mkdir.c (rpl_mkdir): Likewise. * lib/mkfifo.c (mkfifo): Likewise. * lib/mkfifoat.c (mkfifoat): Likewise. * lib/mknod.c (mknod): Likewise. * lib/mknodat.c (mknodat): Likewise. * lib/mountlist.c (me_remote): Likewise. * lib/openpty.c (openpty): Likewise. * lib/parse-datetime.y (yyerror): Likewise. * lib/passfd.c (sendfd, recvfd): Likewise. * lib/pthread-cond.c (pthread_condattr_destroy, pthread_cond_init, pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal, pthread_cond_broadcast, pthread_cond_destroy): Likewise. * lib/pthread-mutex.c (pthread_mutexattr_destroy, pthread_mutex_init, pthread_mutex_lock, pthread_mutex_trylock, pthread_mutex_timedlock, pthread_mutex_unlock, pthread_mutex_destroy): Likewise. * lib/pthread-rwlock.c (pthread_rwlockattr_destroy, pthread_rwlock_init, pthread_rwlock_timedrdlock, pthread_rwlock_timedwrlock): Likewise. * lib/pthread-spin.c (pthread_spin_init, pthread_spin_lock, pthread_spin_trylock, pthread_spin_unlock, pthread_spin_destroy): Likewise. * lib/pthread-thread.c (pthread_attr_destroy): Likewise. * lib/readlink.c (readlink): Likewise. * lib/rename.c (rpl_rename): Likewise. * lib/set-permissions.c (set_permissions): Likewise. * lib/sockets.c (gl_sockets_startup): Likewise. * lib/stat-time.h (get_stat_birthtime_ns, get_stat_birthtime, stat_time_normalize): Likewise. * lib/strptime.c (__strptime_internal): Likewise. * lib/strtod.c (LDEXP): Likewise. * lib/symlink.c (symlink): Likewise. * lib/symlinkat.c (symlinkat): Likewise. * lib/tempname.c (try_dir, try_nocreate): Likewise. * lib/textstyle.in.h (styled_ostream_begin_use_class, styled_ostream_end_use_class, styled_ostream_get_hyperlink_ref, styled_ostream_get_hyperlink_id, styled_ostream_set_hyperlink, styled_ostream_flush_to_current_style, fd_ostream_create, term_ostream_get_color, term_ostream_set_color, term_ostream_get_bgcolor, term_ostream_set_bgcolor, term_ostream_get_weight, term_ostream_set_weight, term_ostream_get_posture, term_ostream_set_posture, term_ostream_get_underline, term_ostream_set_underline, term_ostream_get_hyperlink_ref, term_ostream_get_hyperlink_id, term_ostream_set_hyperlink, term_ostream_create, term_styled_ostream_create, html_styled_ostream_create, handle_color_option, handle_style_option, style_file_prepare, styled_ostream_create, libtextstyle_set_failure_exit_code): Likewise. * lib/unicodeio.c (exit_failure_callback, fallback_failure_callback): Likewise. * lib/wait-process.c (cleanup_slaves_action): Likewise. * tests/signature.h (SIGNATURE_CHECK2): Likewise. * tests/test-areadlink.c (do_areadlink): Likewise. * tests/test-areadlinkat.c (do_areadlinkat): Likewise. * tests/test-ceilf-ieee.c (main): Likewise. * tests/test-ceilf1.c (main): Likewise. * tests/test-dirent.c (dir): Likewise. * tests/test-fchownat.c (main): Likewise. * tests/test-fdopendir.c (main): Likewise. * tests/test-filenamecat.c (main): Likewise. * tests/test-floor1.c (main): Likewise. * tests/test-floorf-ieee.c (main): Likewise. * tests/test-floorf1.c (main): Likewise. * tests/test-fseeko.c (main): Likewise. * tests/test-fstatat.c (main): Likewise. * tests/test-ftello.c (main): Likewise. * tests/test-getdomainname.c (main): Likewise. * tests/test-getgroups.c (main): Likewise. * tests/test-gethostname.c (main): Likewise. * tests/test-math-c++.cc (OVERLOADED_CHECK): Likewise. * tests/test-mkdirat.c (main): Likewise. * tests/test-openat.c (main): Likewise. * tests/test-parse-datetime.c (main): Likewise. * tests/test-quotearg-simple.c (main): Likewise. * tests/test-quotearg.c (main): Likewise. * tests/test-sethostname2.c (main): Likewise. * tests/test-unlinkat.c (main): Likewise. * tests/test-version-etc.c (main): Likewise. * tests/test-xalloc-die.c (main): Likewise. * tests/test-xfprintf-posix.c (main): Likewise. * tests/test-xprintf-posix.c (main): Likewise. * tests/test-xvasprintf.c (main): Likewise.
* gnulib-common.m4: Document the gnulib-internal _GL_ATTRIBUTE_* macros.Bruno Haible2021-08-221-8/+129
| | | | | * m4/gnulib-common.m4 (gl_COMMON_BODY): Add comments to the _GL_ATTRIBUTE_* macros, based on lib/attribute.h.
* c-stack: Test for libsigsegv once, not twice.Bruno Haible2021-08-222-7/+25
| | | | | | | | * m4/sigsegv.m4: New file, based on modules/sigsegv. * modules/sigsegv (Files): Add it. (configure.ac): Require gl_SIGSEGV. Test gl_sigsegv_uses_libsigsegv instead of with_libsigsegv and gl_cv_lib_sigsegv. * m4/c-stack.m4 (gl_C_STACK): Likewise.
* c-stack: fix libsigsegv dependencyPaul Eggert2021-08-171-1/+2
| | | | | | Problem reported for GNU grep by Evan Miller (Bug#50098). * m4/c-stack.m4 (gl_C_STACK): Call gl_LIBSIGSEGV before testing gl_cv_lib_sigsegv.
* gnulib-common.m4: Minor style fix.Bruno Haible2021-08-081-8/+8
| | | | | * m4/gnulib-common.m4 (gl_COMMON_BODY): Keep list of attributes sorted alphabetically.
* year2038: Fix recommendation regarding -m64 flag.Bruno Haible2021-08-071-3/+3
| | | | | * m4/year2038.m4 (gl_YEAR2038_BODY): Recommend to put option --m64 in CC, not in CPPFLAGS and LDFLAGS.
* manywarnings: enable some malloc warningsPaul Eggert2021-08-021-9/+3
| | | | | | | | * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Stop adding -Wno-analyzer-double-free, -Wno-analyzer-null-dereference, and -Wno-analyzer-use-after-free, as these false alarms don’t seem to be as much of an issue now that we’ve pacified a couple of individual modules and GCC has some bug fixes.
* year2038: work even if time_t is narrower than intPaul Eggert2021-08-021-1/+2
|
* year2038: port to unusual time_t platformsPaul Eggert2021-08-021-25/+36
| | | | | | | | | | | * m4/year2038.m4 (gl_YEAR2038_TEST_INCLUDES): Check that time_t can go to 2**32 - 1, not to 2**63 - 1, as the former is enough to be year 2038 safe. Unsigned 32-bit time_t (AmigaOS) and signed 40-bit time_t (Unisys ClearPath) have occurred in the wild, and even if Gnulib code is rarely or never ported to them there’s no need to exclude them merely because of year 2038 issues. (gl_YEAR2038_BODY): Adjust messages to match. Use 2**32 - 1, not 2**32, as the test timestamp, to allow unsigned 32-bit time_t.
* xalloc: no attribute (malloc (free)) on inlinePaul Eggert2021-08-011-1/+2
| | | | | | | | | | | | | | | | The GCC manual says you can’t use __attribute__ ((__malloc__ (free, 1))) on inline functions. Problem discovered when compiling diffutils 3.8 on RHEL 8.4 using a GCC 11.2.0 that I built myself. Perhaps the problem was not discovered earlier because the attribute works with ‘free’ (which is what I was seeing before on Fedora 34) but not with ‘rpl_free’ (seen on RHEL 8.4). Anyway, the GCC manual says it shouldn’t work at all, so don’t use it. * lib/xalloc.h (xnmalloc, xcharalloc): No longer inline. * lib/xmalloc.c (xcharalloc, xnmalloc): Move function bodies here. * m4/gnulib-common.m4 (_GL_ATTRIBUTE_DEALLOC) (_GL_ATTRIBUTE_DEALLOC_FREE): Document that these cannot be used on inline functions, as per the GCC 11.2.1 manual.
* manywarnings: improve -fanalyzer malloc checkingPaul Eggert2021-08-011-2/+2
|
* gnulib-common: update for gcc -Wmismatched-deallocPaul Eggert2021-07-311-0/+12
| | | | | | * m4/gnulib-common.m4 (gl_COMMON_BODY): Define the macros _GL_ATTRIBUTE_DEALLOC and _GL_ATTRIBUTE_DEALLOC_FREE. These can be useful with gcc -Wmismatched-dealloc.
* gnulib-common: update for C2x 2020-12-11 draftPaul Eggert2021-07-311-9/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Use blessed-by-draft-standard way to test for [[__deprecated__]] etc.; this is supported by GCC 11 and the fallback code should work fine with GCC 10 and earlier, clang, etc. * NEWS, doc/attribute.texi: Mention that DEPRECATED etc. must now come first. * lib/fflush.c, lib/unistr.in.h: Do not include unused-parameter.h. All uses of _GL_UNUSED_PARAMETER (after parameters) replaced by _GL_ATTRIBUTE_MAYBE_UNUSED (before parameters). Although perhaps we need a shorter name for _GL_ATTRIBUTE_MAYBE_UNUSED, that should probably be in gnulib-common.m4, due to the ubiquity of this issue. And perhaps the snippet/unused-parameter module should be marked obsolete since it's no longer compatible with its old use. * m4/gnulib-common.m4 (gl_COMMON_BODY): Define the macro _GL_HAS_C_ATTRIBUTE, and use it instead of __STDC_VERSION__ in deciding whether to use C2x attributes like [[__deprecated__]]. (_GL_ATTRIBUTE_MAYBE_UNUSED): Fall back on _GL_ATTRIBUTE_UNUSED. (_GL_ATTRIBUTE_UNUSED): New macro, for labels where C2x [[maybe_unused]] do not work. (_GL_UNUSED, _GL_UNUSED_LABEL): Use it. * modules/fflush, modules/unistr/base (Depends-on): Remove snippet/unused-parameter. * modules/fflush (selinux/selinux.h, selinux/context.h) (selinux/label.h): Do not use $(UNUSED_PARAMETER). Remove useless chmod a-x.
* limits-h: add BOOL_MAX, BOOL_WIDTHPaul Eggert2021-07-311-1/+2
| | | | | | | * doc/posix-headers/limits.texi (limits.h): Document them. * lib/limits.in.h: Also define CHAR_WIDTH etc. if C2x. (BOOL_MAX, BOOL_WIDTH): New macros, from C2x. * m4/limits-h.m4 (gl_LIMITS_H): Also check BOOL_WIDTH.
* Don't use '#pragma weak' for thread functions in Linux/glibc>=2.34.Bruno Haible2021-07-171-16/+48
| | | | | | | | | | | | | | | Suggested by Florian Weimer <fweimer@redhat.com> in <https://lists.gnu.org/archive/html/bug-gnulib/2021-04/msg00211.html>. * m4/threadlib.m4 (gl_PTHREADLIB_BODY): Set gl_pthread_in_glibc and set LIBPMULTITHREAD accordingly. (gl_STDTHREADLIB_BODY): Update comments. (gl_THREADLIB_BODY): Define USE_POSIX_THREADS_FROM_LIBC. * lib/glthread/thread.h (c11_threads_in_use): Define to 1 if all POSIX thread functions are in libc. * lib/glthread/lock.h (c11_threads_in_use): Likewise. * lib/glthread/cond.h (c11_threads_in_use): Likewise. * lib/glthread/tls.h (c11_threads_in_use): Likewise.
* Fix cross-compilation test results.Bruno Haible2021-07-173-5/+8
| | | | | | | * m4/memmem.m4 (gl_FUNC_MEMMEM_SIMPLE): When cross-compiling, include <string.h> before testing __GNU_LIBRARY__. * m4/strstr.m4 (gl_FUNC_STRSTR_SIMPLE): Likewise. * m4/strcasestr.m4 (gl_FUNC_STRCASESTR_SIMPLE): Likewise.
* regex: modernize to newer regex bugsetPaul Eggert2021-07-141-2/+38
| | | | | | | | | | | Problem reported by Hiroo Hayashi in: https://lists.gnu.org/r/bug-gnulib/2021-07/msg00024.html * m4/regex.m4 (gl_REGEX): Allow newer glibc behavior for ()0|\1, behavior where the regex compiles but does not match. Test for glibc bug 11053. * tests/test-regex.c (bug_regex11, main): Add casts needed for printf portability. (main): Allow newer glibc behavior for ()0|\1.
* regex: fix shell quoting problem in configurationPaul Eggert2021-07-141-3/+3
| | | | | | * m4/regex.m4 (gl_REGEX): Fix quoting problems. These C programs are put into unquoted here-documents, so $ and \ need to be quoted.
* year2038: Add --disable-year2038 optionPaul Eggert2021-07-062-10/+15
| | | | | | | | | | | Also, document this stuff better. Suggested by Bruno Haible in: https://lists.gnu.org/r/bug-gnulib/2021-07/msg00011.html * doc/year2038.texi: Document --disable-year2038. * m4/year2038.m4 (gl_YEAR2038_BODY): Support ‘./configure --disable-year2038’ to disable 64-bit time_t when that is not the default. Arg is now either empty or nonempty (not a shell command) and is evaluated at m4 expansion time instead of at runtime; all callers changed.
* year2038: support glibc 2.34 _TIME_BITS=64Paul Eggert2021-07-012-26/+65
| | | | | | | | | | | | | | | | | | | | | | | | | In glibc 2.34 on Linux kernels where time_t is traditionally 32-bit, defining _FILE_OFFSET_BITS=64 and _TIME_BITS=64 makes time_t 64-bit. Apps must define both macros. Gnulib applications that use either the largefile or the year2038 modules will want this behavior; largefile because it deals with the off_t and ino_t components of struct stat already, and so should also deal with time_t. * NEWS, doc/largefile.texi, doc/posix-headers/time.texi: Mention this. * m4/largefile.m4: Override two macros even in Autoconf 2.70 and later. (_AC_SYS_LARGEFILE_MACRO_VALUE): #undef $1 before #defining it, in case some other Gnulib macro has #defined it. (AC_SYS_LARGEFILE): Use AS_IF and AS_CASE to propagate AC_REQUIREs. Invoke gl_YEAR2038_BODY if we need to set _FILE_OFFSET_BITS=64. * m4/year2038.m4 (gl_YEAR2038_TEST_INCLUDES): New macro. (gl_YEAR2038_BODY): New macro, with gl_YEAR2038’s old body; this macro is designed to be used directly instead of being AC_REQUIREd. It takes an argument specifying whether 64-bit is required. Set _TIME_BITS=64 if this makes a difference in time_t width when setting _FILE_OFFSET_BITS=64. Do not warn about 32-bit time_t more than once. * modules/largefile (Files): Add year2038.m4. (Depends-on): Require gl_YEAR2038_EARLY.
* environ: Fix wrong autoconf test result in C++ mode.Bruno Haible2021-06-281-2/+3
| | | | | * m4/environ.m4 (gt_CHECK_VAR_DECL): Use a typedef'ed type, not an anonymous type.
* sigsegv, sigsegv-tests: Assign my contributions to the FSF.Eric Blake2021-06-211-1/+0
| | | | | | | | | | Following Bruno's lead, I'm also happy with this change. * m4/sigaltstack.m4: Change copyright notice: Write "Copyright (C) FSF" instead of "Copyright (C) Eric Blake". * tests/altstack-util.h: Likewise. * tests/test-sigsegv-catch-stackoverflow1.c: Likewise. * tests/test-sigsegv-catch-stackoverflow2.c: Likewise.
* sigsegv, sigsegv-tests: Assign my contributions to the FSF.Bruno Haible2021-06-192-4/+7
| | | | | | | | | | | | | | | | * lib/sigsegv.in.h: Change copyright notice: Write "Copyright (C) FSF" instead of "Copyright (C) Bruno Haible". * lib/sigsegv.c: Likewise. * lib/stackvma.h: Likewise. * lib/stackvma.c: Likewise. * m4/sigaltstack.m4: Likewise. * m4/stack-direction.m4: Likewise. * tests/altstack-util.h: Likewise. * tests/mmap-anon-util.h: Likewise. * tests/test-sigsegv-catch-segv1.c: Likewise. * tests/test-sigsegv-catch-segv2.c: Likewise. * tests/test-sigsegv-catch-stackoverflow1.c: Likewise. * tests/test-sigsegv-catch-stackoverflow2.c: Likewise.
* Align 2011-11-26 patch to 2021-04-11 patch (regression from 2021-04-11).Bruno Haible2021-06-131-1/+2
| | | | | | | | | | | | | Reported by Paul Eggert. * m4/unistd_h.m4 (gl_UNISTD_H_REQUIRE_DEFAULTS): Also initialize GNULIB_UNISTD_H_GETOPT variable. * modules/getopt-posix (configure.ac): Set GNULIB_UNISTD_H_GETOPT variable. * modules/unistd (Makefile.am): Rely on ${gl_include_guard_prefix} processing done by gnulib-tool since 2021-04-11. * gnulib-tool: Revert last change. * pygnulib/GLEmiter.py: Likewise.
* Clarify that compiler warnings in the Gnulib tests can be ignored.Bruno Haible2021-06-101-1/+67
| | | | | | | | | | | * gnulib-tool (func_emit_tests_Makefile_am): Emit overrides for CFLAGS and CXXFLAGS. Emit a dependency of 'all' on 'all-notice' that prints a notice. (func_emit_initmacro_start): Add a second argument. If it is true, emit code to require gl_CC_ALLOW_WARNINGS and gl_CXX_ALLOW_WARNINGS. (func_import, func_create_testdir): All callers updated. * m4/gnulib-common.m4 (gl_CC_ALLOW_WARNINGS, gl_CXX_ALLOW_WARNINGS): New macros.
* host-os: Add support for DragonFly BSD.Bruno Haible2021-06-071-1/+2
| | | | | * m4/host-os.m4 (gl_HOST_OS): On DragonFly BSD, set HOST_OPERATING_SYSTEM to "DragonFly BSD", not "Dragonfly".
* lib-symbol-visibility: Make configure check work for newer GCC.Bruno Haible2021-06-051-1/+5
| | | | | | | | Reported by Ozkan Sezer <sezeroz@gmail.com> in <https://lists.gnu.org/archive/html/bug-gnulib/2021-05/msg00117.html>. * m4/visibility.m4 (gl_VISIBILITY): Add a function definition for each declaration in the test program.
* sigsegv: don’t assume SIGSTKSZ is a constantPaul Eggert2021-05-211-33/+11
| | | | | | | | | | | | * m4/sigaltstack.m4 (SV_SIGALTSTACK): Don’t attempt to override SIGSTKSZ. Instead, use an array that is plenty large, while checking that it’s large enough. Also, be consistent about putting that array in static storage rather than on the stack. * tests/altstack-util.h (SIGSTKSZ): Don’t define. (MYSTACK_SIZE): New macro, used consistently instead of SIGSTKSZ. (mystack_storage, mystack): Now static. (prepare_alternate_stack) [defined SIGSTKSZ]: Check that MYSTACK_SIZE is large enough.
* c-stack: Support catching stack overflow on most platforms without libsigsegv.Bruno Haible2021-05-181-405/+8
| | | | | | | | | | * lib/c-stack.c: Remove all Solaris-specific code. Include <sigsegv.h> always. * m4/c-stack.m4: Remove all Solaris-specific code. (gl_C_STACK): Test $with_libsigsegv from module 'sigsegv'. * modules/c-stack (Files): Remove m4/libsigsegv.m4. (Depends-on): Add sigsegv. Remove havelib, intprops, inttypes, mempcpy, sigaction, stdbool.
* sigsegv, c-stack: Avoid compilation error with glibc >= 2.34.Bruno Haible2021-05-172-2/+54
| | | | | | | * lib/sigsegv.in.h (SIGSTKSZ): On glibc systems, redefine to a suitable constant. * m4/sigaltstack.m4 (SV_SIGALTSTACK): Likewise. * m4/c-stack.m4 (AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC): Likewise.
* sigsegv: New module.Bruno Haible2021-05-162-0/+302
| | | | | | | | | | * lib/sigsegv.in.h: New file, from GNU libsigsegv with modifications. * lib/sigsegv.c: Likewise. * lib/stackvma.h: Likewise. * lib/stackvma.c: Likewise. * m4/sigaltstack.m4: Likewise. * m4/stack-direction.m4: Likewise. * modules/sigsegv: New file.
* c-stack: work around Solaris 11 bugsPaul Eggert2021-05-141-2/+12
| | | | | | | | | | | | | | Problem reported by Bruno Haible in: https://lists.gnu.org/r/bug-gnulib/2021-05/msg00062.html * lib/c-stack.c: Always include sigsegv.h if HAVE_LIBSIGSEGV. (USE_LIBSIGSEGV): Do not use libsigsegv if the kernel has the si_addr bug and libsigsegv is too old to work around it. (segv_handler) [!USE_LIBSIGSEGV]: Do not trust si_addr if BOGUS_SI_ADDR_UPON_STACK_OVERFLOW. * m4/c-stack.m4 (AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC): Define BOGUS_SI_ADDR_UPON_STACK_OVERFLOW on Solaris 2.11 SPARC. And do not define HAVE_XSI_STACK_OVERFLOW_HEURISTIC.
* valgrind-tests: Doc fix and introduce AM_VALGRINDFLAGS.Simon Josefsson2021-05-141-7/+18
| | | | | | | * doc/valgrind-tests.texi (Using valgrind automatically): Clarify when the parallel vs serial test harness is used, suggested by Bruno Haible <bruno@clisp.org>. * m4/valgrind-tests.m4: Add VALGRIND_PROGRAM and AM_VALGRINDFLAGS.
* malloc-gnu, realloc-gnu, calloc-gnu: Ensure errno gets set to ENOMEM.Bruno Haible2021-05-141-5/+9
| | | | | * m4/malloc.m4 (gl_CHECK_MALLOC_POSIX): Set gl_cv_func_malloc_posix to 'no' also on Solaris.
* valgrind-tests: Fix 'sh: yes: unknown operand' error.Simon Josefsson2021-05-141-1/+1
| | | | * m4/valgrind-tests.m4: Protect variable usage.
* valgrind-tests: Fix LOG_VALGRIND when valgrind is missing.Simon Josefsson2021-05-141-4/+7
| | | | * m4/valgrind-tests.m4: Clear all variables when missing.
* valgrind-tests: Better option handling.Simon Josefsson2021-05-141-19/+48
| | | | | | * m4/valgrind-tests.m4: Support new variables VALGRINDFLAGS and DEFAULT_VALGRINDFLAGS. * doc/valgrind-tests.texi (Running self-tests under valgrind): Improve.
* posix_spawn, posix_spawnp: Fix build error on Minix 3.3.Bruno Haible2021-05-131-1/+13
| | | | | | | * m4/posix_spawn.m4 (gl_POSIX_SPAWN_BODY): If posix_spawn does not exist but is declared, set REPLACE_POSIX_SPAWN. * doc/posix-functions/posix_spawn.texi: Update platforms list. * doc/posix-functions/posix_spawnp.texi: Likewise.
* {realloc,calloc}-gnu: Fix autoconf macro (regression 2021-04-18).Bruno Haible2021-05-102-4/+8
| | | | | | | * m4/realloc.m4 (gl_FUNC_REALLOC_POSIX): Don't reset REPLACE_REALLOC to 0 if it is already 1 after gl_FUNC_REALLOC_GNU was executed. * m4/calloc.m4 (gl_FUNC_CALLOC_POSIX): Don't reset REPLACE_CALLOC to 0 if it is already 1 after gl_FUNC_CALLOC_GNU was executed.
* {malloc,realloc,calloc}-gnu: Fix autoconf macro (regression 2021-04-18).Bruno Haible2021-05-093-6/+12
| | | | | | | | | * m4/malloc.m4 (gl_FUNC_MALLOC_GNU): Don't assume that _AC_FUNC_MALLOC_IF expands to a single shell statement. * m4/realloc.m4 (gl_FUNC_REALLOC_GNU): Don't assume that _AC_FUNC_REALLOC_IF expands to a single shell statement. * m4/calloc.m4 (gl_FUNC_CALLOC_GNU): Don't assume that _AC_FUNC_CALLOC_IF expands to a single shell statement.