Commit Graph

29798 Commits

Author SHA1 Message Date
Paul Eggert
ed9d8b8730 maint: update GCC bug number in comment 2023-06-21 00:08:21 -07:00
Paul Eggert
3638944ff5 doc: mention fix for bug#64123 2023-06-19 23:24:02 -07:00
Paul Eggert
5ac7f2d281 build: update gnulib submodule to latest 2023-06-19 23:24:02 -07:00
Sylvestre Ledru
15925d0e5b tests: move tests to a directory per utility
* cfg.mk: Adjust syntax check exclusion paths.
* tests/local.mk: Adjust for renamed tests.
2023-06-19 13:12:37 +01:00
Pádraig Brady
d53190ed46 doc: mention cksum error fix with cpu feature checks changes
* NEWS: Mention the error message to aid those searching
for solutions to the issue, and mention cksum also
as that was confirmed to fix the error with the adjusted
cpu feature detection, as discussed at https://bugs.debian.org/1037264
* src/cksum.c: Cleanup syntax-check failure from previous commit.
2023-06-15 01:00:05 +01:00
Paul Eggert
f780a85985 cksum,wc: clean up hw capability checking
* src/cksum.c (cksum_pclmul) [!CRCTAB && !USE_PCLMUL_CRC32]:
Remove macro.
(cksum_fp): No longer file-scope.
(pclmul_supported): Define only if USE_PCLMUL_CRC32.
This omits the debug output "using generic hardware support"
for simplicity and consistency with wc’s output.
(crc_sum_stream) [!USE_PCLMUL_32]: No need for static function pointer.
* src/wc.c (wc_lines_p) [USE_AVX2_WC_LINECOUNT]: No longer file-scope.
(wc) [USE_AVX2_WC_LINECOUNT]: Check for avx2 support at most once,
which was surely the code’s original intent.
(wc) [!USE_AVX2_WC_LINECOUNT]: No need for static function pointer.
2023-06-14 14:54:46 -07:00
Paul Eggert
4ac941565f cksum,wc: don’t include <cpuid.h>
* src/cksum.c [!CRCTAB && USE_PCLMUL_CRC32]:
* src/wc.c [USE_AVX2_WC_LINECOUNT]:
Don’t include <cpuid.h>; no longer needed.
2023-06-14 14:54:46 -07:00
Paul Eggert
7814596fa9 cksum: fix bug in check for cksum_pclmul
This fixes a typo in the previous patch.
Problem reported by Pádraig Brady <https://bugs.gnu.org/64058#11>.
* src/cksum.c (pclmul_supported): Also require AVX support
to use cksum_pclmul.
2023-06-14 14:54:46 -07:00
Paul Eggert
91a74d3614 wc: port to kernels that disable XSAVE YMM
Problem reported by Dave Hansen <https://bugs.gnu.org/64058>.
Apply similar change to cksum and pclmul, too.
* NEWS: Mention wc fix.
* configure.ac (cpuid_exists, get_cpuid_count_exists):
Remove.  All uses removed, since we no longer use __get_cpuid or
__get_cpuid_count.
(pclmul_intrinsic_exists, avx2_intrinsic_exists): Set to no if
__builtin_cpu_supports calls cannot be compiled.
(HAVE_PCLMUL_INTRINSIC, HAVE_AVX2_INTRINSIC): Remove; unused.
Simplify surrounding code because of this.
* src/cksum.c (pclmul_supported):
* src/wc.c (avx2_supported):
Use __builtin_cpu_supports instead of doing it by hand.
Simplify surrounding code because of this.
2023-06-13 21:14:29 -07:00
Ville Skyttä
3789024073 dircolors: update list of backup file extensions
* src/dircolors.hin: Sort backup section by extension.
Treat .dpkg-new and .dpkg-tmp as backup files.
Treat .crdownload (Chromium based browsers' partial download)
as a backup file.
2023-06-12 21:55:51 +01:00
Pádraig Brady
e8e81fc44b dd: fix parsing of numbers with more than two multipliers
* src/dd.c (parse_integer): Use recursion to support more than two
multipliers.  Also protect suffix[-1] access to ensure we don't
inspect before the passed string.
* tests/dd/bytes.sh: Add test cases.
* doc/coreutils.texi (dd invocation): Note the support for specifying
many multipliers in a number.
* NEWS: Mention the bug fix.
Fixes https://bugs.debian.org/1037275
2023-06-11 23:10:34 +01:00
Pádraig Brady
b841f111de build: update gnulib submodule to latest
* gnulib: Update to latest.
* po/POTFILES.in: Remove recent sc_po_check workaround.
* tests/misc/date-debug.sh: Adjust as per spelling fix.
2023-06-09 11:27:35 +01:00
Pádraig Brady
66ea09b0fe doc: od --strings: clarify operation
* doc/coreutils.texi (od invocation): Remove mention of ASCII,
as all printable characters in unibyte locales are output.
* src/od.c (usage): Clarify that only NUL terminated strings
are displayed, and that it's printable chars, not only graphic chars
that are output. I.e., spaces are output also if part of the string.
Reported at https://bugs.ddebian.org/1037217
2023-06-08 11:06:20 +01:00
Pádraig Brady
c2173c0a52 maint: ls.c: update stale comment for previous commit
* src/ls.c (gobble_file): Update comment to correspond with
the changes in the previous commit.
2023-06-07 21:51:47 +01:00
Pádraig Brady
bf574deec8 ls: display command line symlinks that return ELOOP
* src/ls.c (gobble_file): Ensure we lstat() a symlink
specified on the command line, if we receive ELOOP from stat().
* tests/ls/symlink-loop.sh: Add a new test.
* tests/local.mk: Reference the new test.
* NEWS: Mention the bug fix.
Fixes https://bugs.gnu.org/63931
2023-06-07 19:59:40 +01:00
Pádraig Brady
e1e21f6dff ls: use more standard symlink traversal
* src/ls.c (gobble_file): stat() symlinks directly,
rather than their targets.  This will be more consistent
with how symlinks are generally accessed.
(make_link_name): Remove no longer used function.
Addresses https://bugs.gnu.org/63931
2023-06-07 19:59:30 +01:00
Pádraig Brady
6c975de166 doc: reference COPYING from README
* README: Reference COPYING as per the GNU coding standards,
and soon to be enforced with a syntax-check from gnulib.
2023-06-07 16:05:15 +01:00
Pádraig Brady
6a61883757 maint: avoid syntax-check failure
* po/POTFILES.in: Add lib/propername.h due to new comments
that trigger sc_po_check.
2023-06-06 11:34:09 +01:00
Pádraig Brady
3621d51c9d doc: NEWS: mention the more defensive copy_file_range avoidance
* NEWS: Mention the improvement in reinstating runtime avoidance
of copy_file_range(), that came with the last gnulib update,
picking up gnulib commit fb034b35.
2023-06-06 11:16:39 +01:00
Paul Eggert
e8909df3ce build: update gnulib submodule to latest 2023-06-05 22:44:22 -07:00
Pádraig Brady
4d12f4df0c maint: use consistent make variable interpolation syntax
* cfg.mk: Prefer $() interpolation over ${}
lest the reader is confused as to whether shell interpolation,
i.e. $${} was intended.
2023-06-01 13:21:12 +01:00
Pádraig Brady
0147288d20 split: --additional-suffix: disallow trailing '/'
Note mktemp --suffix has the same inconsistency,
but mktemp -d does support creating dirs
so probably best to leave that as is.

* src/split.c (main): Check for trailing /.
* tests/split/additional-suffix.sh: Augment the test.
Reported in https://bugs.debian.org/1036827
2023-05-31 17:26:13 +01:00
Pádraig Brady
d055228e34 maint: adjust code to handle "error" syntax-check changes
* src/dd.c: Don't include no longer used error.h.
Use quoteaf() rather than quote() to quote appropriate for the shell
and to avoid the syntax-check failure,
* src/stty.c: Use quoteaf() rather than quotef()
to have more consistent quoting of the invalid arg.
2023-05-31 17:24:13 +01:00
Pádraig Brady
b7c8eb0046 maint: augment syntax checks to cater for more "error" functions
src/cfg.mk (sc_error_quotes, sc_error_shell_quotes,
sc_error_shell_always_quotes): Include "die" and "diagnose"
in the class of error functions to check arguments for.
2023-05-31 17:20:09 +01:00
Paul Eggert
48f5a39872 dd: fix ‘error’ name issue without macros
* src/dd.c (_GL_NO_INLINE_ERROR): Remove; no longer needed.
(diagnose): Rename from nl_error and omit first arg since it is
always zero.  All uses changed.
(error): Remove macro.
2023-05-30 14:25:03 -07:00
Pádraig Brady
fe18d3982a build: update gnulib submodule to latest
* gnulib: Update to latest.
* src/dd.c: Avoid error macro redefinition.
2023-05-28 15:03:00 +01:00
Pádraig Brady
17479ef60c build: modernize bootstrap prerequsite tools
Following on from commit v9.0-15-gaa31b919c
which updated README-prereq...

* bootstrap.conf: Add an explicit requirement on m4.
Add an explicit requirement on texi2pdf which is often
packaged separately to makeinfo and induces a failure
far down the distribution phase if not present.
Replace the rsync dependency with wget,
which gnulib changed to in 2018.
2023-05-19 22:20:07 +01:00
Pádraig Brady
d5d9b67eec build: update gnulib submodule to latest
* gnulib: Update to latest.
* configure.ac: Remove gnulib reference, as that specific issue
is now explicitly avoided in gnulib itself.
2023-05-19 18:40:53 +01:00
Pádraig Brady
76e1200eeb build: pacify GCC 13 with -flto
* src/cut.c (cut_file): Explicitly mark STREAM as nonnull to avoid
-Werror=null-dereference.
* src/nl.c (nl_file): Likewise.
2023-05-19 11:32:14 +01:00
Pádraig Brady
ba0527d4ca build: revert -Wmaybe-uninitialized warnings avoidance
This reverts commit 800c86d5, as that was deemed too invasive.
We do keep the change to tee.c to allow using -O3 without warnings.
For other optimization options like -O0, -Og, -O1, -Os,
one can use WERROR_CFLAGS= to stop warnings inducing a build failure.
2023-05-19 09:58:50 +01:00
Pádraig Brady
800c86d5fa build: avoid false -Wmaybe-uninitialized warnings
Allow easily building a debug build for example with:
  make CFLAGS='-O0 -ggdb'

False -Wmaybe-uninitialized warnings hit in different
places depending on the compiler passes used.
These changes were tested with gcc 10.2.1, 12.2.1, and 13.1.1 like:
  for o in g s z fast 0 1 2 3; do
    make clean && make -j$(nproc) CFLAGS="-O$o" || break
  done

* src/digest.c: Disable -Wmaybe-uninitialized that gives
false positive here at -O0.
* src/ln.c: Avoid -Wmaybe-uninitialized that gives
false positive here at -O1.
* src/pr.c: Likewise.
* src/sort.c: Likewise.
* src/tee.c: Avoid -Wmaybe-uninitialized that gives
false positive here at -O3 on gcc 13.1.1 at least.
* src/cp.c: Avoid -Wmaybe-uninitialized that gives
false positive here at -Os on gcc 13.1.1 at least.
* src/copy.c: Avoid -Wmaybe-uninitialized that gives
false positive here at -Og on gcc 13.1.1 at least.
* src/head.c: Likewise.
* src/paste.c: Likewise.
2023-05-18 12:13:47 +01:00
Pádraig Brady
aed3b8190a build: gnulib: avoid false -Wstringop-overflow warning
Tested on gcc 13.1.1 with: make CFLAGS='-O0 -ggdb'

* configure.ac: Disable -Wstringop-overflow for gnulib.
This warning is far too problematic in my experience:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88443
and triggers with gcc -O0 with versions 12,13 at least.
2023-05-18 11:57:26 +01:00
Pádraig Brady
f218412b9a maint: cleanups to NEWS
* NEWS: Use more consistent wording, ordering, and formatting
for recent entries.
2023-05-13 10:33:14 +01:00
Pádraig Brady
059e53e5b4 split: advise the kernel of sequential access pattern
As split is often dealing with large files,
ensure we indicate to the kernel our sequential access pattern.
This was seen to operate 5% faster when reading from SSD,
as tested with:

dd bs=1M count=2K if=/dev/urandom of=big.in

for split in split.orig split; do
  # Ensure big file is not cached
  dd of=big.in oflag=nocache conv=notrunc,fdatasync count=0 status=none
  # Test read efficiency
  CWD=$PWD; (cd /dev/shm && time $CWD/src/$split -n2 $CWD/big.in)
done

real    0m9.039s
user    0m0.055s
sys     0m3.510s

real    0m8.568s
user    0m0.056s
sys     0m3.752s

* src/split.c (main): Use fdadvise to help the kernel
choose a more appropriate readahead buffer.
* NEWS: Mention the improvement.
2023-05-08 21:34:58 +01:00
Pádraig Brady
ba128e628c doc: adjust build instructions for disabling year 2038 support
* README-install: Adjust the instructions as per recent gnulib updates.
2023-05-08 12:57:56 +01:00
Bernhard Voelker
3f942cd03f build: update gnulib submodule to latest
This fixes failures in "very-expensive" tests on FTS with many
directory entries:
  FAIL: tests/rm/ext3-perf
  FAIL: tests/rm/many-dir-entries-vs-OOM

The following shows the problem in the former of the above tests:
  $ mkdir d && seq 400000 | env -C d xargs touch )
  $ rm -rf d
  rm: traversal failed: d: Operation not supported

Gnulib commit 3f0950f65abb (2023-04-26) introduced this regression
which was fixed again with gnulib commit d4d8abb39eb0.

See discussion in
<https://lists.gnu.org/r/bug-gnulib/2023-05/msg00040.html>

* bootstrap.conf (gnulib_modules): Change "year2038-required" to
"year2038-recommended"; the module has been replaced.
* gnulib: Update to latest.
* tests/init.sh: Likewise.
2023-05-07 23:07:12 +02:00
Paul Eggert
42f33ae68c doc: time zone conversion example
* doc/coreutils.texi (Examples of date):
Give time zone conversion example.
2023-05-07 09:17:27 -07:00
Paul Eggert
7edec89fc3 doc: new subsection for date format specs
* doc/coreutils.texi (Date format specifiers): New subsection,
which groups the date format specifiers without otherwise
changing contents.
2023-05-07 09:17:26 -07:00
Pádraig Brady
fae65623a9 pr: fix parsing of empty arguments
Before:
  $ pr --expand-tabs=
  pr: '-e' extra characters or invalid number in the argument:
   ‘SHELL=/bin/bash’: Value too large for defined data type

After:
  $ pr --expand-tabs=
  pr: '-e': Invalid argument: ‘’

* src/pr.c (getoptarg): Ensure we don't parse beyond the
end of an empty argument, thus outputting arbitrary stack
info in subsequent error messages.

Addresses https://bugs.debian.org/1035596
2023-05-06 11:26:04 +01:00
Paul Eggert
300af78691 cp: -p --parents: minor cleanup of previous patch
This doesn’t change behavior; it just clarifies the code a bit.
* src/cp.c (re_protect): New arg DST_SRC_NAME, for clarity, and so
that we need to skip '/'s only once.  Caller changed.
Rename a couple of local variables to try to make things clearer.
2023-05-05 11:05:03 -07:00
Pádraig Brady
c6b1fe4347 cp: -p --parents: fix failure to preserve permissions for absolute paths
* src/cp.c (re_protect): Ensure copy_acl() is passed an absolute path.
* tests/cp/cp-parents.sh: Add a test case.
* NEWS: Mention the bug.
Fixes https://bugs.gnu.org/63245
2023-05-03 18:15:59 +01:00
Pádraig Brady
7223651ad1 tests: provide more info on DEBUG=yes
* README: State that DEBUG=yes is particularly useful with perl tests.
* tests/split/l-chunk.sh: Use the more standard $DEBUG variable
rather than an internal $DEBUGGING variable.
2023-05-02 22:39:03 +01:00
Pádraig Brady
6d683a1d02 doc: provide more info on the default 32-bit cksum digest
* doc/coreutils.texi (cksum invocation): Say that the default
digest format is 32-bit and based on the Ethernet standard CRC.
2023-04-30 22:10:25 +01:00
Pádraig Brady
2cae0419c9 maint: remove redundant exit status handling
* src/numfmt.c: Remove redundant / confusing
use of TIMEOUT_FAILURE.
2023-04-30 13:05:12 +01:00
Paul Eggert
35adc746a0 maint: simplify --enable-gcc-warnings='expensive'
* configure.ac (WERROR_CFLAGS): Omit mention of
-Wno-analyzer-double-free, -Wno-analyzer-null-dereference, and
-Wno-analyzer-use-after-free as manywarnings no longer uses them.
2023-04-26 18:20:20 -07:00
Paul Eggert
21e7573508 maint: suppress GCC 13 false alarms
* src/csplit.c, src/fmt.c, src/make-prime-list.c, src/nohup.c:
Add pragmas to pacify GCC 13 when coreutils is configured
with --enable-gcc-warnings='expensive'.
2023-04-26 18:20:20 -07:00
Paul Eggert
6c199713ed chmod: pacify GCC 13
* src/chmod.c (main): Use xpalloc instead of X2REALLOC,
and make the corresponding variables signed instead of unsigned.
When reallocating the buffer, this grows it by a factor of 1.5, not 2.
This also pacifies gcc -Wanalyzer-null-dereference.
2023-04-26 18:20:19 -07:00
Paul Eggert
d178b49754 csplit: pacify GCC 13
* src/csplit.c (load_buffer): Refactor for clarity.
This also xpacifies gcc -Wanalyzer-use-of-uninitialized-value.
When reallocating the buffer, grow it by a factor of 1.5, not 2.
2023-04-26 18:20:19 -07:00
Paul Eggert
941027eeb7 build: update gnulib submodule to latest 2023-04-26 18:20:19 -07:00
Pádraig Brady
5e1c5f2d71 tests: more cases for read input diagnostics
* tests/misc/read-errors.sh: Exercise more modes of
various utilities for better read error coverage.
* tests/split/fail.sh: Remove part refactored into the above test.
2023-04-26 16:20:50 +01:00