These changes make my DS414 fileserver build pass. Of course, there may be more breaking packages though.
The last patch merely fixes a warning, BTW.
Phil Sutter (5): package: linux-atm: Revert "fix musl compile" package: apcupsd: Fix for compiling with gcc-13 package: ndisc6: Fix for compiling with gcc-14 package: cfgfs: Fix for compiling with gcc-14 package: cfgfs: Fix for ignored attribute warnings
package/apcupsd/Makefile | 2 +- package/cfgfs/src/c_lzo1x1.c | 6 +++--- package/cfgfs/src/c_null.c | 6 +++--- package/cfgfs/src/c_zlib.c | 6 +++--- package/cfgfs/src/compress.h | 6 +++--- package/cfgfs/src/ft_pack.c | 1 + package/linux-atm/patches/patch-src_ilmid_io_c | 15 --------------- package/linux-atm/patches/patch-src_mpoad_io_c | 18 ------------------ .../linux-atm/patches/patch-src_sigd_atmsigd_c | 11 ----------- package/ndisc6/patches/patch-src_traceroute_h | 6 +++--- 10 files changed, 17 insertions(+), 60 deletions(-) delete mode 100644 package/linux-atm/patches/patch-src_ilmid_io_c delete mode 100644 package/linux-atm/patches/patch-src_mpoad_io_c delete mode 100644 package/linux-atm/patches/patch-src_sigd_atmsigd_c
This reverts commit c5dc60b664fcbba2642346c4b80fc407264337b7.
This change breaks when compiling using gcc-14. It is also not correct: on_exit() takes two arguments and passes the exit status to the callback as expected by trace_on_exit() here. In contrast, atexit() expects a callback which does not take any arguments and thus the logic for when to print a trace breaks when using it.
Signed-off-by: Phil Sutter phil@nwl.cc --- package/linux-atm/patches/patch-src_ilmid_io_c | 15 --------------- package/linux-atm/patches/patch-src_mpoad_io_c | 18 ------------------ .../linux-atm/patches/patch-src_sigd_atmsigd_c | 11 ----------- 3 files changed, 44 deletions(-) delete mode 100644 package/linux-atm/patches/patch-src_ilmid_io_c delete mode 100644 package/linux-atm/patches/patch-src_mpoad_io_c delete mode 100644 package/linux-atm/patches/patch-src_sigd_atmsigd_c
diff --git a/package/linux-atm/patches/patch-src_ilmid_io_c b/package/linux-atm/patches/patch-src_ilmid_io_c deleted file mode 100644 index 9b88b0b49dae4..0000000000000 --- a/package/linux-atm/patches/patch-src_ilmid_io_c +++ /dev/null @@ -1,15 +0,0 @@ ---- linux-atm-2.5.1.orig/src/ilmid/io.c 2007-07-11 18:07:57.000000000 +0200 -+++ linux-atm-2.5.1/src/ilmid/io.c 2013-08-15 21:40:35.168523713 +0200 -@@ -48,6 +48,12 @@ - be manually configured (after ilmid has - registered the "official" address) - HACK */ - -+#ifndef SUN_LEN -+# include <string.h> /* For prototype of `strlen'. */ -+ /* Evaluate to actual length of the `sockaddr_un' structure. */ -+# define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) + strlen ((ptr)->sun_path)) -+#endif -+ - extern SysGroup *remsys; - extern State ilmi_state; - static short atm_itf = -1; /* bad value */ diff --git a/package/linux-atm/patches/patch-src_mpoad_io_c b/package/linux-atm/patches/patch-src_mpoad_io_c deleted file mode 100644 index 14dd75d005a89..0000000000000 --- a/package/linux-atm/patches/patch-src_mpoad_io_c +++ /dev/null @@ -1,18 +0,0 @@ ---- linux-atm-2.5.1.orig/src/mpoad/io.c 2007-12-11 18:46:12.000000000 +0100 -+++ linux-atm-2.5.1/src/mpoad/io.c 2013-08-17 14:41:53.542968628 +0200 -@@ -10,14 +10,7 @@ - #include <errno.h> - #include <sys/ioctl.h> - #include <sys/param.h> /* for OPEN_MAX */ --#if __GLIBC__ >= 2 --#include <sys/poll.h> --#else /* ugly hack to make it compile on RH 4.2 - WA */ --#include <syscall.h> --#include <linux/poll.h> --#define SYS_poll 168 --_syscall3(int,poll,struct pollfd *,ufds,unsigned int,nfds,int,timeout); --#endif -+#include <poll.h> - #include <atm.h> - #include <linux/types.h> - #include <linux/atmioc.h> diff --git a/package/linux-atm/patches/patch-src_sigd_atmsigd_c b/package/linux-atm/patches/patch-src_sigd_atmsigd_c deleted file mode 100644 index 7eb31abf9c3ed..0000000000000 --- a/package/linux-atm/patches/patch-src_sigd_atmsigd_c +++ /dev/null @@ -1,11 +0,0 @@ ---- linux-atm-2.5.1.orig/src/sigd/atmsigd.c 2004-09-25 13:25:48.000000000 +0200 -+++ linux-atm-2.5.1/src/sigd/atmsigd.c 2013-08-15 21:22:05.226477574 +0200 -@@ -517,7 +517,7 @@ int main(int argc,char **argv) - exit(0); - } - } -- (void) on_exit(trace_on_exit,NULL); -+ (void) atexit(trace_on_exit); - poll_loop(); - close_all(); - for (sig = entities; sig; sig = sig->next) stop_saal(&sig->saal);
Kudos to Fabrice Fontaine for coming up with this:
https://lore.kernel.org/buildroot/20240113100654.85904-1-fontaine.fabrice@gm...
Signed-off-by: Phil Sutter phil@nwl.cc --- package/apcupsd/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/apcupsd/Makefile b/package/apcupsd/Makefile index c6d72cd94de6e..52b6def9af6ac 100644 --- a/package/apcupsd/Makefile +++ b/package/apcupsd/Makefile @@ -24,7 +24,7 @@ $(eval $(call PKG_template,APCUPSD,apcupsd,$(PKG_VERSION)-$(PKG_RELEASE),$(PKG_D
CONFIGURE_ARGS+= --prefix="${WRKINST}" --sbindir="/usr/sbin" --enable-usb CONFIGURE_ENV+= ac_cv_path_WALL=/usr/bin/wall -XAKE_FLAGS:= VERBOSE=1 STRIP="" +XAKE_FLAGS:= VERBOSE=1 STRIP="" LD="$(TARGET_CXX)"
# XXX: custom init script? apcupsd-install:
The callback declaration adjustment was flawed: While dropping 'restrict' keyword might be needed for some reason, dropping the asterisk changes parameter types. Also, 'const data' defaults to 'int' type when it should be 'void' instead.
Signed-off-by: Phil Sutter phil@nwl.cc --- package/ndisc6/patches/patch-src_traceroute_h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/package/ndisc6/patches/patch-src_traceroute_h b/package/ndisc6/patches/patch-src_traceroute_h index d47efc0c38b6e..1571df8849bf7 100644 --- a/package/ndisc6/patches/patch-src_traceroute_h +++ b/package/ndisc6/patches/patch-src_traceroute_h @@ -8,9 +8,9 @@ $Id: update-patches 24 2008-08-31 14:56:13Z wbx $ -typedef ssize_t (*trace_parser_t) (const void *restrict data, size_t len, - int *restrict ttl, - unsigned *restrict n, uint16_t port); -+typedef ssize_t (*trace_parser_t) (const data, size_t len, -+ int ttl, -+ unsigned n, uint16_t port); ++typedef ssize_t (*trace_parser_t) (const void *data, size_t len, ++ int *ttl, ++ unsigned *n, uint16_t port);
typedef struct tracetype {
The asprintf() function is not exported unless _GNU_SOURCE has been defined.
Signed-off-by: Phil Sutter phil@nwl.cc --- package/cfgfs/src/ft_pack.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/package/cfgfs/src/ft_pack.c b/package/cfgfs/src/ft_pack.c index 5d04f8b5c374b..53fd987134f0b 100644 --- a/package/cfgfs/src/ft_pack.c +++ b/package/cfgfs/src/ft_pack.c @@ -21,6 +21,7 @@ * the possibility of such damage or existence of a defect. */
+#define _GNU_SOURCE #include <sys/param.h> #include <sys/stat.h> #include <fcntl.h>
The 'bounded' attribute seems to never have existed. Replace it by the 'access' attribute which probably does the same. Declare decompressors' 'dst' parameter as read_write for now, no idea if any of them reads back the written output while decompressing.
Signed-off-by: Phil Sutter phil@nwl.cc --- package/cfgfs/src/c_lzo1x1.c | 6 +++--- package/cfgfs/src/c_null.c | 6 +++--- package/cfgfs/src/c_zlib.c | 6 +++--- package/cfgfs/src/compress.h | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/package/cfgfs/src/c_lzo1x1.c b/package/cfgfs/src/c_lzo1x1.c index 570f8673ca09d..94cf8322b85c5 100644 --- a/package/cfgfs/src/c_lzo1x1.c +++ b/package/cfgfs/src/c_lzo1x1.c @@ -51,10 +51,10 @@ __RCSID("$MirOS: contrib/hosted/fwcf/c_lzo1x1.c,v 1.5 2007/03/13 18:31:07 tg Exp static void c_lzo1x1_load(void) __attribute__((constructor)); static int c_init(void); static int c_compress(char **, char *, size_t) - __attribute__((bounded (string, 2, 3))); + __attribute__((access (read_only, 2, 3))); static int c_decompress(char *, size_t, char *, size_t) - __attribute__((bounded (string, 1, 2))) - __attribute__((bounded (string, 3, 4))); + __attribute__((access (read_write, 1, 2))) + __attribute__((access (read_only, 3, 4)));
static fwcf_compressor c_lzo1x1 = { c_init, /* init */ diff --git a/package/cfgfs/src/c_null.c b/package/cfgfs/src/c_null.c index 4806ae261fc8b..718550415dd68 100644 --- a/package/cfgfs/src/c_null.c +++ b/package/cfgfs/src/c_null.c @@ -34,10 +34,10 @@ __RCSID("$MirOS: contrib/hosted/fwcf/c_null.c,v 1.5 2006/09/23 23:46:35 tg Exp $ static void c_null_load(void) __attribute__((constructor)); static int c_init(void); static int c_compress(char **, char *, size_t) - __attribute__((bounded (string, 2, 3))); + __attribute__((access (read_only, 2, 3))); static int c_decompress(char *, size_t, char *, size_t) - __attribute__((bounded (string, 1, 2))) - __attribute__((bounded (string, 3, 4))); + __attribute__((access (read_write, 1, 2))) + __attribute__((access (read_only, 3, 4)));
static fwcf_compressor c_null = { c_init, /* init */ diff --git a/package/cfgfs/src/c_zlib.c b/package/cfgfs/src/c_zlib.c index 2285f2eebc989..65245d507ece2 100644 --- a/package/cfgfs/src/c_zlib.c +++ b/package/cfgfs/src/c_zlib.c @@ -34,10 +34,10 @@ __RCSID("$MirOS: contrib/hosted/fwcf/c_zlib.c,v 1.4 2006/09/23 23:46:35 tg Exp $ static void c_zlib_load(void) __attribute__((constructor)); static int c_init(void); static int c_compress(char **, char *, size_t) - __attribute__((bounded (string, 2, 3))); + __attribute__((access (read_only, 2, 3))); static int c_decompress(char *, size_t, char *, size_t) - __attribute__((bounded (string, 1, 2))) - __attribute__((bounded (string, 3, 4))); + __attribute__((access (read_write, 1, 2))) + __attribute__((access (read_only, 3, 4)));
static fwcf_compressor c_zlib = { c_init, /* init */ diff --git a/package/cfgfs/src/compress.h b/package/cfgfs/src/compress.h index 413075d831ac6..2237595c519f6 100644 --- a/package/cfgfs/src/compress.h +++ b/package/cfgfs/src/compress.h @@ -18,12 +18,12 @@ typedef int (*fwcf_compress_init_func)(void); /* in: *dst (malloc'd), src, size of source (max. INT_MAX) */ /* returns size of destination on success, -1 on failure */ typedef int (*fwcf_compress_work_func)(char **, char *, size_t) - __attribute__((bounded (string, 2, 3))); + __attribute__((access (read_only, 2, 3))); /* in: dst, max size of dst, src, size of source (max. INT_MAX) */ /* returns size of destination on success, -1 on failure */ typedef int (*fwcf_compress_rev_func)(char *, size_t, char *, size_t) - __attribute__((bounded (string, 1, 2))) - __attribute__((bounded (string, 3, 4))); + __attribute__((access (read_write, 1, 2))) + __attribute__((access (read_only, 3, 4)));
typedef struct FWCF_COMPRESSOR { fwcf_compress_init_func init;
Wrong ordering in calloc() is bad, mkay?
Signed-off-by: Phil Sutter phil@nwl.cc --- This slipped through, forgot to add the new patch files. --- package/json-c/patches/patch-arraylist_c | 17 +++++++++++++++++ package/json-c/patches/patch-json_object_c | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 package/json-c/patches/patch-arraylist_c create mode 100644 package/json-c/patches/patch-json_object_c
diff --git a/package/json-c/patches/patch-arraylist_c b/package/json-c/patches/patch-arraylist_c new file mode 100644 index 0000000000000..6143e8fd8fb95 --- /dev/null +++ b/package/json-c/patches/patch-arraylist_c @@ -0,0 +1,17 @@ + Fix for gcc-14 + + Upstream did not just fix this, but delay (the implicit) memset() in + commit 4a546e7b2f471 ("In arraylist, use malloc instead of calloc, + avoid clearing with memeset until we really need to, and micro-optimize + array_list_add().") which is not suitable for a backport. +--- json-c-0.13.orig/arraylist.c 2017-11-30 05:41:30.000000000 +0100 ++++ json-c-0.13/arraylist.c 2025-01-08 02:21:28.914179381 +0100 +@@ -46,7 +46,7 @@ array_list_new(array_list_free_fn *free_ + arr->size = ARRAY_LIST_DEFAULT_SIZE; + arr->length = 0; + arr->free_fn = free_fn; +- if(!(arr->array = (void**)calloc(sizeof(void*), arr->size))) { ++ if(!(arr->array = (void**)calloc(arr->size, sizeof(void*)))) { + free(arr); + return NULL; + } diff --git a/package/json-c/patches/patch-json_object_c b/package/json-c/patches/patch-json_object_c new file mode 100644 index 0000000000000..09b93743e6cf3 --- /dev/null +++ b/package/json-c/patches/patch-json_object_c @@ -0,0 +1,17 @@ + Fix for gcc-14 + + Upstream did not just fix this, but delay (the implicit) memset() in + commit 4a546e7b2f471 ("In arraylist, use malloc instead of calloc, + avoid clearing with memeset until we really need to, and micro-optimize + array_list_add().") which is not suitable for a backport. +--- json-c-0.13.orig/json_object.c 2017-12-05 05:44:03.000000000 +0100 ++++ json-c-0.13/json_object.c 2025-01-08 02:21:42.515180709 +0100 +@@ -218,7 +218,7 @@ static struct json_object* json_object_n + { + struct json_object *jso; + +- jso = (struct json_object*)calloc(sizeof(struct json_object), 1); ++ jso = (struct json_object*)calloc(1, sizeof(struct json_object)); + if (!jso) + return NULL; + jso->o_type = o_type;
Hi Phil,
series applied. Thanks. best regards Waldemar
Phil Sutter wrote,
These changes make my DS414 fileserver build pass. Of course, there may be more breaking packages though.
The last patch merely fixes a warning, BTW.
Phil Sutter (5): package: linux-atm: Revert "fix musl compile" package: apcupsd: Fix for compiling with gcc-13 package: ndisc6: Fix for compiling with gcc-14 package: cfgfs: Fix for compiling with gcc-14 package: cfgfs: Fix for ignored attribute warnings
package/apcupsd/Makefile | 2 +- package/cfgfs/src/c_lzo1x1.c | 6 +++--- package/cfgfs/src/c_null.c | 6 +++--- package/cfgfs/src/c_zlib.c | 6 +++--- package/cfgfs/src/compress.h | 6 +++--- package/cfgfs/src/ft_pack.c | 1 + package/linux-atm/patches/patch-src_ilmid_io_c | 15 --------------- package/linux-atm/patches/patch-src_mpoad_io_c | 18 ------------------ .../linux-atm/patches/patch-src_sigd_atmsigd_c | 11 ----------- package/ndisc6/patches/patch-src_traceroute_h | 6 +++--- 10 files changed, 17 insertions(+), 60 deletions(-) delete mode 100644 package/linux-atm/patches/patch-src_ilmid_io_c delete mode 100644 package/linux-atm/patches/patch-src_mpoad_io_c delete mode 100644 package/linux-atm/patches/patch-src_sigd_atmsigd_c
-- 2.43.0