Re: [PATCH 1/2] aligned_alloc: check for GNU behavior with size 0

2024-10-31 Thread Bruno Haible via Gnulib discussion list
Paul Eggert wrote: > + /* Use paligned_alloc to test; 'volatile' prevents the compiler > + from optimizing the malloc call away. */ There's no malloc call here. 2024-10-31 Bruno Haible aligned_alloc: Fix comment. * m4/aligned_alloc.m4 (gl_FUNC_AL

Re: [PATCH 2/2] posix_memalign: check for GNU behavior with size 0

2024-10-31 Thread Bruno Haible via Gnulib discussion list
Paul Eggert wrote: > + /* Use pposix_memalign to test; 'volatile' prevents the > compiler > + from optimizing the malloc call away. */ There's no malloc call here. > changequote(,)dnl > + # Guess no on AIX. > +aix*)gl_cv_func_ali

Re: [PATCH] crc: New optimised slice-by-8 implementation

2024-10-31 Thread Pádraig Brady
On 31/10/2024 16:46, Sam Russell wrote: I can extend coreutils cksum if you like, what are your thoughts on adding some parameters to the commandline? Even if it's just an extra flag for --rfc1952 or --gzip to change all the parameters just between these two variants? Well cksum already has t

Re: Use of Signed-off-by in gnulib

2024-10-31 Thread Bruno Haible via Gnulib discussion list
Hi Simon, > I cannot find any documentation on what Signed-off-by means for a commit > in gnulib, but we do use it more than rarely (see below). So far, it means nothing in Gnulib. explains that it is mainly used in the Linux kernel. Taking an arbit

Re: [PATCH] crc: New optimised slice-by-8 implementation

2024-10-31 Thread Sam Russell
> `cksum -a crc32` could be added I suppose to select the current implementation in gnulib both versions are CRC32 though, and then if you look at the iSCSI/SCTP version they use CRC32-C which uses a totally different polynomial, not just a reversed order one like gzip > I'd be especially reluct

Re: [PATCH] crc: New optimised slice-by-8 implementation

2024-10-31 Thread Bruno Haible via Gnulib discussion list
Simon Josefsson wrote: > > the MAINTAINERCLEANFILES variable isn't set when building gzip so there's > > an error when using += with it. > > I think you should add 'MAINTAINERCLEANFILES =' to gzip instead. Yes, this is a documented Gnulib requirement: https://www.gnu.org/software/gnulib/manual/ht

Re: [PATCH] crc: New optimised slice-by-8 implementation

2024-10-31 Thread Simon Josefsson via Gnulib discussion list
Bruno Haible via Gnulib discussion list writes: > Sam Russell wrote: >> Patch attached to mark functions in crc.c and crc-generate-tables.c as >> static, GZIP now builds > > The patch looks good to me. Simon? Pushed, thank you! /Simon signature.asc Description: PGP signature

Re: [PATCH] crc: New optimised slice-by-8 implementation

2024-10-31 Thread Simon Josefsson via Gnulib discussion list
Bruno Haible via Gnulib discussion list writes: > Simon Josefsson wrote: >> I merged this now, thank you! > > And here's the cross-compilation handling that I promised to add. Both this and the other one looks fine, thank you! > configure.ac: > AC_REQUIRE([gl_CRC_SLICE_BY_8]) > +CROSS_COMPILI

Re: [PATCH] crc: New optimised slice-by-8 implementation

2024-10-31 Thread Sam Russell
These are all solvable: Polynomial: technically the same but one could argue it's the reversed version (we reverse the polynomial so we can read LSB first). We now generate the tables at compile time so this could be a parameter to table generation Initial/final value: easy enough to configure at

Re: [PATCH] crc: New optimised slice-by-8 implementation

2024-10-31 Thread Sam Russell
I can extend coreutils cksum if you like, what are your thoughts on adding some parameters to the commandline? Even if it's just an extra flag for --rfc1952 or --gzip to change all the parameters just between these two variants? On Thu, Oct 31, 2024, 17:41 Sam Russell wrote: > These are all solv

Re: [PATCH] crc: New optimised slice-by-8 implementation

2024-10-31 Thread Pádraig Brady
On 31/10/2024 12:18, Simon Josefsson via Gnulib discussion list wrote: I merged this now, thank you! FYI, I looked at using this from coreutils cksum, but unfortunately that uses a different CRC-32 variant. For my reference... coreutils cksum parameters: Polynomial: 0

Use of Signed-off-by in gnulib

2024-10-31 Thread Simon Josefsson via Gnulib discussion list
All, I cannot find any documentation on what Signed-off-by means for a commit in gnulib, but we do use it more than rarely (see below). Is there some existing URL we can use to document what we want it to mean, or should we add something to the manual? What do we want it to mean? FWIW, I've usu

Re: [PATCH] crc: New optimised slice-by-8 implementation

2024-10-31 Thread Bruno Haible via Gnulib discussion list
Simon Josefsson wrote: > I merged this now, thank you! And here's the cross-compilation handling that I promised to add. 2024-10-31 Bruno Haible crc: Don't attempt to run a compiled C program when cross-compiling. * lib/crc-generate-table.c: Don't include config.h. *

Re: [PATCH] crc: New optimised slice-by-8 implementation

2024-10-31 Thread Bruno Haible via Gnulib discussion list
Sam Russell wrote: > Patch attached to mark functions in crc.c and crc-generate-tables.c as > static, GZIP now builds The patch looks good to me. Simon? > $ time ./gzip_old -d -k large_file.gz -c > /dev/null > > real0m0.491s > user0m0.491s > sys 0m0.000s > > $ time ./gzip_new -d -k

Re: [PATCH] crc: New optimised slice-by-8 implementation

2024-10-31 Thread Simon Josefsson via Gnulib discussion list
Sam Russell writes: > Thanks for merging Simon. > > I've fixed a couple of issues with building gzip, marking the functions as > static fixes the -Werror=missing-declarations error, and > the MAINTAINERCLEANFILES variable isn't set when building gzip so there's > an error when using += with it.

Re: [PATCH] crc: New optimised slice-by-8 implementation

2024-10-31 Thread Bruno Haible via Gnulib discussion list
Sam Russell wrote: > /usr/bin/ld: /tmp/cc06ZLWr.o: in function `main': > /home/sam/code/gzip/lib/./crc-generate-table.c:139: undefined reference to > `rpl_fopen' > /usr/bin/ld: /tmp/cc06ZLWr.o: in function `print_copyright_notice': > /home/sam/code/gzip/lib/./crc-generate-table.c:103: undefined ref

Re: [PATCH] crc: New optimised slice-by-8 implementation

2024-10-31 Thread Sam Russell
> I believe this should be fixed through the second patch of mine. Yes, thanks > I think you should add 'MAINTAINERCLEANFILES =' to gzip instead. Adding to lib/Makefile.am on line 24 fixes this Patch attached to mark functions in crc.c and crc-generate-tables.c as static, GZIP now builds $ ti

Re: [PATCH] crc: New optimised slice-by-8 implementation

2024-10-31 Thread Bruno Haible via Gnulib discussion list
Simon Josefsson wrote: > I added another patch (attached) Time for me to add another tweak: We prepend a "DO NOT EDIT" line to generated files. Some editors react to this line by asking the user whether they really want to edit the file. At the same time, this is less annoying than doing a "chmod

Re: [PATCH 1/3] realloc-posix: realloc (p, 0) yields nonnull

2024-10-31 Thread Bruno Haible via Gnulib discussion list
Paul Eggert wrote: > + void *result = realloc (p, 1); > + return result ? result : p; Unfortunately, this patch does not guarantee that errno is set to ENOMEM upon failure. This was the original raison d'être of the 'realloc-posix' module. The first patch of this series restores the err

Re: [PATCH 3/3] malloc, realloc: sync from Autoconf master

2024-10-31 Thread Bruno Haible via Gnulib discussion list
Paul Eggert wrote: > + * m4/malloc.m4 (_AC_FUNC_MALLOC_IF): > + * m4/realloc.m4 (_AC_FUNC_REALLOC_IF): > + Sync from bleeding-edge Autoconf. All uses changed. Since the context of evaluation of the third argument of _AC_FUNC_MALLOC_IF, _AC_FUNC_REALLOC_IF is unspecified (and could thu

Re: [PATCH] crc: New optimised slice-by-8 implementation

2024-10-31 Thread Pádraig Brady
On 31/10/2024 18:35, Sam Russell wrote: > `cksum -a crc32` could be added I suppose to select the current implementation in gnulib both versions are CRC32 though, and then if you look at the iSCSI/SCTP version they use CRC32-C which uses a totally different polynomial, not just a reversed or

Re: [PATCH 3/3] malloc, realloc: sync from Autoconf master

2024-10-31 Thread Bruno Haible via Gnulib discussion list
Paul Eggert wrote: > > This change fixes it (but obviously needs NOT be backpropagated into > > Autoconf). > > I'd rather keep them in sync, though. No harm in that, right? There is no harm, right. Bruno

Re: [PATCH] crc: New optimised slice-by-8 implementation

2024-10-31 Thread Bruno Haible via Gnulib discussion list
Simon Josefsson wrote: > While CROSS_COMPILING is a common variable used for this purpose, this > is bad namespace usage -- how about GL_CRC_CROSS_COMPILING, > GL_CROSS_COMPILING or GNULIB_CROSS_COMPILING instead? Indeed, a search on codesearch.debian.net reveals that a number of packages use this

Re: [PATCH 3/3] malloc, realloc: sync from Autoconf master

2024-10-31 Thread Paul Eggert
On 2024-10-31 14:11, Bruno Haible wrote: This change fixes it (but obviously needs NOT be backpropagated into Autoconf). I'd rather keep them in sync, though. No harm in that, right?

Re: [PATCH 3/3] malloc, realloc: sync from Autoconf master

2024-10-31 Thread Paul Eggert
On 2024-10-31 17:30, Bruno Haible wrote: There is no harm, right. OK, thanks, I patched Autoconf and propagated it into Gnulib as per attached.From c7f29c827df9284ec56233c515286c4d57361e4c Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 31 Oct 2024 19:22:22 -0700 Subject: [PATCH] malloc

Re: [PATCH] crc: New optimised slice-by-8 implementation

2024-10-31 Thread Bruno Haible via Gnulib discussion list
I wrote: > And here's the cross-compilation handling that I promised to add. > > > 2024-10-31 Bruno Haible > > crc: Don't attempt to run a compiled C program when cross-compiling. Here's an improvement: 2024-10-31 Bruno Haible crc: Support generating the tables also when

crc: gcc warnings

2024-10-31 Thread Bruno Haible via Gnulib discussion list
Hi Simon, Compiling a testdir of module 'crc' with "gcc -Wall", I see these warnings: gcc -ftrapv -DHAVE_CONFIG_H -I. -I../../gltests -I.. -DGNULIB_STRICT_CHECKING=1 -DIN_GNULIB_TESTS=1 -I. -I../../gltests -I.. -I../../gltests/.. -I../gllib -I../../gltests/../gllib -I/media/develdata/devel/in

Re: [PATCH] crc: New optimised slice-by-8 implementation

2024-10-31 Thread Simon Josefsson via Gnulib discussion list
I merged this now, thank you! I added another patch (attached) to make the decision to use the slice-by-8 implementation a maintainer option rather than something visible to end-users. That also fixes the ./configure stdout output, you forgot the corresponding AC_MSG_RESULT to the AC_MSG_CHECKING

Re: [PATCH] crc: New optimised slice-by-8 implementation

2024-10-31 Thread Sam Russell
Thanks for merging Simon. I've fixed a couple of issues with building gzip, marking the functions as static fixes the -Werror=missing-declarations error, and the MAINTAINERCLEANFILES variable isn't set when building gzip so there's an error when using += with it. There's another issue with the way

Re: [PATCH] crc: New optimised slice-by-8 implementation

2024-10-31 Thread Pádraig Brady
On 31/10/2024 21:15, Simon Josefsson wrote: Pádraig Brady writes: I'd be reluctant to complicate the gnulib implementations with variants unless needed. I'd be especially reluctant to add the existing cksum crc variant to gnulib, since I don't see anything but cksum itself using that. Is th

Re: [PATCH] crc: New optimised slice-by-8 implementation

2024-10-31 Thread Jeffrey Walton
On Thu, Oct 31, 2024 at 5:15 PM Simon Josefsson via Gnulib discussion list wrote: > > Pádraig Brady writes: > > > I'd be reluctant to complicate the gnulib implementations with variants > > unless needed. > > I'd be especially reluctant to add the existing cksum crc variant to gnulib, > > since

Re: [PATCH 3/3] malloc, realloc: sync from Autoconf master

2024-10-31 Thread Bruno Haible via Gnulib discussion list
Paul Eggert wrote: > Sync from bleeding-edge Autoconf. All uses changed. When using - current gnulib, - Autoconf 2.72, - a configure.ac file that invokes AC_FUNC_MALLOC, I see the following change in the generated configure file: | gnu* | *-musl* | midipix* | midnightbsd* \

Re: [PATCH] crc: New optimised slice-by-8 implementation

2024-10-31 Thread Simon Josefsson via Gnulib discussion list
Pádraig Brady writes: > I'd be reluctant to complicate the gnulib implementations with variants > unless needed. > I'd be especially reluctant to add the existing cksum crc variant to gnulib, > since I don't see anything but cksum itself using that. Is there some performance optimization in cor