C23 is adding the C++ keywords bool, true, and false;
prefer them to <stdbool.h> if they are available.
* admin/merge-gnulib (GNULIB_MODULES):
Add stdbool, which emulates C23 on pre-C23 platforms.
(AVOIDED_MODULES): Remove stdbool; Gnulib has renamed
this module to stdbool-c99 and nobody uses it so it does
not need to be avoided.
* m4/c-bool.m4: New file, from Gnulib stdbool module.
* lib-src/seccomp-filter.c, src/conf_post.h, src/dynlib.h:
* src/emacs-module.c, src/nsterm.m, src/systhread.h:
* test/src/emacs-module-resources/mod-test.c:
Use the C23 style and use bool without including <stdbool.h>.
The Gnulib stdbool module causes config.h to include stdbool.h
on pre-C23 platforms.
* src/emacs-module.h.in:
Don’t include <stdbool.h> if C23 or later, or if
it has already been included.
* admin/merge-gnulib (GNULIB_MODULES): Add the nanosleep module.
* m4/gnulib-comp.m4 (gl_EARLY):
* lib/gnulib.mk.in: Automatic update.
* m4/nanosleep.m4:
* lib/nanosleep.c: New module.
* nt/mingw-cfg.site (gl_cv_func_free_preserves_errno):
* nt/gnulib-cfg.mk (OMIT_GNULIB_MODULE_nanosleep): Omit nanosleep,
since mingw has it.
* src/gnutls.c (gnutls_try_handshake): Add some sleeping to the
busy-wait loop so that we don't use 100% CPU here (bug#32452).
* m4/gnulib-common.m4 (gl_COMMON_BODY):
* lib/gnulib.mk.in (CXXCPP):
* lib/cdefs.h: Updated with admin/merge-gnulib. (This is in
preparation to adding the nanosleep module later.)
This addresses a FIXME comment in lisp/emacs-lisp/comp.el,
relating to the number of subsidiary processes used by
comp-run-async-workers in native compilation.
* admin/merge-gnulib (GNULIB_MODULES): Add nproc.
* doc/lispref/processes.texi (Process Information), etc/NEWS:
Document num-processors.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/nproc.c, lib/nproc.h, m4/nproc.m4:
New files, copied from Gnulib by admin/merge-gnulib.
* lisp/emacs-lisp/comp.el (w32-get-nproc): Remove decl.
(comp-effective-async-max-jobs): Use num-processors.
* src/process.c: Include nproc.h.
(Fnum_processors): New function.
(syms_of_process): Define ‘all’, ‘current’, ‘num-processors’.
* src/w32proc.c (Fw32_get_nproc): Add FIXME comment.
* test/src/process-tests.el (process-num-processors): New test.
When configured --with-native-compilation, Emacs needs md5_stream.
Problem reported by Andy Moreton (Bug#50985#23).
* admin/merge-gnulib (GNULIB_MODULES): Add crypto/md5,
needed for --with-native-compilation.
(AVOIDED_MODULES): Avoid crypto/af_alg, since Emacs doesn’t
need to bother with kernel-supported cryptography algorithms.
* lib/gnulib.mk.in, m4/gnulib-comp.m4:
Regenerate by running admin/merge-gnulib.
* lib/md5-stream.c: New file, copied from Gnulib.
Make the following changes by hand, and run 'admin/merge-gnulib'.
* .gitignore: Add lib/malloc/*.gl.h.
* admin/merge-gnulib: Copy lib/af_alg.h and lib/save-cwd.h
directly from Gnulib, without worrying about Gnulib modules,
as these files are special cases.
(AVOIDED_MODULES): Remove malloc-posix.
* lib/malloc.c, lib/realloc.c, m4/malloc.m4, m4/realloc.m4:
* m4/year2038.m4: New files, copied from Gnulib.
* lib/malloca.c, lib/malloca.h:
* m4/close-stream.m4, m4/glibc21.m4, m4/malloca.m4:
Remove. These are either no longer present in Gnulib, or are no
longer needed by modules that Emacs uses.
* oldXMenu/AddPane.c, oldXmenu/Addsel.c: Include XmenuInt.h first;
needed for new Gnulib.
* src/xmenu.c: Call emacs_abort, not abort.
* admin/merge-gnulib (GNULIB_MODULES): Add file-has-acl.
* lib/file-has-acl.c: New file, copied from Gnulib.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib-src/emacsclient.c: Include acl.h, for file_has_acl.
(O_PATH): Default to O_SEARCH, which is good enough here.
(union local_sockaddr): New type.
(socket_status): Remove, replacing with ...
(connect_socket): New function. All callers changed.
This function checks for ownership and permissions issues with the
parent directory of the socket file, instead of checking the
owner of the socket (which does not help security).
(socknamesize): Move to file scope.
(local_sockname): New arg S. No need to pass socknamesize.
UID arg is now uid_t. All callers changed. Get file descriptor
of parent directory of socket, to foil some symlink attacks.
Do not follow symlinks to that directory.
(set_local_socket): Create the socket here instead of on
each attempt to connect it. Fall back from XDG_RUNTIME_DIR
to /tmp only if the former fails due to ENOENT. Adjust
permission-failure diagnostic to match changed behavior.
This addresses Bug#33847, which complained about emacsclient in a
safer XDG environment not connecting to an Emacs server running in
a less-safe enviroment outside XDG. The patch fixes a
longstanding issue with emacsclient permission checking.
It’s ineffective to look at the permission of the socket file
itself; on some platforms, these permissions are ignored anyway.
What matters are the permissions on the parent directory of the
socket file, as these are what make symlink attacks possible.
Change the permissions check accordingly, and also refuse to
follow symlinks to that parent directory. These changes make it
OK for emacsclient to fall back from XDG_RUNTIME_DIR to the
traditionally less-safe /tmp/emacsNNNN directories, since /tmp is
universally sticky nowadays.
posix_spawn is less error-prone than vfork + exec, and can make use of
system-specific optimizations like `clone' on Linux. Import Gnulib
replacement so that we can use recent additions like
`posix_spawn_file_actions_addchdir'.
The only manual change are to admin/merge-gnulib and .gitignore. All
other changes are due to rerunning merge-gnulib.
* admin/merge-gnulib (GNULIB_MODULES): Add posix_spawn-related
modules.
* .gitignore: Add new generated files.
Inspired by a straightforward patch by Bruno Haible.
* admin/merge-gnulib (GNULIB_MODULES): Add sigdescr_np.
* configure.ac: Do not check for sys_siglist or __sys_siglist.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/sigdescr_np.c, m4/sigdescr_np.m4: New files, copied from Gnulib.
* src/sysdep.c (sys_siglist, sys_siglist_entries): Remove.
(init_signals): Do not initialize sys_siglist.
(safe_strsignal): Use sigdescr_np instead of sys_siglist.
This incorporates:
2020-08-23 intprops: be consistent about +X vs X+0
2020-08-23 intprops: fix INT_MULTIPLY_WRAPV bit-field bug
2020-08-23 verify: Make assume work on bit field expressions
2020-08-23 libc-config: Improve comments
2020-08-22 verify: Do use __builtin_assume on clang
2020-08-22 sig2str: Add more signals
2020-08-21 sigdescr_np: New module
* lib/cdefs.h, lib/intprops.h, lib/sig2str.c, lib/string.in.h:
* lib/verify.h, m4/string_h.m4: Copy from Gnulib.
* lib/gnulib.mk.in: Regenerate.
It wasn’t needed for MinGW after all, no other platform
seems to need it, and it slows down ‘configure’.
* admin/merge-gnulib (GNULIB_MODULES): Remove inttypes.
* m4/gnulib-comp.m4: Regenerate.
This incorporates:
2020-08-11 Use expression statements also on clang
2020-08-10 Use many __attribute__s with clang
2020-08-09 Use attribute __aligned__ with clang
2020-08-09 Use __alignof__ with clang
2020-08-09 ignore-value: Simplify on clang
2020-08-09 Use __typeof__ with clang
2020-08-09 intprops: Fix typo in comment
2020-08-09 Silence warnings from clang 10 with -Wimplicit-fallthrough
2020-08-09 count-one-bits: Use __builtin_popcount{,l,ll} on clang
2020-08-09 string: Fix build error in C++ mode with clang
2020-08-09 Add ability to emit user-defined diagnostics with clang
2020-08-07 alloca: No need to compile alloca.c with clang
2020-08-06 Use __builtin_assume with clang
* lib/alloca.in.h, lib/arg-nonnull.h, lib/c++defs.h, lib/cdefs.h:
* lib/count-one-bits.h, lib/dirent.in.h, lib/ignore-value.h:
* lib/intprops.h, lib/malloca.h, lib/regex_internal.h:
* lib/stdalign.in.h, lib/stddef.in.h, lib/stdio.in.h:
* lib/stdlib.in.h, lib/string.in.h, lib/verify.h, lib/warn-on-use.h:
* m4/gnulib-common.m4, m4/stddef_h.m4, m4/stdint.m4:
Copy from Gnulib.
This incorporates:
2020-08-06 libgmp: add <gmp/gmp.h> support
2020-08-06 Consider that clang defines __OPTIMIZE__ like GCC does
2020-08-06 Use __builtin_expect with clang everywhere
2020-08-05 Use __builtin_clz{,l,ll} with clang, also on Windows
2020-08-05 Use __builtin_ctz{,l,ll} and __builtin_ffs{,l,ll} with clang
2020-07-31 _GL_CMP: Improve documentation
2020-07-30 alloca, largefile: sync with Autoconf master
* lib/c++defs.h, lib/cdefs.h, lib/count-leading-zeros.h:
* lib/count-trailing-zeros.h, m4/alloca.m4, m4/gnulib-common.m4:
* m4/largefile.m4, m4/libgmp.m4:
Copy from Gnulib.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
This incorporates:
2020-07-30 work around some Oracle Studio attribute bugs
2020-07-29 fsusage, regex, stat-size: remove Cray support
2020-07-26 inttypes: remove support for AIX 4
2020-07-26 gettimeofday: remove workaround for Mac OS X 10.0
2020-07-26 don't require gl_LOCALTIME_BUFFER_DEFAULTS
2020-07-26 alloca: remove Cray-2 and Cray Y-MP support
2020-07-26 libgmp: remove dependency on havelib
2020-07-26 libgmp: remove HAVE_GMP, LIB_GMP
2020-07-25 multiarch: prepare for x86_64+arm64 universal in macOS 11
2020-07-25 sigprocmask: small autoconf macro improvement
2020-07-25 small autoconf macro improvements
2020-07-24 timespec: remove dependence on ‘verify’
2020-07-24 optimize a few more three-valued comparisons
2020-07-24 fix _GL_CMP parenthesization typo
2020-07-23 optimize three-valued comparison between integers
2020-07-24 doc: update for Mac OS X 10.13
2020-07-23 fchmodat, lchmod: use /proc on Cygwin
2020-07-21 inttypes: fix PRI*PTR and SCN*PTR on 64-bit native Windows
2020-07-12 libgmp: avoid warning when --without-libgmp is used
2020-07-12 libgmp: link to the correct shared library
* lib/mini-gmp-gnulib.c: Ignore -Wsuggest-attribute=malloc only for
* build-aux/config.guess, build-aux/config.sub:
* build-aux/install-sh, doc/misc/texinfo.tex, lib/c-strcasecmp.c:
* lib/c-strncasecmp.c, lib/fchmodat.c, lib/fsusage.c:
* lib/gettimeofday.c, lib/inttypes.in.h, lib/lchmod.c:
* lib/mini-gmp-gnulib.c, lib/nstrftime.c, lib/regex.h, lib/timespec.h:
* m4/alloca.m4, m4/getgroups.m4, m4/gettimeofday.m4:
* m4/gnulib-common.m4, m4/inttypes.m4, m4/libgmp.m4, m4/mktime.m4:
* m4/multiarch.m4:
Copy from Gnulib.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* src/Makefile.in, test/Makefile.in (LIBGMP):
Rename from LIB_GMP for compatibility with Gnulib.
All uses changed.
Instead of doing GMP by hand, use the Gnulib libgmp module.
* .gitignore: Add lib/gmp.h.
* admin/merge-gnulib (GNULIB_MODULES): Add libgmp.
* configure.ac (GMP_LIB, GMP_OBJ): Remove. Gnulib uses the name
LIB_GMP, so all uses changed. All uses of GMP_OBJ removed.
(HAVE_GMP): Set this from Gnulib’s variables.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/mini-gmp-gnulib.c, lib/mini-gmp.c, lib/mini-gmp.h, m4/libgmp.m4:
New files, copied from Gnulib.
* src/bignum.h, test/data/emacs-module/mod-test.c:
Include gmp.h unconditionally.
* src/mini-gmp-emacs.c, src/mini-gmp.c, src/mini-gmp.h:
Remove. This moves these files from src to lib, and
updates them to the current GMP version.
* test/Makefile.in (GMP_H): New macro.
($(test_module)): Use it to decide whether to compile
mini-gmp-gnulib.c too.