From patchwork Wed Jun 5 07:52:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 44698 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC95BC25B76 for ; Wed, 5 Jun 2024 07:52:35 +0000 (UTC) Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) by mx.groups.io with SMTP id smtpd.web10.9720.1717573951368440533 for ; Wed, 05 Jun 2024 00:52:32 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=vPzZSWVw; spf=pass (domain: linaro.org, ip: 209.85.167.43, mailfrom: dmitry.baryshkov@linaro.org) Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-52b8b7b8698so6002351e87.1 for ; Wed, 05 Jun 2024 00:52:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717573949; x=1718178749; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=SRoihq8mjKXCcKOhTNzRPIEHjbv0cBMHubECq2gbhC4=; b=vPzZSWVwyaFzMQod8KDHYXKdQWA0AfUBffScuEhlRltJk70cLlrSph3UfEZbpMHTKV 7+YEHuqxHnmxFTzg08vaP1y2y7+b1fpsRrJvTb/k3+mtsWWc5+Y4W+V7v23r94iRR5X3 5tjTnhiimyFYpTHS1Op6aBt3ThVlEMQNJd1dRDhokM+CmjQK8WaQs4A1esdvm373Em/F xl6PhphaM9B9I3rwiL6sFWcLSY+Ll+qZ1eNX8NWKQLxKRA7HD208pZHNJB6XZOhypmU8 G2FGRUwDx/5aM02jg3OGjEKV8Fsf5Y/0YxdokKxkS4awQHNodHPURZ0447dCq0U41SBo 7ZHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717573949; x=1718178749; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=SRoihq8mjKXCcKOhTNzRPIEHjbv0cBMHubECq2gbhC4=; b=An/aKrXB3mfEhhYWnhQsIKevccZJoH6xxC9iSSx5GVFym6QJWkbBnQ1dEpRzvzTBEQ XR+2Ym6LPR48pCdsHcvhn8/CBPbuxWBeoBLK2LGE8sZ42hKf6/Vj2AfOnQqgjY7teT4J 5948KroNGbb+b5iImYFoH8xSd+0HpWdgQ4c2sVdgGODiV39zZfWMAEntZTU08z6uhmXu Vd0P52Bpr3hdko5HJ3bruOCTCFJEZEjdAV9VZotQgyKdZGD1dbNSVZtFiIlTvciogELz hbwxU+D3acJAZt8LH3bkRFysKqxDODJbHnmS2J27o989B61ZyLS4DwSQAQD8prjppkJh oriQ== X-Gm-Message-State: AOJu0YxzdxtFFLcKlbJL2AFGKy6/DO5oQ2i3jNIXScg3QSekBQDblcZO ybO3w8+AFKLI2b/e0o+VP02oNDk65RM+L9lhO/XJhh63VztATqDhQpxuXbz/csIPBdzAAZE4SrZ i X-Google-Smtp-Source: AGHT+IHx5C3J2DTWI10nxEhjj7EzY6NcJY9ETfRKGNNlHwevt93Hs+uAa6b9j8PqFGf0Ej8edsAxNQ== X-Received: by 2002:a19:ca4a:0:b0:523:b19a:2602 with SMTP id 2adb3069b0e04-52bab4f44f3mr1041282e87.54.1717573948177; Wed, 05 Jun 2024 00:52:28 -0700 (PDT) Received: from umbar.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52b9c8a7766sm690199e87.181.2024.06.05.00.52.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 00:52:27 -0700 (PDT) From: Dmitry Baryshkov To: openembedded-devel@lists.openembedded.org Subject: [meta-oe][PATCH v4 1/3] rrdtool: fix compilation with GCC 14 Date: Wed, 5 Jun 2024 10:52:25 +0300 Message-Id: <20240605075227.1833641-1-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 05 Jun 2024 07:52:35 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/110700 Import patch from the rrdtool's git to fix building with GCC 14. Note, it also requires fixing other tools (like lmsensors) in a similar way. Signed-off-by: Dmitry Baryshkov --- With this patchset the rrdtool and recipes depending on it (lm-sensors, ntopng, collectd) can be built w/o errors. --- ...3c578f1e9f582e9c28f50d82b1f569602075.patch | 1583 +++++++++++++++++ .../recipes-extended/rrdtool/rrdtool_1.8.0.bb | 1 + 2 files changed, 1584 insertions(+) create mode 100644 meta-oe/recipes-extended/rrdtool/rrdtool/b76e3c578f1e9f582e9c28f50d82b1f569602075.patch diff --git a/meta-oe/recipes-extended/rrdtool/rrdtool/b76e3c578f1e9f582e9c28f50d82b1f569602075.patch b/meta-oe/recipes-extended/rrdtool/rrdtool/b76e3c578f1e9f582e9c28f50d82b1f569602075.patch new file mode 100644 index 000000000000..7f54a3723d55 --- /dev/null +++ b/meta-oe/recipes-extended/rrdtool/rrdtool/b76e3c578f1e9f582e9c28f50d82b1f569602075.patch @@ -0,0 +1,1583 @@ +From b76e3c578f1e9f582e9c28f50d82b1f569602075 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michal=20Such=C3=A1nek?= +Date: Fri, 5 Jan 2024 15:31:48 +0100 +Subject: [PATCH] Constify argv, fix warnings. (#1242) + +* Fix perl warnings + + - cast POPs to void to avoid unused value warning + - declare functions that don't set RETVAL as returning void + +Signed-off-by: Michal Suchanek + +* Constify argv + +rrd has no business modifying the string pointed to by passed agrv, and +as far as gcc can see it does indeed not modify them because it compiles +with const argv. + +This fixes warnings when passing const strings into rrd, and avoids the +need to duplicate all strings in the tcl bindings. + +This fixes warnings like these: +[ 3s] prog/sensord/rrd.c: In function 'rrdInit': +[ 3s] prog/sensord/rrd.c:302:40: warning: cast discards 'const' qualifier from pointer target type [-Wcast-qual] +[ 3s] 302 | ret = rrd_create(argc, (char**) argv); +[ 3s] | ^ +[ 3s] prog/sensord/rrd.c: In function 'rrdUpdate': +[ 3s] prog/sensord/rrd.c:458:42: warning: cast discards 'const' qualifier from pointer target type [-Wcast-qual] +[ 3s] 458 | if ((ret = rrd_update(3, (char **) /* WEAK */ argv))) { +[ 3s] | ^ + +Signed-off-by: Michal Suchanek + +* tcl: Do not duplicate const strings + +--------- + +Signed-off-by: Michal Suchanek +Upstream-Status: Backport [https://github.com/oetiker/rrdtool-1.x/commit/b76e3c578f1e9f582e9c28f50d82b1f569602075] +--- + CHANGES | 3 ++ + bindings/lua/rrdlua.c | 25 +++++----- + bindings/perl-shared/RRDs.xs | 36 +++++++------- + bindings/python/rrdtoolmodule.c | 38 +++++++-------- + bindings/ruby/main.c | 10 ++-- + bindings/tcl/tclrrd.c | 84 ++++++++------------------------- + src/optparse.c | 14 +++--- + src/optparse.h | 6 +-- + src/rrd.h | 38 +++++++-------- + src/rrd_cgi.c | 24 +++++----- + src/rrd_create.c | 2 +- + src/rrd_daemon.c | 12 ++--- + src/rrd_dump.c | 4 +- + src/rrd_fetch.c | 2 +- + src/rrd_first.c | 2 +- + src/rrd_flushcached.c | 2 +- + src/rrd_graph.c | 6 +-- + src/rrd_graph.h | 4 +- + src/rrd_graph_helper.c | 2 +- + src/rrd_info.c | 2 +- + src/rrd_last.c | 2 +- + src/rrd_lastupdate.c | 2 +- + src/rrd_list.c | 6 +-- + src/rrd_modify.c | 2 +- + src/rrd_modify.h | 2 +- + src/rrd_resize.c | 4 +- + src/rrd_restore.c | 2 +- + src/rrd_tool.c | 26 +++++----- + src/rrd_tune.c | 2 +- + src/rrd_update.c | 4 +- + src/rrd_xport.c | 2 +- + src/rrdupdate.c | 7 +-- + 32 files changed, 168 insertions(+), 209 deletions(-) + +diff --git a/bindings/lua/rrdlua.c b/bindings/lua/rrdlua.c +index d1a700641..2095c3b5b 100644 +--- a/bindings/lua/rrdlua.c ++++ b/bindings/lua/rrdlua.c +@@ -37,8 +37,8 @@ + extern void rrd_freemem(void *mem); + + extern int luaopen_rrd (lua_State * L); +-typedef int (*RRD_FUNCTION)(int, char **); +-typedef rrd_info_t *(RRD_FUNCTION_V)(int, char **); ++typedef int (*RRD_FUNCTION)(int, const char **); ++typedef rrd_info_t *(RRD_FUNCTION_V)(int, const char **); + + /**********************************************************/ + +@@ -49,9 +49,9 @@ static void reset_rrd_state(void) + rrd_clear_error(); + } + +-static char **make_argv(const char *cmd, lua_State * L) ++static const char **make_argv(const char *cmd, lua_State * L) + { +- char **argv; ++ const char **argv; + int i; + int argc = lua_gettop(L) + 1; + +@@ -60,13 +60,12 @@ static char **make_argv(const char *cmd, lua_State * L) + luaL_error(L, "Can't allocate memory for arguments array", cmd); + + /* fprintf(stderr, "Args:\n"); */ +- argv[0] = (char *) cmd; /* Dummy arg. Cast to (char *) because rrd */ +- /* functions don't expect (const * char) */ ++ argv[0] = cmd; + /* fprintf(stderr, "%s\n", argv[0]); */ + for (i=1; i + #include "../../src/rrd_tool.h" + #include "../../src/rrd_format.h" ++#include "../../src/unused.h" + + /* support pre-8.4 tcl */ + +@@ -41,47 +42,39 @@ extern int Tclrrd_SafeInit( + * Hence, we need to do some preparation before + * calling the rrd library functions. + */ +-static char **getopt_init( ++static const char **getopt_init( + int argc, + CONST84 char *argv[]) + { +- char **argv2; ++ const char **argv2; + int i; + + argv2 = calloc(argc, sizeof(char *)); + for (i = 0; i < argc; i++) { +- argv2[i] = strdup(argv[i]); ++ argv2[i] = argv[i]; + } + return argv2; + } + + static void getopt_cleanup( +- int argc, +- char **argv2) ++ int UNUSED(argc), ++ const char **argv2) + { +- int i; +- +- for (i = 0; i < argc; i++) { +- if (argv2[i] != NULL) { +- free(argv2[i]); +- } +- } +- free(argv2); ++ free((void *)argv2); + } + + static void getopt_free_element( +- char *argv2[], ++ const char *argv2[], + int argn) + { + if (argv2[argn] != NULL) { +- free(argv2[argn]); + argv2[argn] = NULL; + } + } + + static void getopt_squieeze( + int *argc, +- char *argv2[]) ++ const char *argv2[]) + { + int i, null_i = 0, argc_tmp = *argc; + +@@ -104,7 +97,7 @@ static int Rrd_Create( + CONST84 char *argv[]) + { + int argv_i; +- char **argv2; ++ const char **argv2; + char *parsetime_error = NULL; + time_t last_up = time(NULL) - 10; + long int long_tmp; +@@ -295,7 +288,7 @@ static int Rrd_Flushcached( + return TCL_ERROR; + } + +- rrd_flushcached(argc, (char**)argv); ++ rrd_flushcached(argc, argv); + + if (rrd_test_error()) { + Tcl_AppendResult(interp, "RRD Error: ", +@@ -380,7 +373,7 @@ static int Rrd_Update( + CONST84 char *argv[]) + { + int argv_i; +- char **argv2, *template = NULL; ++ const char **argv2, *template = NULL; + + argv2 = getopt_init(argc, argv); + +@@ -391,16 +384,10 @@ static int Rrd_Update( + Tcl_AppendResult(interp, "RRD Error: option '", + argv2[argv_i - 1], "' needs an argument", + (char *) NULL); +- if (template != NULL) { +- free(template); +- } + getopt_cleanup(argc, argv2); + return TCL_ERROR; + } +- if (template != NULL) { +- free(template); +- } +- template = strdup(argv2[argv_i]); ++ template = argv2[argv_i]; + getopt_free_element(argv2, argv_i - 1); + getopt_free_element(argv2, argv_i); + } else if (!strcmp(argv2[argv_i], "--")) { +@@ -409,9 +396,6 @@ static int Rrd_Update( + } else if (argv2[argv_i][0] == '-') { + Tcl_AppendResult(interp, "RRD Error: unknown option '", + argv2[argv_i], "'", (char *) NULL); +- if (template != NULL) { +- free(template); +- } + getopt_cleanup(argc, argv2); + return TCL_ERROR; + } +@@ -422,18 +406,12 @@ static int Rrd_Update( + if (argc < 2) { + Tcl_AppendResult(interp, "RRD Error: needs rrd filename", + (char *) NULL); +- if (template != NULL) { +- free(template); +- } + getopt_cleanup(argc, argv2); + return TCL_ERROR; + } + + rrd_update_r(argv2[1], template, argc - 2, (const char **)argv2 + 2); + +- if (template != NULL) { +- free(template); +- } + getopt_cleanup(argc, argv2); + + if (rrd_test_error()) { +@@ -454,7 +432,6 @@ static int Rrd_Info( + { + int status = TCL_OK; + rrd_info_t *data; +- char **argv2; + + /* TODO: support for rrdcached */ + if (argc != 2) { +@@ -463,9 +440,7 @@ static int Rrd_Info( + return TCL_ERROR; + } + +- argv2 = getopt_init(argc, argv); +- +- data = rrd_info_r(argv2[1]); ++ data = rrd_info_r(argv[1]); + + if (data) { + Tcl_SetObjResult(interp, convert_info(data)); +@@ -477,7 +452,6 @@ static int Rrd_Info( + status = TCL_ERROR; + } + +- getopt_cleanup(argc, argv2); + return status; + } + +@@ -488,7 +462,6 @@ static int Rrd_Lastupdate( + CONST84 char *argv[]) + { + time_t last_update; +- char **argv2; + char **ds_namv; + char **last_ds; + char s[30]; +@@ -502,8 +475,7 @@ static int Rrd_Lastupdate( + return TCL_ERROR; + } + +- argv2 = getopt_init(argc, argv); +- if (rrd_lastupdate_r(argv2[1], &last_update, ++ if (rrd_lastupdate_r(argv[1], &last_update, + &ds_cnt, &ds_namv, &last_ds) == 0) { + listPtr = Tcl_GetObjResult(interp); + for (i = 0; i < ds_cnt; i++) { +@@ -527,7 +499,6 @@ static int Rrd_Lastupdate( + free(ds_namv); + } + } +- getopt_cleanup(argc, argv2); + return TCL_OK; + } + +@@ -543,10 +514,8 @@ static int Rrd_Fetch( + char **ds_namv; + Tcl_Obj *listPtr; + char s[30]; +- char **argv2; + +- argv2 = getopt_init(argc, argv); +- if (rrd_fetch(argc, argv2, &start, &end, &step, ++ if (rrd_fetch(argc, argv, &start, &end, &step, + &ds_cnt, &ds_namv, &data) != -1) { + datai = data; + listPtr = Tcl_GetObjResult(interp); +@@ -562,7 +531,6 @@ static int Rrd_Fetch( + free(ds_namv); + free(data); + } +- getopt_cleanup(argc, argv2); + + if (rrd_test_error()) { + Tcl_AppendResult(interp, "RRD Error: ", +@@ -590,7 +558,7 @@ static int Rrd_Graph( + int rc, xsize, ysize; + double ymin, ymax; + char dimensions[50]; +- char **argv2; ++ const char **argv2; + CONST84 char *save; + + /* +@@ -692,11 +660,7 @@ static int Rrd_Tune( + int argc, + CONST84 char *argv[]) + { +- char **argv2; +- +- argv2 = getopt_init(argc, argv); +- rrd_tune(argc, argv2); +- getopt_cleanup(argc, argv2); ++ rrd_tune(argc, argv); + + if (rrd_test_error()) { + Tcl_AppendResult(interp, "RRD Error: ", +@@ -716,11 +680,7 @@ static int Rrd_Resize( + int argc, + CONST84 char *argv[]) + { +- char **argv2; +- +- argv2 = getopt_init(argc, argv); +- rrd_resize(argc, argv2); +- getopt_cleanup(argc, argv2); ++ rrd_resize(argc, argv); + + if (rrd_test_error()) { + Tcl_AppendResult(interp, "RRD Error: ", +@@ -740,11 +700,7 @@ static int Rrd_Restore( + int argc, + CONST84 char *argv[]) + { +- char **argv2; +- +- argv2 = getopt_init(argc, argv); +- rrd_restore(argc, argv2); +- getopt_cleanup(argc, argv2); ++ rrd_restore(argc, argv); + + if (rrd_test_error()) { + Tcl_AppendResult(interp, "RRD Error: ", +diff --git a/src/optparse.c b/src/optparse.c +index 9040ba8b2..79a3efe11 100644 +--- a/src/optparse.c ++++ b/src/optparse.c +@@ -10,7 +10,7 @@ + #define options_argv(i) \ + ((i) < options->argc ? options->argv[i] : NULL) + +-void optparse_init(struct optparse *options, int argc, char **argv) ++void optparse_init(struct optparse *options, int argc, const char **argv) + { + options->argv = argv; + options->argc = argc; +@@ -42,7 +42,7 @@ is_longopt(const char *arg) + static void + permute(struct optparse *options, int index) + { +- char *nonoption = options->argv[index]; ++ const char *nonoption = options->argv[index]; + for (int i = index; i < options->optind - 1; i++) + options->argv[i] = options->argv[i + 1]; + options->argv[options->optind - 1] = nonoption; +@@ -67,7 +67,7 @@ int optparse(struct optparse *options, const char *optstring) + options->errmsg[0] = '\0'; + options->optopt = 0; + options->optarg = NULL; +- char *option = options_argv(options->optind); ++ const char *option = options_argv(options->optind); + if (option == NULL) { + return -1; + } else if (is_dashdash(option)) { +@@ -88,7 +88,7 @@ int optparse(struct optparse *options, const char *optstring) + option += options->subopt + 1; + options->optopt = option[0]; + int type = argtype(optstring, option[0]); +- char *next = options_argv(options->optind + 1); ++ const char *next = options_argv(options->optind + 1); + switch (type) { + case -1: + opterror(options, "invalid option -- '%c'", option[0]); +@@ -128,10 +128,10 @@ int optparse(struct optparse *options, const char *optstring) + return 0; + } + +-char *optparse_arg(struct optparse *options) ++const char *optparse_arg(struct optparse *options) + { + options->subopt = 0; +- char *option = options->argv[options->optind]; ++ const char *option = options->argv[options->optind]; + if (option != NULL) + options->optind++; + return option; +@@ -222,7 +222,7 @@ optparse_long(struct optparse *options, + int *longindex) + { + // printf("%i < %i\n",options->optind,options->argc); +- char *option = options_argv(options->optind); ++ const char *option = options_argv(options->optind); + if (option == NULL) { + return -1; + } else if (is_dashdash(option)) { +diff --git a/src/optparse.h b/src/optparse.h +index c4b0ec19c..7a0bb3885 100644 +--- a/src/optparse.h ++++ b/src/optparse.h +@@ -44,7 +44,7 @@ + */ + + struct optparse { +- char **argv; ++ const char **argv; + int argc; + int permute; + int optind; +@@ -65,7 +65,7 @@ struct optparse_long { + /** + * Initializes the parser state. + */ +-void optparse_init(struct optparse *options, int argc, char **argv); ++void optparse_init(struct optparse *options, int argc, const char **argv); + + /** + * Read the next option in the argv array. +@@ -98,6 +98,6 @@ optparse_long(struct optparse *options, + * subcommand returned by optparse_arg(). This function allows you to + * ignore the value of optind. + */ +-char *optparse_arg(struct optparse *options); ++const char *optparse_arg(struct optparse *options); + + #endif +diff --git a/src/rrd.h b/src/rrd.h +index 184887ccc..b40f9a449 100644 +--- a/src/rrd.h ++++ b/src/rrd.h +@@ -155,10 +155,10 @@ extern "C" { + /* main function blocks */ + int rrd_create( + int, +- char **); ++ const char **); + rrd_info_t *rrd_info( + int, +- char **); ++ const char **); + rrd_info_t *rrd_info_push( + rrd_info_t *, + char *, +@@ -170,19 +170,19 @@ extern "C" { + rrd_info_t *); + char *rrd_list( + int, +- char **); ++ const char **); + char *rrd_list_r( + int, +- char *dirname); ++ const char *dirname); + int rrd_update( + int, +- char **); ++ const char **); + rrd_info_t *rrd_update_v( + int, +- char **); ++ const char **); + int rrd_graph( + int, +- char **, ++ const char **, + char ***, + int *, + int *, +@@ -191,11 +191,11 @@ extern "C" { + double *); + rrd_info_t *rrd_graph_v( + int, +- char **); ++ const char **); + + int rrd_fetch( + int, +- char **, ++ const char **, + time_t *, + time_t *, + unsigned long *, +@@ -204,32 +204,32 @@ extern "C" { + rrd_value_t **); + int rrd_restore( + int, +- char **); ++ const char **); + int rrd_dump( + int, +- char **); ++ const char **); + int rrd_tune( + int, +- char **); ++ const char **); + time_t rrd_last( + int, +- char **); ++ const char **); + int rrd_lastupdate( + int argc, +- char **argv); ++ const char **argv); + time_t rrd_first( + int, +- char **); ++ const char **); + int rrd_resize( + int, +- char **); ++ const char **); + char *rrd_strversion( + void); + double rrd_version( + void); + int rrd_xport( + int, +- char **, ++ const char **, + int *, + time_t *, + time_t *, +@@ -239,7 +239,7 @@ extern "C" { + rrd_value_t **); + int rrd_flushcached( + int argc, +- char **argv); ++ const char **argv); + + void rrd_freemem( + void *mem); +@@ -323,7 +323,7 @@ extern "C" { + const char **argv); + int rrd_dump_opt_r( + const char *filename, +- char *outname, ++ const char *outname, + int opt_noheader); + int rrd_dump_r( + const char *filename, +diff --git a/src/rrd_cgi.c b/src/rrd_cgi.c +index b82c310db..14a4f511a 100644 +--- a/src/rrd_cgi.c ++++ b/src/rrd_cgi.c +@@ -102,7 +102,7 @@ static char *rrdstrip( + static char *scanargs( + char *line, + int *argc, +- char ***args); ++ const char ***args); + + /* format at-time specified times using strftime */ + static char *printstrftime( +@@ -317,7 +317,7 @@ static const char *putvar( + } + + /* expand those RRD:* directives that can be used recursively */ +-static char *rrd_expand_vars( ++static const char *rrd_expand_vars( + char *buffer) + { + int i; +@@ -434,7 +434,7 @@ static int readfile( + + int main( + int argc, +- char *argv[]) ++ const char *argv[]) + { + char *buffer; + long i; +@@ -926,7 +926,7 @@ static char *drawgraph( + } + calfree(); + if (rrd_graph +- (argc + 1, (char **) args - 1, &calcpr, &xsize, &ysize, NULL, &ymin, ++ (argc + 1, args - 1, &calcpr, &xsize, &ysize, NULL, &ymin, + &ymax) != -1) { + return stralloc(calcpr[0]); + } else { +@@ -973,7 +973,7 @@ static char *printtimelast( + /* not raising argc in step with args - 1 since the last argument + will be used below for strftime */ + +- last = rrd_last(argc, (char **) args - 1); ++ last = rrd_last(argc, args - 1); + if (rrd_test_error()) { + char err[4096]; + +@@ -1027,7 +1027,7 @@ static char *printtimenow( + static char *scanargs( + char *line, + int *argument_count, +- char ***arguments) ++ const char ***arguments) + { + char *getP; /* read cursor */ + char *putP; /* write cursor */ +@@ -1039,8 +1039,8 @@ static char *scanargs( + + /* local array of arguments while parsing */ + int argc = 1; +- char **argv; +- char **argv_tmp; /* temp variable for realloc() */ ++ const char **argv; ++ const char **argv_tmp; /* temp variable for realloc() */ + + #ifdef DEBUG_PARSER + printf("<-- scanargs(%s) -->\n", line); +@@ -1051,7 +1051,7 @@ static char *scanargs( + + /* create initial argument array of char pointers */ + argsz = 32; +- argv = (char **) malloc(argsz * sizeof(char *)); ++ argv = malloc(argsz * sizeof(char *)); + if (!argv) { + return NULL; + } +@@ -1146,7 +1146,7 @@ static char *scanargs( + if (argc == argsz - 2) { + /* resize argument array */ + argsz *= 2; +- argv_tmp = (char **) rrd_realloc(argv, argsz * sizeof(char *)); ++ argv_tmp = rrd_realloc(argv, argsz * sizeof(char *)); + if (*argv_tmp == NULL) { + return NULL; + } +@@ -1213,7 +1213,7 @@ static int parse( + /* the name of the vairable ... */ + char *val; + long valln; +- char **args; ++ const char **args; + char *end; + long end_offset; + int argc; +@@ -1264,7 +1264,7 @@ static int parse( + /* make sure we do not shrink the mallocd block */ + size_t newbufsize = i + strlen(end) + valln + 1; + +- *buf = (char *) rrd_realloc(*buf, newbufsize); ++ *buf = rrd_realloc(*buf, newbufsize); + + if (*buf == NULL) { + perror("Realoc buf:"); +diff --git a/src/rrd_create.c b/src/rrd_create.c +index f9bad0866..919b4195a 100644 +--- a/src/rrd_create.c ++++ b/src/rrd_create.c +@@ -76,7 +76,7 @@ static void parseGENERIC_DS( + + int rrd_create( + int argc, +- char **argv) ++ const char **argv) + { + struct optparse_long longopts[] = { + {"start", 'b', OPTPARSE_REQUIRED}, +diff --git a/src/rrd_daemon.c b/src/rrd_daemon.c +index 751798aa1..21c38a11d 100644 +--- a/src/rrd_daemon.c ++++ b/src/rrd_daemon.c +@@ -1877,7 +1877,7 @@ static int handle_request_tune( + HANDLER_PROTO) + { /* {{{ */ + int status; +- char** argv = NULL; ++ const char** argv = NULL; + int argc, argc_tmp; + char* i; + int rc; +@@ -1916,7 +1916,7 @@ static int handle_request_tune( + goto done; + } + +- if ((argv = (char **) malloc(argc * sizeof(char*))) == NULL) { ++ if ((argv = malloc(argc * sizeof(char*))) == NULL) { + rc = send_response(sock, RESP_ERR, "%s\n", rrd_strerror(ENOMEM)); + goto done; + } +@@ -1927,7 +1927,7 @@ static int handle_request_tune( + argc_tmp += 1; + } + +- status = rrd_tune_r(file, argc, (const char **)argv); ++ status = rrd_tune_r(file, argc, argv); + if (status != 0) { + rc = send_response(sock, RESP_ERR, "Got error %s\n", rrd_get_error()); + goto done; +@@ -1935,7 +1935,7 @@ static int handle_request_tune( + rc = send_response(sock, RESP_OK, "Success\n"); + done: + free(file); +- free(argv); ++ free((void *)argv); + return rc; + } + +@@ -4505,7 +4505,7 @@ static int cleanup( + + static int read_options( + int argc, +- char **argv) ++ const char **argv) + { /* {{{ */ + struct optparse_long longopts[] = { + {NULL, 'a', OPTPARSE_REQUIRED}, +@@ -5050,7 +5050,7 @@ static int read_options( + + int main( + int argc, +- char **argv) ++ const char **argv) + { + int status; + +diff --git a/src/rrd_dump.c b/src/rrd_dump.c +index a4490d594..c58e0ee4a 100644 +--- a/src/rrd_dump.c ++++ b/src/rrd_dump.c +@@ -497,7 +497,7 @@ static size_t rrd_dump_opt_cb_fileout( + + int rrd_dump_opt_r( + const char *filename, +- char *outname, ++ const char *outname, + int opt_noheader) + { + FILE *out_file; +@@ -543,7 +543,7 @@ int rrd_dump_r( + + int rrd_dump( + int argc, +- char **argv) ++ const char **argv) + { + int opt; + struct optparse_long longopts[] = { +diff --git a/src/rrd_fetch.c b/src/rrd_fetch.c +index c739bfc45..54780f19b 100644 +--- a/src/rrd_fetch.c ++++ b/src/rrd_fetch.c +@@ -61,7 +61,7 @@ + + int rrd_fetch( + int argc, +- char **argv, ++ const char **argv, + time_t *start, + time_t *end, /* which time frame do you want ? + * will be changed to represent reality */ +diff --git a/src/rrd_first.c b/src/rrd_first.c +index a696c5c38..f3dde5404 100644 +--- a/src/rrd_first.c ++++ b/src/rrd_first.c +@@ -13,7 +13,7 @@ + + time_t rrd_first( + int argc, +- char **argv) ++ const char **argv) + { + struct optparse_long longopts[] = { + {"rraindex", 129, OPTPARSE_REQUIRED}, +diff --git a/src/rrd_flushcached.c b/src/rrd_flushcached.c +index 090bca749..3bf6cd29d 100644 +--- a/src/rrd_flushcached.c ++++ b/src/rrd_flushcached.c +@@ -22,7 +22,7 @@ + #include "rrd_tool.h" + #include "rrd_client.h" + +-int rrd_flushcached (int argc, char **argv) ++int rrd_flushcached (int argc, const char **argv) + { + struct optparse_long longopts[] = { + {"daemon", 'd', OPTPARSE_REQUIRED}, +diff --git a/src/rrd_graph.c b/src/rrd_graph.c +index b32d45085..46511e9a3 100644 +--- a/src/rrd_graph.c ++++ b/src/rrd_graph.c +@@ -4607,7 +4607,7 @@ int scan_for_col( + /* Now just a wrapper around rrd_graph_v */ + int rrd_graph( + int argc, +- char **argv, ++ const char **argv, + char ***prdata, + int *xsize, + int *ysize, +@@ -4690,7 +4690,7 @@ int rrd_graph( + + rrd_info_t *rrd_graph_v( + int argc, +- char **argv) ++ const char **argv) + { + image_desc_t im; + rrd_info_t *grinfo; +@@ -4953,7 +4953,7 @@ void rrd_graph_init( + + void rrd_graph_options( + int argc, +- char *argv[], ++ const char **argv, + struct optparse *poptions, + image_desc_t *im) + { +diff --git a/src/rrd_graph.h b/src/rrd_graph.h +index 4df32ec66..083cf3800 100644 +--- a/src/rrd_graph.h ++++ b/src/rrd_graph.h +@@ -473,12 +473,12 @@ void time_clean( + + void rrd_graph_options( + int, +- char **, ++ const char **, + struct optparse *, + image_desc_t *); + void rrd_graph_script( + int, +- char **, ++ const char **, + image_desc_t *const, + int); + int rrd_graph_color( +diff --git a/src/rrd_graph_helper.c b/src/rrd_graph_helper.c +index 99cdefa65..ba90e1a6c 100644 +--- a/src/rrd_graph_helper.c ++++ b/src/rrd_graph_helper.c +@@ -1952,7 +1952,7 @@ static int parse_xport( + + void rrd_graph_script( + int argc, +- char *argv[], ++ const char **argv, + image_desc_t *const im, + int optno) + { +diff --git a/src/rrd_info.c b/src/rrd_info.c +index c0c6f68c7..eb0d4e4de 100644 +--- a/src/rrd_info.c ++++ b/src/rrd_info.c +@@ -82,7 +82,7 @@ rrd_info_t + + rrd_info_t *rrd_info( + int argc, +- char **argv) ++ const char **argv) + { + struct optparse_long longopts[] = { + {"daemon", 'd', OPTPARSE_REQUIRED}, +diff --git a/src/rrd_last.c b/src/rrd_last.c +index 026a1e828..1aae72512 100644 +--- a/src/rrd_last.c ++++ b/src/rrd_last.c +@@ -11,7 +11,7 @@ + + time_t rrd_last( + int argc, +- char **argv) ++ const char **argv) + { + char *opt_daemon = NULL; + time_t lastupdate; +diff --git a/src/rrd_lastupdate.c b/src/rrd_lastupdate.c +index ab30dcf67..4f7f4770e 100644 +--- a/src/rrd_lastupdate.c ++++ b/src/rrd_lastupdate.c +@@ -14,7 +14,7 @@ + #include "rrd_client.h" + #include + +-int rrd_lastupdate (int argc, char **argv) ++int rrd_lastupdate (int argc, const char **argv) + { + struct optparse_long longopts[] = { + {"daemon", 'd', OPTPARSE_REQUIRED}, +diff --git a/src/rrd_list.c b/src/rrd_list.c +index e743b9b7d..6e96220ea 100644 +--- a/src/rrd_list.c ++++ b/src/rrd_list.c +@@ -37,7 +37,7 @@ static char *move_past_prefix(const char *prefix, const char *string) + return (char *)&(string[index]); + } + +-static char *rrd_list_rec(int recursive, char *root, char *dirname) ++static char *rrd_list_rec(int recursive, const char *root, const char *dirname) + { + #define SANE_ASPRINTF2(_dest_str, _format, ...) \ + if (asprintf(&_dest_str, _format, __VA_ARGS__) == -1) { \ +@@ -138,7 +138,7 @@ static char *rrd_list_rec(int recursive, char *root, char *dirname) + return out; + } + +-char *rrd_list_r(int recursive, char *dirname) ++char *rrd_list_r(int recursive, const char *dirname) + { + #define SANE_ASPRINTF(_dest_str, _format, ...) \ + if (asprintf(&_dest_str, _format, __VA_ARGS__) == -1) { \ +@@ -240,7 +240,7 @@ char *rrd_list_r(int recursive, char *dirname) + return rrd_list_rec(recursive, dirname, dirname); + } + +-char *rrd_list(int argc, char **argv) ++char *rrd_list(int argc, const char **argv) + { + char *opt_daemon = NULL; + int status; +diff --git a/src/rrd_modify.c b/src/rrd_modify.c +index a2b07f640..70ac9e77f 100644 +--- a/src/rrd_modify.c ++++ b/src/rrd_modify.c +@@ -1297,7 +1297,7 @@ static int add_rras(const rrd_t *in, rrd_t *out, const int *ds_map, + } + + int handle_modify(const rrd_t *in, const char *outfilename, +- int argc, char **argv, int optidx, ++ int argc, const char **argv, int optidx, + int newstep) { + // parse add/remove options + int rc = -1; +diff --git a/src/rrd_modify.h b/src/rrd_modify.h +index 52d8789be..64a39926e 100644 +--- a/src/rrd_modify.h ++++ b/src/rrd_modify.h +@@ -28,7 +28,7 @@ typedef struct { + } rra_mod_op_t; + + int handle_modify(const rrd_t *in, const char *outfilename, +- int argc, char **argv, int optind, ++ int argc, const char **argv, int optind, + int newstep); + + typedef union { +diff --git a/src/rrd_resize.c b/src/rrd_resize.c +index fb75d81ff..742e6d141 100644 +--- a/src/rrd_resize.c ++++ b/src/rrd_resize.c +@@ -12,9 +12,9 @@ + + int rrd_resize( + int argc, +- char **argv) ++ const char **argv) + { +- char *infilename, outfilename[11] = "resize.rrd"; ++ const char *infilename, outfilename[11] = "resize.rrd"; + rrd_t rrdold, rrdnew; + rrd_value_t buffer; + int version; +diff --git a/src/rrd_restore.c b/src/rrd_restore.c +index 85d481e0c..ebef5efe8 100644 +--- a/src/rrd_restore.c ++++ b/src/rrd_restore.c +@@ -1378,7 +1378,7 @@ int write_file( + + int rrd_restore( + int argc, +- char **argv) ++ const char **argv) + { + struct optparse_long longopts[] = { + {"range-check", 'r', OPTPARSE_NONE}, +diff --git a/src/rrd_tool.c b/src/rrd_tool.c +index cc6119d9a..56321ee1a 100644 +--- a/src/rrd_tool.c ++++ b/src/rrd_tool.c +@@ -22,16 +22,16 @@ + + + static void PrintUsage( +- char *cmd); ++ const char *cmd); + static int CountArgs( + char *aLine); + static int CreateArgs( ++ const char *, + char *, +- char *, +- char **); ++ const char **); + static int HandleInputLine( + int, +- char **, ++ const char **, + FILE *); + int RemoteMode = 0; + int ChangeRoot = 0; +@@ -42,7 +42,7 @@ int ChangeRoot = 0; + + + static void PrintUsage( +- char *cmd) ++ const char *cmd) + { + + const char *help_main = +@@ -443,11 +443,11 @@ static char *fgetslong( + + int main( + int argc, +- char *argv[]) ++ const char *argv[]) + { +- char **myargv; ++ const char **myargv; + char *aLine; +- char *firstdir = ""; ++ const char *firstdir = ""; + + #ifdef MUST_DISABLE_SIGFPE + signal(SIGFPE, SIG_IGN); +@@ -526,7 +526,7 @@ int main( + printf("ERROR: not enough arguments\n"); + continue; + } +- if ((myargv = (char **) malloc((argc + 1) * ++ if ((myargv = malloc((argc + 1) * + sizeof(char *))) == NULL) { + perror("malloc"); + exit(1); +@@ -572,7 +572,7 @@ int main( + resolving them portably is not really simple. */ + static int HandleInputLine( + int argc, +- char **argv, ++ const char **argv, + FILE * out) + { + #if defined(HAVE_OPENDIR) && defined (HAVE_READDIR) +@@ -887,12 +887,12 @@ static int CountArgs( + * CreateArgs - take a string (aLine) and tokenize + */ + static int CreateArgs( +- char *pName, ++ const char *pName, + char *aLine, +- char **argv) ++ const char **argv) + { + char *getP, *putP; +- char **pargv = argv; ++ const char **pargv = argv; + char Quote = 0; + int inArg = 0; + int len; +diff --git a/src/rrd_tune.c b/src/rrd_tune.c +index 198817f37..dd3f3f7cb 100644 +--- a/src/rrd_tune.c ++++ b/src/rrd_tune.c +@@ -71,7 +71,7 @@ static int set_hwsmootharg( + + int rrd_tune( + int argc, +- char **argv) ++ const char **argv) + { + char *opt_daemon = NULL; + const char *in_filename = NULL; +diff --git a/src/rrd_update.c b/src/rrd_update.c +index fbbe2820a..bb9a0602c 100644 +--- a/src/rrd_update.c ++++ b/src/rrd_update.c +@@ -299,7 +299,7 @@ static void initialize_time( + + rrd_info_t *rrd_update_v( + int argc, +- char **argv) ++ const char **argv) + { + struct optparse_long longopts[] = { + {"template", 't', OPTPARSE_REQUIRED}, +@@ -674,7 +674,7 @@ static int rrd_template_update(const char *filename, /* {{{ */ + + int rrd_update( + int argc, +- char **argv) ++ const char **argv) + { + struct optparse_long longopts[] = { + {"template", 't', OPTPARSE_REQUIRED}, +diff --git a/src/rrd_xport.c b/src/rrd_xport.c +index d15d33dd9..93c02f926 100644 +--- a/src/rrd_xport.c ++++ b/src/rrd_xport.c +@@ -73,7 +73,7 @@ static int rrd_xport_format_addprints( + + int rrd_xport( + int argc, +- char **argv, ++ const char **argv, + int UNUSED(*xsize), + time_t *start, + time_t *end, /* which time frame do you want ? +diff --git a/src/rrdupdate.c b/src/rrdupdate.c +index cbbf48cc1..e368516c8 100644 +--- a/src/rrdupdate.c ++++ b/src/rrdupdate.c +@@ -20,19 +20,20 @@ int main( + int argc, + char **argv) + { ++ const char **cargv = (const char **)argv; + char *name=basename(argv[0]); + rrd_info_t *info; + + if (!strcmp(name, "rrdcreate")) { +- rrd_create(argc, argv); ++ rrd_create(argc, cargv); + } + else if (!strcmp(name, "rrdinfo")) { +- info=rrd_info(argc, argv); ++ info=rrd_info(argc, cargv); + rrd_info_print(info); + rrd_info_free(info); + } + else { +- rrd_update(argc, argv); ++ rrd_update(argc, cargv); + } + + if (rrd_test_error()) { diff --git a/meta-oe/recipes-extended/rrdtool/rrdtool_1.8.0.bb b/meta-oe/recipes-extended/rrdtool/rrdtool_1.8.0.bb index cbe1af2854f2..425a98f0c09b 100644 --- a/meta-oe/recipes-extended/rrdtool/rrdtool_1.8.0.bb +++ b/meta-oe/recipes-extended/rrdtool/rrdtool_1.8.0.bb @@ -11,6 +11,7 @@ PV = "1.8.0" SRC_URI = "\ git://github.com/oetiker/rrdtool-1.x.git;protocol=https;branch=master \ + file://b76e3c578f1e9f582e9c28f50d82b1f569602075.patch \ " S = "${WORKDIR}/git" From patchwork Wed Jun 5 07:52:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 44697 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id CFCD5C27C53 for ; Wed, 5 Jun 2024 07:52:35 +0000 (UTC) Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) by mx.groups.io with SMTP id smtpd.web10.9719.1717573951036418923 for ; Wed, 05 Jun 2024 00:52:31 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=eULVs31J; spf=pass (domain: linaro.org, ip: 209.85.167.52, mailfrom: dmitry.baryshkov@linaro.org) Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-52b98fb5c32so4684258e87.1 for ; Wed, 05 Jun 2024 00:52:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717573949; x=1718178749; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=xCMx9sYc1uOiXitud5MW0vmewkEubFu+1lnNmuqRHW0=; b=eULVs31JfMRN67g8ohM61GeX4FdccgSg05jJ14B1fh34AQ4Nd4/YW9lI1ZeO+yQ/FU B2KJbuNiUoh6e8wjLMFP4/q6Lsb0HpSBk41x3Mol/VRpO4mwp2wLNuHJQ0GNjtv+CI77 sBxVwG3VwMcwJCAEJ/+ra23xytqlfbddxSVbbXNgtAaxm6SaV+wSXgv0hUx+DWcVUo+5 YYf78nil9mg8SLdZIw/7HKr8WDh17ugnC+zp5/07P95s8or+T1tS9KFmsoaUXxQp8fhg aydaBCbNNAasuUg8RciDob12SsnKsfVDLg+0amwelobYjq+LDul4p00Ca/8QhYfWK3+w XZvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717573949; x=1718178749; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xCMx9sYc1uOiXitud5MW0vmewkEubFu+1lnNmuqRHW0=; b=PSWvxS5IBYMMtLp1funxHrpY4G9QcjkiMMzKz2ueMZbLt/rDQH3+OhkXc5gfkSkaos pA9KjiwK2+SWCHDrmf7igr8uOZ6ozxwIAFBI6uGSHjiocGm3RbhYyIfIJedWYVD9KQre V6M4GxdBvdoezHGSNKJINT1DOU/17dWD/mFOuijtmC1RIt3c5/IdWbRoKd9kfitZP80z o/smnsBywNFNZK+nZbIS7JFgbtVSktCBF15aeY7EujhbYpZ9Y4GxNzAkpxNYS490LPhz zgVchT1Fi3+GBFsGjsR/Wbs/B6BunOKZhooJZ9RE/4Ucu4Wa5/MNP2UTAhVHnR+H6keY 6G0w== X-Gm-Message-State: AOJu0YzaFtiZOmjLREJbsuFLCgwb1NbbOoho+72KpPySMWA2Unub1yUF MyS0pDYokN/A05KJKUgbzyndPLzXIx7CaOkTCqFGLrQqDVYvbjDG33dBhB29XBBrYJ6xcVG3pSh L X-Google-Smtp-Source: AGHT+IH/RTP+bdaKAeuPVuCROnjbKqitS5rIjr8S29jttloBz1Cf7f+kpy36YeGM6U+izJE/HtnRAw== X-Received: by 2002:a19:741a:0:b0:52b:9941:4b96 with SMTP id 2adb3069b0e04-52bab50b714mr1164786e87.63.1717573948758; Wed, 05 Jun 2024 00:52:28 -0700 (PDT) Received: from umbar.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52b9c8a7766sm690199e87.181.2024.06.05.00.52.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 00:52:28 -0700 (PDT) From: Dmitry Baryshkov To: openembedded-devel@lists.openembedded.org Subject: [meta-oe][PATCH v4 2/3] lmsensors: fix building with GCC 14 Date: Wed, 5 Jun 2024 10:52:26 +0300 Message-Id: <20240605075227.1833641-2-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240605075227.1833641-1-dmitry.baryshkov@linaro.org> References: <20240605075227.1833641-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 05 Jun 2024 07:52:35 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/110698 GCC 14 is more strict regarding const pointers conversion. Fix conversion to let lmsensors build with GCC 14. Signed-off-by: Dmitry Baryshkov --- .../0001-Fix-building-with-GCC-14.patch | 36 +++++++++++++++++++ .../recipes-bsp/lm_sensors/lmsensors_3.6.0.bb | 1 + 2 files changed, 37 insertions(+) create mode 100644 meta-oe/recipes-bsp/lm_sensors/lmsensors/0001-Fix-building-with-GCC-14.patch diff --git a/meta-oe/recipes-bsp/lm_sensors/lmsensors/0001-Fix-building-with-GCC-14.patch b/meta-oe/recipes-bsp/lm_sensors/lmsensors/0001-Fix-building-with-GCC-14.patch new file mode 100644 index 000000000000..0ff8b3801b95 --- /dev/null +++ b/meta-oe/recipes-bsp/lm_sensors/lmsensors/0001-Fix-building-with-GCC-14.patch @@ -0,0 +1,36 @@ +From fd49cbcb7f3402e1a4a99b71b901a564060039b4 Mon Sep 17 00:00:00 2001 +From: Dmitry Baryshkov +Date: Fri, 24 May 2024 14:16:21 +0300 +Subject: [PATCH] Fix building with GCC 14 + +Signed-off-by: Dmitry Baryshkov +Upstream-Status: Submitted [https://github.com/lm-sensors/lm-sensors/pull/497] +--- + prog/sensord/rrd.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/prog/sensord/rrd.c b/prog/sensord/rrd.c +index a531362bddd5..36d685fce514 100644 +--- a/prog/sensord/rrd.c ++++ b/prog/sensord/rrd.c +@@ -299,7 +299,7 @@ int rrdInit(void) + argv[argc++] = rraBuff; + argv[argc] = NULL; + +- ret = rrd_create(argc, (char**) argv); ++ ret = rrd_create(argc, (const char**) argv); + if (ret == -1) { + sensorLog(LOG_ERR, "Error creating RRD file: %s: %s", + sensord_args.rrdFile, rrd_get_error()); +@@ -455,7 +455,7 @@ int rrdUpdate(void) + const char *argv[] = { + "sensord", sensord_args.rrdFile, rrdBuff, NULL + }; +- if ((ret = rrd_update(3, (char **) /* WEAK */ argv))) { ++ if ((ret = rrd_update(3, (const char **) /* WEAK */ argv))) { + sensorLog(LOG_ERR, "Error updating RRD file: %s: %s", + sensord_args.rrdFile, rrd_get_error()); + } +-- +2.39.2 + diff --git a/meta-oe/recipes-bsp/lm_sensors/lmsensors_3.6.0.bb b/meta-oe/recipes-bsp/lm_sensors/lmsensors_3.6.0.bb index f956224e1820..07027225c58b 100644 --- a/meta-oe/recipes-bsp/lm_sensors/lmsensors_3.6.0.bb +++ b/meta-oe/recipes-bsp/lm_sensors/lmsensors_3.6.0.bb @@ -14,6 +14,7 @@ SRC_URI = "git://github.com/lm-sensors/lm-sensors.git;protocol=https;branch=mast file://fancontrol.init \ file://sensord.init \ file://0001-Change-PIDFile-path-from-var-run-to-run.patch \ + file://0001-Fix-building-with-GCC-14.patch \ " SRCREV = "1667b850a1ce38151dae17156276f981be6fb557" From patchwork Wed Jun 5 07:52:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 44696 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id BBC96C27C52 for ; Wed, 5 Jun 2024 07:52:35 +0000 (UTC) Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) by mx.groups.io with SMTP id smtpd.web10.9721.1717573951602223777 for ; Wed, 05 Jun 2024 00:52:31 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=JtiGpUwJ; spf=pass (domain: linaro.org, ip: 209.85.208.171, mailfrom: dmitry.baryshkov@linaro.org) Received: by mail-lj1-f171.google.com with SMTP id 38308e7fff4ca-2eabd22d441so24789791fa.2 for ; Wed, 05 Jun 2024 00:52:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717573949; x=1718178749; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=/7PRbZlEBP6G4HrEnnTFsPNFCTYyULihjL1uIyhnxG0=; b=JtiGpUwJuCx7PSe0iRHIwfTu7yi+VmHKkos9936h4KJGmw30LAFMBCOspVX6aI3z4E un1K8PMvLcm4hxJTVpkHgQa3mCnyV7mzaIfEoXlk4Y42j9wqVReMobfsH92v7JN+l4Gh Msc4fuKFCir4cwb/o00RhCwte3GgkecjraxEjUZ9hyrnpa4E79gq3lCrXiAi2GxzRok+ 8XVQHOvH26obfGZd+vtbK1iH1BswQFooOAIP1XrNrRh0KHZZJxf1uKiy/GeunYcTbz5p SqU7AXnu75cH31XiUBFOMUUN7hX8vwGVpixYMF6YF44o9VpPjhTJwSnCwuOuLqurx9tt p5dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717573949; x=1718178749; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/7PRbZlEBP6G4HrEnnTFsPNFCTYyULihjL1uIyhnxG0=; b=DWfiXA/fyLBplpqWESDs1jSStVozNUKIBLeFR0m0ATzXsZPw9hGUWHW5DLRibXO84R GI2+al0Emvoo46NrNkFIRHk6gzclrJ9S10KKesLnYPZeZJmlujV6Rt84RIoc9GFnSTDC v4zgR/Sp0TgGbQ5R+OjCc5o1hXw7FsVAqoYB1jWKmCEKk5xTpZX0I2vCLCpiOx4tQFyl PqeiRWmC+tqOyyc52xbURCcxkGBAVxi4R4ZuYKRZ3MjPvifExWoR/F18fD6kP8jg+H5B 1C23u4B+ygcB8F3ikzjMQ7ctb2QALvzpCwvRTDdmh7GrfN6wYc1lwnI6urGgz8JOFKTM jYmg== X-Gm-Message-State: AOJu0Yxf0LKbtsJuHcy7F2HVnC9960duYz6OmIP5BRbGiVWJkJR1r1UM nOgkbqAhTzmDM1eixlhF7vq8r4MQTE50Vuww6NUWlo7SLKs+wRultHplW3/MNUw/a9cc08JGEfX 0 X-Google-Smtp-Source: AGHT+IGC5KeiEhGYpxycuPz089gaFGAp07JrCF9B3vn9NHlOqOCVlH8XYdlEPFBWN9JZCiIlTYrbBQ== X-Received: by 2002:ac2:48a7:0:b0:52b:77c9:182 with SMTP id 2adb3069b0e04-52bab50b8f9mr1313253e87.68.1717573949353; Wed, 05 Jun 2024 00:52:29 -0700 (PDT) Received: from umbar.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52b9c8a7766sm690199e87.181.2024.06.05.00.52.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 00:52:29 -0700 (PDT) From: Dmitry Baryshkov To: openembedded-devel@lists.openembedded.org Subject: [meta-oe][PATCH v4 3/3] ntopng: fix building with GCC 14 Date: Wed, 5 Jun 2024 10:52:27 +0300 Message-Id: <20240605075227.1833641-3-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240605075227.1833641-1-dmitry.baryshkov@linaro.org> References: <20240605075227.1833641-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 05 Jun 2024 07:52:35 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/110699 GCC 14 is more strict regarding const pointers conversion. Fix conversion to let ntpong build with GCC 14 and updated rrdtool. The patch is not submitted upstream yet, the project requires singing of CLA. Signed-off-by: Dmitry Baryshkov --- .../0001-Follow-rrd-post-1.8-change.patch | 32 +++++++++++++++++++ .../recipes-support/ntopng/ntopng_5.2.1.bb | 1 + 2 files changed, 33 insertions(+) create mode 100644 meta-networking/recipes-support/ntopng/files/0001-Follow-rrd-post-1.8-change.patch diff --git a/meta-networking/recipes-support/ntopng/files/0001-Follow-rrd-post-1.8-change.patch b/meta-networking/recipes-support/ntopng/files/0001-Follow-rrd-post-1.8-change.patch new file mode 100644 index 000000000000..eefd4e1ab2ef --- /dev/null +++ b/meta-networking/recipes-support/ntopng/files/0001-Follow-rrd-post-1.8-change.patch @@ -0,0 +1,32 @@ +From a3bd9efe78f9c381f19b99c8ceb7f52b4c2a52b8 Mon Sep 17 00:00:00 2001 +From: Dmitry Baryshkov +Date: Wed, 5 Jun 2024 09:40:17 +0300 +Subject: [PATCH] Follow rrd post-1.8 change + +Git version of rrdtool has changed rrd_tune argument from char pointer +to const char pointer. GCC 14 is more strict regarding the pointer +constantness checks and errors out in such a case. Update rrd_tune +invokation. + +Signed-off-by: Dmitry Baryshkov +Upstream-Status: Pending [CLA is not signed on our side] +--- + src/LuaEngineNtop.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/LuaEngineNtop.cpp b/src/LuaEngineNtop.cpp +index bd2de79e3021..dd00f1608f78 100644 +--- a/src/LuaEngineNtop.cpp ++++ b/src/LuaEngineNtop.cpp +@@ -5427,7 +5427,7 @@ static int ntop_rrd_tune(lua_State* vm) { + filename = argv[1]; + + reset_rrd_state(); +- status = rrd_tune(argc, (char**)argv); ++ status = rrd_tune(argc, (const char**)argv); + + if(status != 0) { + char *err = rrd_get_error(); +-- +2.39.2 + diff --git a/meta-networking/recipes-support/ntopng/ntopng_5.2.1.bb b/meta-networking/recipes-support/ntopng/ntopng_5.2.1.bb index a9ace9b41267..9bb93910f89a 100644 --- a/meta-networking/recipes-support/ntopng/ntopng_5.2.1.bb +++ b/meta-networking/recipes-support/ntopng/ntopng_5.2.1.bb @@ -19,6 +19,7 @@ SRC_URI = "git://github.com/ntop/ntopng.git;protocol=https;branch=5.2-stable \ file://0001-autogen.sh-generate-configure.ac-only.patch \ file://0001-configure.ac.in-not-check-clang-on-host.patch \ file://0001-configure.ac.in-Allow-dynamic-linking-against-ndpi-3.patch \ + file://0001-Follow-rrd-post-1.8-change.patch \ file://ntopng.service \ "