From c37ee0c57a59b4c863b88ad35fd35fda2004258f Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Thu, 23 Apr 2026 03:00:19 +0200 Subject: [PATCH] utils-std: upgrade to 0.2.0 Changelog at: https://distfiles.hacktivis.me/releases/utils-std/utils-std-0.2.0.txt Notably adds comm(1) command and `ln -r` For the syscalls not supported on Fiwix it would probably be better to remove them from pre-linux-kexec musl as otherwise it means broken compile+link ./configure tests as we can see here. --- steps/SHA256SUMS.pkgs | 2 +- steps/manifest | 2 +- steps/utils-std-0.1.2/sources | 1 - .../pass1.sh | 8 + .../posix_fadvise-fiwix-workaround.patch | 327 ++++++++++++++++++ steps/utils-std-0.2.0/sources | 1 + 6 files changed, 338 insertions(+), 3 deletions(-) delete mode 100644 steps/utils-std-0.1.2/sources rename steps/{utils-std-0.1.2 => utils-std-0.2.0}/pass1.sh (69%) create mode 100644 steps/utils-std-0.2.0/patches/posix_fadvise-fiwix-workaround.patch create mode 100644 steps/utils-std-0.2.0/sources diff --git a/steps/SHA256SUMS.pkgs b/steps/SHA256SUMS.pkgs index a52985ba..6b2bae62 100644 --- a/steps/SHA256SUMS.pkgs +++ b/steps/SHA256SUMS.pkgs @@ -148,7 +148,7 @@ ab49972345d0c05f79b9370530829792e8c5c3b7fe283fc90e1dff26c2d0f6db tcc-0.9.27_2.t 8576a7c99802bb462dd044ef7df7263192f1acfabde47462afd6145ffec1e4f1 tcc-0.9.27_3.tar.bz2 252cc7226bef56e9dc591433ab2176cf1dd54dd18de20535edb708d5c6c21dce texinfo-7.2_0.tar.bz2 b54b1aa40dc08eec51982fd581a64a900e2598ba29acc6ca9c2b1b2321603b49 util-linux-2.19.1_0.tar.bz2 -fec6ac470561bfa72f29daabea9280b36dfa4f5cf0f0e75733c6410fbc461a05 utils-std-0.1.2_0.tar.bz2 +3174cad919aaa754f440a8c612a74660ca18f8b60ba1ff9b4647fa2d131a884f utils-std-0.2.0_0.tar.bz2 be2cddd4061b6e3acb96f12b66e6c1d0d17b7fd992015ece28ec987df0bb4911 which-2.23_0.tar.bz2 d7357c5a73e4a0adb07220392316185716c42003fe7e63b63ba8493f12f3621b xz-5.6.4_0.tar.bz2 9b10db90e06129fd174d48edb60a6d1e2fa72944fccef420431f8e836adcf972 zlib-1.3.1_0.tar.bz2 diff --git a/steps/manifest b/steps/manifest index 5d4a572d..bb526c70 100644 --- a/steps/manifest +++ b/steps/manifest @@ -78,7 +78,7 @@ build: bison-3.4.1 build: bison-3.4.1 build: diffutils-2.7 build: coreutils-5.0 -build: utils-std-0.1.2 +build: utils-std-0.2.0 build: gawk-3.0.4 build: perl-5.000 build: perl-5.003 diff --git a/steps/utils-std-0.1.2/sources b/steps/utils-std-0.1.2/sources deleted file mode 100644 index 52d44491..00000000 --- a/steps/utils-std-0.1.2/sources +++ /dev/null @@ -1 +0,0 @@ -f https://distfiles.hacktivis.me/releases/utils-std/utils-std-0.1.2.tar.gz aecc9cd81b3505322d9bfcc413627e41f777536cd694029794540b739e74f353 diff --git a/steps/utils-std-0.1.2/pass1.sh b/steps/utils-std-0.2.0/pass1.sh similarity index 69% rename from steps/utils-std-0.1.2/pass1.sh rename to steps/utils-std-0.2.0/pass1.sh index 92871648..3238a70e 100644 --- a/steps/utils-std-0.1.2/pass1.sh +++ b/steps/utils-std-0.2.0/pass1.sh @@ -15,4 +15,12 @@ src_prepare() { src_configure() { chmod +x configure ./configure PREFIX="${PREFIX}" CC=tcc AR=tcc\ -ar + + # Fiwix (as of 1.7.0) doesn't have sendfile(2), copy_file_range(2), syncfs(2), posix_fadvise(2) + sed -i \ + -e /HAS_SENDFILE/d \ + -e /HAS_COPY_FILE_RANGE/d \ + -e /HAS_SYNCFS/d \ + -e /HAS_POSIX_FADVISE/d \ + config.h } diff --git a/steps/utils-std-0.2.0/patches/posix_fadvise-fiwix-workaround.patch b/steps/utils-std-0.2.0/patches/posix_fadvise-fiwix-workaround.patch new file mode 100644 index 00000000..f0aa95a3 --- /dev/null +++ b/steps/utils-std-0.2.0/patches/posix_fadvise-fiwix-workaround.patch @@ -0,0 +1,327 @@ +From 33c49ee8a3664dd1fe6ad671ecb9b1e6b1985321 Mon Sep 17 00:00:00 2001 +From: "Haelwenn (lanodan) Monnier" +Date: Thu, 23 Apr 2026 23:44:11 +0200 +Subject: [PATCH] Turn posix_fadvise conftest into proper HAS_* #ifdef macro + +Signed-off-by: Haelwenn (lanodan) Monnier +X-Contrib-Policy: CONTRIBUTING.md 2026-03-12 +--- + cmd/cat.c | 2 ++ + cmd/cksum.c | 7 ++++--- + cmd/cmp.c | 4 ++++ + cmd/head.c | 2 ++ + cmd/install.c | 2 ++ + cmd/mv.c | 2 ++ + cmd/sha1sum.c | 14 ++++++++------ + cmd/sha256sum.c | 14 ++++++++------ + cmd/sha512sum.c | 14 ++++++++------ + cmd/split.c | 4 ++++ + cmd/wc.c | 4 ++++ + configure | 2 +- + 12 files changed, 49 insertions(+), 22 deletions(-) + +diff --git utils-std-0.2.0/cmd/cat.c utils-std-0.2.0/cmd/cat.c +index 54f3fe2..964b910 100644 +--- utils-std-0.2.0/cmd/cat.c ++++ utils-std-0.2.0/cmd/cat.c +@@ -84,8 +84,10 @@ main(int argc, char *argv[]) + return 1; + } + ++#ifdef HAS_POSIX_FADVISE + posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL); + errno = 0; ++#endif + + if(auto_fd_copy(fd, STDOUT_FILENO, SSIZE_MAX) < 0) + { +diff --git utils-std-0.2.0/cmd/cksum.c utils-std-0.2.0/cmd/cksum.c +index bd7516f..fb19999 100644 +--- utils-std-0.2.0/cmd/cksum.c ++++ utils-std-0.2.0/cmd/cksum.c +@@ -148,13 +148,14 @@ main(int argc, char *argv[]) + return 1; + } + +- int ret = posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL); +- if(ret != 0) ++#ifdef HAS_POSIX_FADVISE ++ if((errno = posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL)) != 0) + fprintf(stderr, + "%s: warning: posix_fadvise failed on file '%s': %s\n", + argv0, + filename, +- strerror(ret)); ++ strerror(errno)); ++#endif + } + + int err = 0; +diff --git utils-std-0.2.0/cmd/cmp.c utils-std-0.2.0/cmd/cmp.c +index 2f39693..e2b1fd3 100644 +--- utils-std-0.2.0/cmd/cmp.c ++++ utils-std-0.2.0/cmd/cmp.c +@@ -254,7 +254,9 @@ main(int argc, char *argv[]) + return 2; + } + ++#ifdef HAS_POSIX_FADVISE + posix_fadvise(fd1, 0, 0, POSIX_FADV_SEQUENTIAL); ++#endif + } + + if(fd2 != STDIN_FILENO) +@@ -271,7 +273,9 @@ main(int argc, char *argv[]) + return 2; + } + ++#ifdef HAS_POSIX_FADVISE + posix_fadvise(fd2, 0, 0, POSIX_FADV_SEQUENTIAL); ++#endif + } + + int ret = do_cmp(file1, argv[0], file2, argv[1]); +diff --git utils-std-0.2.0/cmd/head.c utils-std-0.2.0/cmd/head.c +index c34675f..d75c267 100644 +--- utils-std-0.2.0/cmd/head.c ++++ utils-std-0.2.0/cmd/head.c +@@ -51,7 +51,9 @@ copy_bytes(const char *filename) + return 1; + } + ++#ifdef HAS_POSIX_FADVISE + posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL); ++#endif + } + + int err = 0; +diff --git utils-std-0.2.0/cmd/install.c utils-std-0.2.0/cmd/install.c +index 16922b2..36d6979 100644 +--- utils-std-0.2.0/cmd/install.c ++++ utils-std-0.2.0/cmd/install.c +@@ -137,9 +137,11 @@ do_install(char *src, char *dest, bool is_dir) + + if(opt_v) fprintf(stderr, "%s: Made file: %s\n", argv0, dest); + ++#ifdef HAS_POSIX_FADVISE + posix_fadvise(src_fd, 0, 0, POSIX_FADV_SEQUENTIAL); + posix_fadvise(dest_fd, 0, 0, POSIX_FADV_SEQUENTIAL); + errno = 0; ++#endif + + if(auto_file_copy(src_fd, dest_fd, src_stat.st_size, 0) < 0) + { +diff --git utils-std-0.2.0/cmd/mv.c utils-std-0.2.0/cmd/mv.c +index 545697a..51d2830 100644 +--- utils-std-0.2.0/cmd/mv.c ++++ utils-std-0.2.0/cmd/mv.c +@@ -116,9 +116,11 @@ copy_file_unlink(struct named_fd srcdir, + errno = 0; + } + ++#ifdef HAS_POSIX_FADVISE + posix_fadvise(in, 0, 0, POSIX_FADV_SEQUENTIAL); + posix_fadvise(out, 0, 0, POSIX_FADV_SEQUENTIAL); + errno = 0; ++#endif + + if(auto_file_copy(in, out, src_status.st_size, 0) < 0) return -1; + +diff --git utils-std-0.2.0/cmd/sha1sum.c utils-std-0.2.0/cmd/sha1sum.c +index 5b23e63..9eed061 100644 +--- utils-std-0.2.0/cmd/sha1sum.c ++++ utils-std-0.2.0/cmd/sha1sum.c +@@ -135,13 +135,14 @@ check(FILE *file, const char *filename) + return -1; + } + +- int ret = posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL); +- if(ret != 0) ++#ifdef HAS_POSIX_FADVISE ++ if((errno = posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL)) != 0) + fprintf(stderr, + "%s: warning: posix_fadvise failed on file '%s': %s\n", + argv0, + target, +- strerror(ret)); ++ strerror(errno)); ++#endif + + char got[SHA1SUM_LEN] = ""; + if(sha1sum(fd, target, got) < 0) err = 1; +@@ -285,13 +286,14 @@ main(int argc, char *argv[]) + return 1; + } + +- int ret = posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL); +- if(ret != 0) ++#ifdef HAS_POSIX_FADVISE ++ if((errno = posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL)) != 0) + fprintf(stderr, + "%s: warning: posix_fadvise failed on file '%s': %s\n", + argv0, + filename, +- strerror(ret)); ++ strerror(errno)); ++#endif + } + + int err = 0; +diff --git utils-std-0.2.0/cmd/sha256sum.c utils-std-0.2.0/cmd/sha256sum.c +index c34612c..9fd45cf 100644 +--- utils-std-0.2.0/cmd/sha256sum.c ++++ utils-std-0.2.0/cmd/sha256sum.c +@@ -135,13 +135,14 @@ check(FILE *file, const char *filename) + return -1; + } + +- int ret = posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL); +- if(ret != 0) ++#ifdef HAS_POSIX_FADVISE ++ if((errno = posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL)) != 0) + fprintf(stderr, + "%s: warning: posix_fadvise failed on file '%s': %s\n", + argv0, + target, +- strerror(ret)); ++ strerror(errno)); ++#endif + + char got[SHA256SUM_LEN] = ""; + if(sha256sum(fd, target, got) < 0) err = 1; +@@ -285,13 +286,14 @@ main(int argc, char *argv[]) + return 1; + } + +- int ret = posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL); +- if(ret != 0) ++#ifdef HAS_POSIX_FADVISE ++ if((errno = posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL)) != 0) + fprintf(stderr, + "%s: warning: posix_fadvise failed on file '%s': %s\n", + argv0, + filename, +- strerror(ret)); ++ strerror(errno)); ++#endif + } + + int err = 0; +diff --git utils-std-0.2.0/cmd/sha512sum.c utils-std-0.2.0/cmd/sha512sum.c +index ac1e706..559b102 100644 +--- utils-std-0.2.0/cmd/sha512sum.c ++++ utils-std-0.2.0/cmd/sha512sum.c +@@ -135,13 +135,14 @@ check(FILE *file, const char *filename) + return -1; + } + +- int ret = posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL); +- if(ret != 0) ++#ifdef HAS_POSIX_FADVISE ++ if((errno = posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL)) != 0) + fprintf(stderr, + "%s: warning: posix_fadvise failed on file '%s': %s\n", + argv0, + target, +- strerror(ret)); ++ strerror(errno)); ++#endif + + char got[SHA512SUM_LEN] = ""; + if(sha512sum(fd, target, got) < 0) err = 1; +@@ -285,13 +286,14 @@ main(int argc, char *argv[]) + return 1; + } + +- int ret = posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL); +- if(ret != 0) ++#ifdef HAS_POSIX_FADVISE ++ if((errno = posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL)) != 0) + fprintf(stderr, + "%s: warning: posix_fadvise failed on file '%s': %s\n", + argv0, + filename, +- strerror(ret)); ++ strerror(errno)); ++#endif + } + + int err = 0; +diff --git utils-std-0.2.0/cmd/split.c utils-std-0.2.0/cmd/split.c +index b29c536..2aae19b 100644 +--- utils-std-0.2.0/cmd/split.c ++++ utils-std-0.2.0/cmd/split.c +@@ -81,8 +81,10 @@ split_bytes(void) + return 1; + } + ++#ifdef HAS_POSIX_FADVISE + posix_fadvise(fd_in, 0, 0, POSIX_FADV_SEQUENTIAL); + errno = 0; ++#endif + + int err = 0; + off_t wrote = 0; +@@ -101,8 +103,10 @@ split_bytes(void) + break; + } + ++#ifdef HAS_POSIX_FADVISE + posix_fadvise(fd_out, 0, 0, POSIX_FADV_SEQUENTIAL); + errno = 0; ++#endif + + int ret = auto_file_copy(fd_in, fd_out, bytes, 0); + if(ret < 0) +diff --git utils-std-0.2.0/cmd/wc.c utils-std-0.2.0/cmd/wc.c +index 9a3c5ea..e00d517 100644 +--- utils-std-0.2.0/cmd/wc.c ++++ utils-std-0.2.0/cmd/wc.c +@@ -289,6 +289,7 @@ main(int argc, char *argv[]) + argc -= optind; + argv += optind; + ++#ifdef HAS_POSIX_FADVISE + if((errno = posix_fadvise(STDIN_FILENO, 0, 0, POSIX_FADV_SEQUENTIAL)) != 0) + { + if(errno != ESPIPE) +@@ -300,6 +301,7 @@ main(int argc, char *argv[]) + } + errno = 0; + } ++#endif + + if(argc < 1) + { +@@ -331,6 +333,7 @@ main(int argc, char *argv[]) + return 1; + } + ++#ifdef HAS_POSIX_FADVISE + if((errno = posix_fadvise(arg_fd, 0, 0, POSIX_FADV_SEQUENTIAL)) != 0) + { + fprintf(stderr, +@@ -340,6 +343,7 @@ main(int argc, char *argv[]) + strerror(errno)); + errno = 0; + } ++#endif + + if(wc_file(arg_fd, path) < 0) return 1; + +diff --git utils-std-0.2.0/configure utils-std-0.2.0/configure +index 2600211..2324472 100755 +--- utils-std-0.2.0/configure ++++ utils-std-0.2.0/configure +@@ -278,7 +278,7 @@ add_commands() { + check_conftest configure.d/o_path.c && add_commands ln + + # OpenBSD lacks posix_fadvise +-check_conftest configure.d/posix_fadvise.c || cpp_define 'posix_fadvise(fd, off, len, adv) 0' ++check_conftest configure.d/posix_fadvise.c && cpp_define HAS_POSIX_FADVISE + + rm -f configure.d/*.bin + +-- +2.52.0 + diff --git a/steps/utils-std-0.2.0/sources b/steps/utils-std-0.2.0/sources new file mode 100644 index 00000000..d0b83981 --- /dev/null +++ b/steps/utils-std-0.2.0/sources @@ -0,0 +1 @@ +f https://distfiles.hacktivis.me/releases/utils-std/utils-std-0.2.0.tar.gz 432bb4dca9801202686e08d9361d1704abbe0c3a5294d351356ef9075daa7b39