From 986c2944672ac8e824c88c1a2ef731653ff46080 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Tue, 29 Oct 2024 18:47:24 +0000 Subject: [PATCH 01/10] OS-8584 Introduce gcc14 as the shadow-compiler --- gcc14/Makefile | 35 ++++++++++++++++++++++++++ gcc14/Patches/1000-ld-flags.patch | 41 +++++++++++++++++++++++++++++++ gcc14/gcc-14.2.0-il-1.tar.gz.sha1 | 1 + gcc14/gmp-6.3.0.tar.bz2.sha1 | 1 + gcc14/mpc-1.3.1.tar.gz.sha1 | 1 + gcc14/mpfr-4.2.1.tar.bz2.sha1 | 1 + 6 files changed, 80 insertions(+) create mode 100644 gcc14/Makefile create mode 100644 gcc14/Patches/1000-ld-flags.patch create mode 100644 gcc14/gcc-14.2.0-il-1.tar.gz.sha1 create mode 100644 gcc14/gmp-6.3.0.tar.bz2.sha1 create mode 100644 gcc14/mpc-1.3.1.tar.gz.sha1 create mode 100644 gcc14/mpfr-4.2.1.tar.bz2.sha1 diff --git a/gcc14/Makefile b/gcc14/Makefile new file mode 100644 index 00000000..1ea7fdd2 --- /dev/null +++ b/gcc14/Makefile @@ -0,0 +1,35 @@ +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright 2021 Joyent, Inc. +# Copyright 2024 MNX Cloud, Inc. +# + +# +# The tarball is from a specific tagged release of +# https://github.com/illumos/gcc repository. This includes all of the +# illumos-specific modifications we need. We could probably do a git clone +# instead, but the tarball method is easier given these Makefiles. +# + +include ../Makefile.defs + +BUILD64=yes +BUILD32= + +GCC_VER = 14 +VER = gcc-14.2.0-il-1 +MPFR_VER = mpfr-4.2.1 +GMP_VER = gmp-6.3.0 +MPC_VER = mpc-1.3.1 + +include ../Makefile.gcc diff --git a/gcc14/Patches/1000-ld-flags.patch b/gcc14/Patches/1000-ld-flags.patch new file mode 100644 index 00000000..e5cf4d8f --- /dev/null +++ b/gcc14/Patches/1000-ld-flags.patch @@ -0,0 +1,41 @@ +From 6d60d54cd43708f73bc54aa464047c5e5c15c7ab Mon Sep 17 00:00:00 2001 +From: Andy Fiddaman +Date: Thu, 9 May 2019 13:43:30 +0000 +Subject: OOCE: Adjust default library paths for OmniOS + +--- + gcc/config/sol2.h | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/gcc/config/sol2.h b/gcc/config/sol2.h +index 0e1fbaeaf863..3bfeab05bc40 100644 +--- a/gcc/config/sol2.h ++++ b/gcc/config/sol2.h +@@ -304,12 +304,15 @@ along with GCC; see the file COPYING3. If not see + "%{Ofast|ffast-math|funsafe-math-optimizations:%{!shared:crtfastmath.o%s}} \ + %(endfile_arch) %(endfile_vtv) %(endfile_crtend) crtn.o%s" + ++#define STRINGIFY(x) #x ++#define TOSTRING(x) STRINGIFY(x) ++#define GNUCMAJOR TOSTRING(__GNUC__) ++ + #undef LINK_ARCH32_SPEC_BASE + #define LINK_ARCH32_SPEC_BASE \ + "%{YP,*} \ + %{R*} \ +- %{!YP,*:%{p|pg:-Y P,%R/usr/lib/libp%R/lib:%R/usr/lib} \ +- %{!p:%{!pg:-Y P,%R/lib:%R/usr/lib}}}" ++ %{!YP,*:-Y P,%R/usr/gcc/" GNUCMAJOR "/lib:%R/lib:%R/usr/lib -L %R/usr/gcc/" GNUCMAJOR "/lib -R %R/usr/gcc/" GNUCMAJOR "/lib}" + + #undef LINK_ARCH32_SPEC + #define LINK_ARCH32_SPEC LINK_ARCH32_SPEC_BASE +@@ -320,8 +323,7 @@ along with GCC; see the file COPYING3. If not see + #define LINK_ARCH64_SPEC_BASE \ + "%{YP,*} \ + %{R*} \ +- %{!YP,*:%{p|pg:-Y P,%R/usr/lib/libp/" ARCH64_SUBDIR ":%R/lib/" ARCH64_SUBDIR ":%R/usr/lib/" ARCH64_SUBDIR "} \ +- %{!p:%{!pg:-Y P,%R/lib/" ARCH64_SUBDIR ":%R/usr/lib/" ARCH64_SUBDIR "}}}" ++ %{!YP,*:-Y P,%R/usr/gcc/" GNUCMAJOR "/lib/" ARCH64_SUBDIR ":%R/lib/" ARCH64_SUBDIR ":%R/usr/lib/" ARCH64_SUBDIR " -L %R/usr/gcc/" GNUCMAJOR "/lib/" ARCH64_SUBDIR " -R %R/usr/gcc/" GNUCMAJOR "/lib/" ARCH64_SUBDIR "}" + + #undef LINK_ARCH64_SPEC + #ifndef USE_GLD diff --git a/gcc14/gcc-14.2.0-il-1.tar.gz.sha1 b/gcc14/gcc-14.2.0-il-1.tar.gz.sha1 new file mode 100644 index 00000000..c32059d7 --- /dev/null +++ b/gcc14/gcc-14.2.0-il-1.tar.gz.sha1 @@ -0,0 +1 @@ +52f7a39caeae0d14f8a94b600fd6b8e436b57b69 diff --git a/gcc14/gmp-6.3.0.tar.bz2.sha1 b/gcc14/gmp-6.3.0.tar.bz2.sha1 new file mode 100644 index 00000000..6f8deb71 --- /dev/null +++ b/gcc14/gmp-6.3.0.tar.bz2.sha1 @@ -0,0 +1 @@ +32d21c4fae046de45e8fce37bf4002236d283b71 diff --git a/gcc14/mpc-1.3.1.tar.gz.sha1 b/gcc14/mpc-1.3.1.tar.gz.sha1 new file mode 100644 index 00000000..65edfdb9 --- /dev/null +++ b/gcc14/mpc-1.3.1.tar.gz.sha1 @@ -0,0 +1 @@ +bac1c1fa79f5602df1e29e4684e103ad55714e02 diff --git a/gcc14/mpfr-4.2.1.tar.bz2.sha1 b/gcc14/mpfr-4.2.1.tar.bz2.sha1 new file mode 100644 index 00000000..e20c5820 --- /dev/null +++ b/gcc14/mpfr-4.2.1.tar.bz2.sha1 @@ -0,0 +1 @@ +f9dbe49b092e4c8e0a039e6d46c059696cc2f51c From d60c7cc1d55ba6f092989c871ae1be627097e591 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Wed, 30 Oct 2024 12:28:19 +0000 Subject: [PATCH 02/10] openssl1x update for gcc 14 --- .../Patches/0019-Fix-gcc16-warning.patch | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 openssl1x/Patches/0019-Fix-gcc16-warning.patch diff --git a/openssl1x/Patches/0019-Fix-gcc16-warning.patch b/openssl1x/Patches/0019-Fix-gcc16-warning.patch new file mode 100644 index 00000000..d9bca2db --- /dev/null +++ b/openssl1x/Patches/0019-Fix-gcc16-warning.patch @@ -0,0 +1,39 @@ +diff -ruN a/crypto/bio/b_sock.c b/crypto/bio/b_sock.c +--- a/crypto/bio/b_sock.c 2019-12-20 13:02:41.000000000 +0000 ++++ b/crypto/bio/b_sock.c 2024-10-30 12:24:47.327491619 +0000 +@@ -114,7 +114,7 @@ + } ghbn_cache[GHBN_NUM]; + # endif + +-static int get_ip(const char *str, unsigned char *ip); ++static int get_ip(const char *str, unsigned char ip[4]); + # if 0 + static void ghbn_free(struct hostent *a); + static struct hostent *ghbn_dup(struct hostent *a); + +diff -ruN a/ssl/s3_cbc.c b/ssl/s3_cbc.c +--- a/ssl/s3_cbc.c 2019-12-20 13:02:41.000000000 +0000 ++++ b/ssl/s3_cbc.c 2024-10-30 17:36:22.783824446 +0000 +@@ -663,7 +663,8 @@ + } + overhang = header_length - md_block_size; + md_transform(md_state.c, header); +- memcpy(first_block, header + md_block_size, overhang); ++ memcpy(first_block, (void *)((uintptr_t)header + md_block_size), ++ overhang); + memcpy(first_block + overhang, data, md_block_size - overhang); + md_transform(md_state.c, first_block); + for (i = 1; i < k / md_block_size - 1; i++) + +diff -ruN a/ssl/t1_lib.c b/ssl/t1_lib.c +--- a/ssl/t1_lib.c 2019-12-20 13:02:41.000000000 +0000 ++++ b/ssl/t1_lib.c 2024-10-31 10:03:38.669806445 +0000 +@@ -3926,7 +3926,7 @@ + for (i = 0, sigptr = c->shared_sigalgs; + i < c->shared_sigalgslen; i++, sigptr++) { + idx = tls12_get_pkey_idx(sigptr->rsign); +- if (s->cert->pkeys[idx].privatekey) { ++ if (idx > 0 && s->cert->pkeys[idx].privatekey) { + ERR_set_mark(); + if (EVP_PKEY_get_default_digest_nid(s->cert->pkeys[idx].privatekey, + &mandatory_mdnid) == 2 && From 4898683c3c7c0c3fb0df79e6d3897369e2326951 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Thu, 31 Oct 2024 11:28:15 +0000 Subject: [PATCH 03/10] nss-nspr update for gcc 14 --- nss-nspr/Patches/ecperf.patch | 18 ++++++++++++++++++ nss-nspr/Patches/jar.patch | 11 +++++++++++ nss-nspr/Patches/pkcs12.patch | 21 +++++++++++++++++++++ nss-nspr/Patches/sqlite.patch | 11 +++++++++++ 4 files changed, 61 insertions(+) create mode 100644 nss-nspr/Patches/ecperf.patch create mode 100644 nss-nspr/Patches/jar.patch create mode 100644 nss-nspr/Patches/pkcs12.patch diff --git a/nss-nspr/Patches/ecperf.patch b/nss-nspr/Patches/ecperf.patch new file mode 100644 index 00000000..1f2350e8 --- /dev/null +++ b/nss-nspr/Patches/ecperf.patch @@ -0,0 +1,18 @@ +--- a/nss/cmd/ecperf/ecperf.c 2016-06-20 17:11:28.000000000 +0000 ++++ b/nss/cmd/ecperf/ecperf.c 2024-10-31 11:47:03.297310415 +0000 +@@ -140,6 +140,7 @@ + } + threadData->count++; + } ++ threadData->p2 = NULL; + return; + } + +@@ -168,6 +169,7 @@ + } + threadData->count++; + } ++ threadData->p2 = NULL; + return; + } + diff --git a/nss-nspr/Patches/jar.patch b/nss-nspr/Patches/jar.patch new file mode 100644 index 00000000..fe5cbc64 --- /dev/null +++ b/nss-nspr/Patches/jar.patch @@ -0,0 +1,11 @@ +--- a/nss/lib/jar/jarfile.c 2016-06-20 17:11:28.000000000 +0000 ++++ b/nss/lib/jar/jarfile.c 2024-10-31 11:36:22.718304546 +0000 +@@ -657,7 +657,7 @@ + jar_listzip(JAR *jar, JAR_FILE fp) + { + ZZLink *ent; +- JAR_Item *it; ++ JAR_Item *it = NULL; + JAR_Physical *phy = NULL; + struct ZipLocal *Local = PORT_ZNew(struct ZipLocal); + struct ZipCentral *Central = PORT_ZNew(struct ZipCentral); diff --git a/nss-nspr/Patches/pkcs12.patch b/nss-nspr/Patches/pkcs12.patch new file mode 100644 index 00000000..4c8db467 --- /dev/null +++ b/nss-nspr/Patches/pkcs12.patch @@ -0,0 +1,21 @@ +--- a/nss/lib/pkcs12/p12e.c 2016-06-20 17:11:28.000000000 +0000 ++++ b/nss/lib/pkcs12/p12e.c 2024-10-31 11:34:08.985776010 +0000 +@@ -1642,12 +1642,12 @@ + sec_pkcs12_encoder_destroy_context(p12enc); + if (p12exp->arena != NULL) + PORT_ArenaRelease(p12exp->arena, mark); +- if (salt) { +- SECITEM_ZfreeItem(salt, PR_TRUE); +- } +- if (params) { +- PK11_DestroyPBEParams(params); +- } ++ if (salt) { ++ SECITEM_ZfreeItem(salt, PR_TRUE); ++ } ++ if (params) { ++ PK11_DestroyPBEParams(params); ++ } + + return NULL; + } diff --git a/nss-nspr/Patches/sqlite.patch b/nss-nspr/Patches/sqlite.patch index 53f3c90f..bb3c910a 100644 --- a/nss-nspr/Patches/sqlite.patch +++ b/nss-nspr/Patches/sqlite.patch @@ -23,3 +23,14 @@ } if( pEList==0 ){ pEList = sqlite3ExprListAppend(pParse, 0, sqlite3Expr(db,TK_ASTERISK,0)); +--- a/nss/lib/sqlite/sqlite3.c 2024-08-10 21:56:37.618421906 +0000 ++++ b/nss/lib/sqlite/sqlite3.c 2024-10-31 11:25:29.296176331 +0000 +@@ -97170,7 +97170,7 @@ + ** number of rows in the table. Or 10, if the estimated number of rows + ** in the table is less than that. */ + a[0] = pIdx->pTable->nRowLogEst; +- if( a[0]<33 ) a[0] = 33; assert( 33==sqlite3LogEst(10) ); ++ if( a[0]<33 ) { a[0] = 33; } assert( 33==sqlite3LogEst(10) ); + + /* Estimate that a[1] is 10, a[2] is 9, a[3] is 8, a[4] is 7, a[5] is + ** 6 and each subsequent value (if any) is 5. */ From bf383eead58c35ee9218753004c4d757cde0cce3 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Fri, 1 Nov 2024 19:33:16 +0000 Subject: [PATCH 04/10] coreutils update for gcc 14 --- .../0002-memset_s-needs-prototype.patch | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 coreutils/Patches/0002-memset_s-needs-prototype.patch diff --git a/coreutils/Patches/0002-memset_s-needs-prototype.patch b/coreutils/Patches/0002-memset_s-needs-prototype.patch new file mode 100644 index 00000000..dfec556f --- /dev/null +++ b/coreutils/Patches/0002-memset_s-needs-prototype.patch @@ -0,0 +1,18 @@ +--- a/lib/memset_explicit.c 2023-01-01 13:39:11.000000000 +0000 ++++ b/lib/memset_explicit.c 2024-11-01 19:32:28.993075042 +0000 +@@ -14,13 +14,10 @@ + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . */ + +-#include +- +-/* memset_s need this define */ +-#if HAVE_MEMSET_S ++/* memset_s need this define before config.h */ + # define __STDC_WANT_LIB_EXT1__ 1 +-#endif + ++#include + #include + + /* Set S's bytes to C, where S has LEN bytes. The compiler will not From 50f83169d5f0219164b9b761e5c4c2cda41e0ab4 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Fri, 1 Nov 2024 21:10:59 +0000 Subject: [PATCH 05/10] dialog update for gcc 14 --- dialog/Makefile | 2 ++ dialog/Patches/0001-configure.patch | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 dialog/Patches/0001-configure.patch diff --git a/dialog/Makefile b/dialog/Makefile index c744941c..6740bbdf 100644 --- a/dialog/Makefile +++ b/dialog/Makefile @@ -35,3 +35,5 @@ AUTOCONF_OPTS += \ include ../Makefile.targ include ../Makefile.targ.autoconf + +PATCHES = Patches/* diff --git a/dialog/Patches/0001-configure.patch b/dialog/Patches/0001-configure.patch new file mode 100644 index 00000000..b204f445 --- /dev/null +++ b/dialog/Patches/0001-configure.patch @@ -0,0 +1,20 @@ +--- a/configure 2011-10-20 21:27:48.000000000 +0000 ++++ b/configure 2024-11-01 21:24:35.301726636 +0000 +@@ -9442,7 +9442,7 @@ + int + main () + { +-initscr(); tgoto("?", 0,0) ++initscr(); endwin() + ; + return 0; + } +@@ -10780,7 +10780,7 @@ + int + main () + { +-initscr(); tgoto("?", 0,0) ++initscr(); endwin() + ; + return 0; + } From 92a65b625cb95f0aea33866e83da6b7df47a883c Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Mon, 4 Nov 2024 08:35:03 +0000 Subject: [PATCH 06/10] ipmitool update for gcc 14 --- ipmitool/Patches/gcc-14.patch | 441 ++++++++++++++++++++++++++++++++++ 1 file changed, 441 insertions(+) create mode 100644 ipmitool/Patches/gcc-14.patch diff --git a/ipmitool/Patches/gcc-14.patch b/ipmitool/Patches/gcc-14.patch new file mode 100644 index 00000000..88574ab8 --- /dev/null +++ b/ipmitool/Patches/gcc-14.patch @@ -0,0 +1,441 @@ +diff -ruN a/lib/ipmi_fru.c b/lib/ipmi_fru.c +--- a/lib/ipmi_fru.c 2016-08-28 08:21:55.000000000 +0000 ++++ b/lib/ipmi_fru.c 2024-11-02 11:50:12.131861887 +0000 +@@ -66,6 +66,10 @@ + ipmi_intf_set_max_request_data_size(struct ipmi_intf * intf, uint16_t size); + void + ipmi_intf_set_max_response_data_size(struct ipmi_intf * intf, uint16_t size); ++uint16_t ++ipmi_intf_get_max_response_data_size(struct ipmi_intf * intf); ++uint16_t ++ipmi_intf_get_max_request_data_size(struct ipmi_intf * intf); + + extern int verbose; + +@@ -88,9 +92,6 @@ + struct fru_info fru, struct fru_header header, + uint8_t f_type, uint8_t f_index, char *f_string); + +-static void +-fru_area_print_multirec_bloc(struct ipmi_intf * intf, struct fru_info * fru, +- uint8_t id, uint32_t offset); + int + read_fru_area(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id, + uint32_t offset, uint32_t length, uint8_t *frubuf); +@@ -822,67 +823,6 @@ + } + + +-static void +-fru_area_print_multirec_bloc(struct ipmi_intf * intf, struct fru_info * fru, +- uint8_t id, uint32_t offset) +-{ +- uint8_t * fru_data = NULL; +- uint32_t i; +- struct fru_multirec_header * h; +- uint32_t last_off, len; +- +- i = last_off = offset; +- +- fru_data = malloc(fru->size + 1); +- if (fru_data == NULL) { +- lprintf(LOG_ERR, " Out of memory!"); +- return; +- } +- +- memset(fru_data, 0, fru->size + 1); +- +- do { +- h = (struct fru_multirec_header *) (fru_data + i); +- +- // read area in (at most) FRU_MULTIREC_CHUNK_SIZE bytes at a time +- if ((last_off < (i + sizeof(*h))) || (last_off < (i + h->len))) +- { +- len = fru->size - last_off; +- if (len > FRU_MULTIREC_CHUNK_SIZE) +- len = FRU_MULTIREC_CHUNK_SIZE; +- +- if (read_fru_area(intf, fru, id, last_off, len, fru_data) < 0) +- break; +- +- last_off += len; +- } +- +- //printf("Bloc Numb : %i\n", counter); +- printf("Bloc Start: %i\n", i); +- printf("Bloc Size : %i\n", h->len); +- printf("\n"); +- +- i += h->len + sizeof (struct fru_multirec_header); +- } while (!(h->format & 0x80)); +- +- i = offset; +- do { +- h = (struct fru_multirec_header *) (fru_data + i); +- +- printf("Bloc Start: %i\n", i); +- printf("Bloc Size : %i\n", h->len); +- printf("\n"); +- +- i += h->len + sizeof (struct fru_multirec_header); +- } while (!(h->format & 0x80)); +- +- lprintf(LOG_DEBUG ,"Multi-Record area ends at: %i (%xh)",i,i); +- +- free(fru_data); +- fru_data = NULL; +-} +- +- + /* fru_area_print_chassis - Print FRU Chassis Area + * + * @intf: ipmi interface +@@ -959,7 +899,7 @@ + /* read any extra fields */ + while ((fru_data[i] != 0xc1) && (i < fru_len)) + { +- int j = i; ++ uint32_t j = i; + fru_area = get_fru_area_str(fru_data, &i); + if (fru_area != NULL) { + if (strlen(fru_area) > 0) { +@@ -1085,7 +1025,7 @@ + /* read any extra fields */ + while ((fru_data[i] != 0xc1) && (i < fru_len)) + { +- int j = i; ++ uint32_t j = i; + fru_area = get_fru_area_str(fru_data, &i); + if (fru_area != NULL) { + if (strlen(fru_area) > 0) { +@@ -1220,7 +1160,7 @@ + /* read any extra fields */ + while ((fru_data[i] != 0xc1) && (i < fru_len)) + { +- int j = i; ++ uint32_t j = i; + fru_area = get_fru_area_str(fru_data, &i); + if (fru_area != NULL) { + if (strlen(fru_area) > 0) { +@@ -1453,7 +1393,7 @@ + } + + if( answer == 'y' || answer == 'Y' ){ +- int i; ++ size_t i; + unsigned int *holder; + + holder = malloc(len); +@@ -1582,6 +1522,9 @@ + int offset = start; + offset += sizeof(struct fru_multirec_oem_header); + ++ (void) len; ++ (void) h; ++ + if(!badParams){ + /* the 'OEM' field is already checked in caller */ + if( argc > OEM_KONTRON_SUBCOMMAND_ARG_POS ){ +@@ -1867,18 +1810,17 @@ + + uint8_t record_checksum =0; + uint8_t header_checksum =0; +- int index; + + lprintf(LOG_DEBUG,"Initial record checksum : %x",h->record_checksum); + lprintf(LOG_DEBUG,"Initial header checksum : %x",h->header_checksum); +- for(index=0;indexrecord_checksum = ~record_checksum + 1; + + +- for(index=0;index<(sizeof(struct fru_multirec_header) -1);index++){ ++ for(size_t index=0;index<(sizeof(struct fru_multirec_header) -1);index++){ + uint8_t data= *( (uint8_t *)h+ index); + header_checksum+=data; + } +@@ -1984,18 +1926,17 @@ + + uint8_t record_checksum =0; + uint8_t header_checksum =0; +- int index; + + lprintf(LOG_DEBUG,"Initial record checksum : %x",h->record_checksum); + lprintf(LOG_DEBUG,"Initial header checksum : %x",h->header_checksum); +- for(index=0;indexrecord_checksum = ~record_checksum + 1; + + +- for(index=0;index<(sizeof(struct fru_multirec_header) -1);index++){ ++ for(size_t index=0;index<(sizeof(struct fru_multirec_header) -1);index++){ + uint8_t data= *( (uint8_t *)h+ index); + header_checksum+=data; + } +@@ -2259,10 +2200,9 @@ + guid_count = fru_data[offset++]; + printf(" GUID count: %2d\n", guid_count); + for (i = 0 ; i < guid_count; i++ ) { +- int j; + printf(" GUID [%2d]: 0x", i); + +- for (j=0; j < sizeof(struct fru_picmgext_guid); ++ for (size_t j=0; j < sizeof(struct fru_picmgext_guid); + j++) { + printf("%02x", fru_data[offset+j]); + } +@@ -2505,9 +2445,8 @@ + guid_count = fru_data[offset]; + printf(" GUID count: %2d\n", guid_count); + for (i = 0 ; i < guid_count; i++) { +- int j; + printf(" GUID %2d: ", i); +- for (j=0; j < sizeof(struct fru_picmgext_guid); ++ for (size_t j=0; j < sizeof(struct fru_picmgext_guid); + j++) { + printf("%02x", fru_data[offset+j]); + offset += sizeof(struct fru_picmgext_guid); +@@ -2818,7 +2757,7 @@ + (feature > 1) & 1, + (feature&1)?"Source":"Receiver"); + printf(" Family: 0x%02x - AccLVL: 0x%02x\n", family, accuracy); +- printf(" FRQ: %-9ld - min: %-9ld - max: %-9ld\n", ++ printf(" FRQ: %-9u - min: %-9u - max: %-9u\n", + freq, min_freq, max_freq); + } + printf("\n"); +@@ -3835,6 +3774,8 @@ + } + + /* Retreive length */ ++#if 0 ++ /* The if statements here are never true -Wtautological-compare */ + if (((header.offset.internal * 8) > (header.offset.internal * 8)) && + ((header.offset.internal * 8) < end)) + end = (header.offset.internal * 8); +@@ -3850,6 +3791,7 @@ + if (((header.offset.product * 8) > (header.offset.product * 8)) && + ((header.offset.product * 8) < end)) + end = (header.offset.product * 8); ++#endif + + *pSize = end - (header.offset.multi * 8); + *pOffset = (header.offset.multi * 8); +@@ -4022,6 +3964,8 @@ + end = pFruInfo->size; + + /* Retreive length */ ++#if 0 ++ /* The if statements here are never true -Wtautological-compare */ + if (((header.offset.internal * 8) > (header.offset.internal * 8)) && + ((header.offset.internal * 8) < end)) + end = (header.offset.internal * 8); +@@ -4037,6 +3981,7 @@ + if (((header.offset.product * 8) > (header.offset.product * 8)) && + ((header.offset.product * 8) < end)) + end = (header.offset.product * 8); ++#endif + + *pRetSize = end; + *pRetLocation = 8 * header.offset.multi; +@@ -4651,7 +4596,6 @@ + struct fru_header header; + uint8_t msg_data[4]; + uint8_t checksum; +- int i = 0; + int rc = 1; + uint8_t *fru_data = NULL; + uint8_t *fru_area = NULL; +@@ -4780,7 +4724,7 @@ + f_index= f_index - 0x30; + + /*Seek to field index */ +- for (i=0; i <= f_index; i++) { ++ for (uint8_t i=0; i <= f_index; i++) { + fru_field_offset_tmp = fru_field_offset; + if (fru_area != NULL) { + free(fru_area); +@@ -4803,7 +4747,7 @@ + + checksum = 0; + /* Calculate Header Checksum */ +- for (i = 0; i < fru_section_len - 1; i++) ++ for (uint32_t i = 0; i < fru_section_len - 1; i++) + { + checksum += fru_data[i]; + } +@@ -4986,7 +4930,7 @@ + else + break; + } +- num_byte_change = strlen(f_string) - strlen(fru_area); ++ num_byte_change = strlen(f_string) - strlen((const char *)fru_area); + + #ifdef DBG_RESIZE_FRU + printf("Padding Length: %u\n", padding_len); +@@ -5107,7 +5051,7 @@ + remaining_offset, + ((header.offset.product) * 8) + product_len_new + ); +- if(((header.offset.product * 8) + product_len_new - remaining_offset) < 0) ++ if(header.offset.product * 8 + product_len_new < remaining_offset) + { + memcpy( + fru_data_new + (header.offset.product * 8) + product_len_new, +@@ -5152,12 +5096,12 @@ + memcpy((fru_data_new + fru_field_offset_tmp + 1 + + strlen(f_string)), + (fru_data_old + fru_field_offset_tmp + 1 + +- strlen(fru_area)), ++ strlen((const char *)fru_area)), + ((fru_data_old + header_offset + fru_section_len - 1) - + (fru_data_old + fru_field_offset_tmp + strlen(f_string) + 1))); + + /* Add Padding if required */ +- for(counter = 0; counter < padding_len; counter ++) ++ for(counter = 0; counter < (uint32_t)padding_len; counter ++) + { + *(fru_data_new + header_offset + fru_section_len - 1 - + padding_len + counter) = 0; +diff -ruN a/src/plugins/serial/serial_basic.c b/src/plugins/serial/serial_basic.c +--- a/src/plugins/serial/serial_basic.c 2016-07-31 06:52:40.000000000 +0000 ++++ b/src/plugins/serial/serial_basic.c 2024-11-04 07:51:21.030044706 +0000 +@@ -33,9 +33,7 @@ + + /* Serial Interface, Basic Mode plugin. */ + +-#if defined HAVE_ALLOCA_H + #include +-#endif + #include + #include + #include +@@ -150,8 +148,8 @@ + * Table of supported baud rates + */ + static const struct { +- int baudinit; +- int baudrate; ++ unsigned baudinit; ++ unsigned baudrate; + } rates[] = { + { B2400, 2400 }, + { B9600, 9600 }, +@@ -203,7 +201,7 @@ + struct termios ti; + unsigned int rate = 9600; + char *p; +- int i; ++ size_t i; + + if (!intf->devfile) { + lprintf(LOG_ERR, "Serial device is not specified"); +@@ -582,7 +580,7 @@ + rv = serial_bm_parse_buffer(recv_ctx->buffer, + recv_ctx->buffer_size, &parse_ctx); + +- if (rv < recv_ctx->buffer_size) { ++ if (rv < (int)recv_ctx->buffer_size) { + /* move non-parsed part of the buffer to the beginning */ + memmove(recv_ctx->buffer, recv_ctx->buffer + rv, + recv_ctx->buffer_size - rv); +@@ -613,7 +611,7 @@ + uint8_t * data = msg, seq; + struct ipmb_msg_hdr * hdr = (struct ipmb_msg_hdr *) msg; + struct ipmi_send_message_rq * inner_rq = NULL, * outer_rq = NULL; +- int bridging_level; ++ size_t bridging_level; + + /* acquire bridging level */ + if (intf->target_addr && intf->target_addr != intf->my_addr) { +@@ -831,6 +829,7 @@ + clock_t start, tm; + int rv, netFn, rqSeq; + ++ (void) max_len; + start = clock(); + + do { +@@ -885,7 +884,7 @@ + tm = clock() - start; + + tm /= CLOCKS_PER_SEC; +- } while (tm < intf->ssn_params.timeout); ++ } while (tm < (clock_t)intf->ssn_params.timeout); + + return 0; + } +diff -ruN a/src/plugins/serial/serial_terminal.c b/src/plugins/serial/serial_terminal.c +--- a/src/plugins/serial/serial_terminal.c 2016-06-08 19:30:53.000000000 +0000 ++++ b/src/plugins/serial/serial_terminal.c 2024-11-04 07:51:42.760201355 +0000 +@@ -33,9 +33,7 @@ + + /* Serial Interface, Terminal Mode plugin. */ + +-#if defined HAVE_ALLOCA_H + #include +-#endif + #include + #include + #include +@@ -127,8 +125,8 @@ + * Table of supported baud rates + */ + static const struct { +- int baudinit; +- int baudrate; ++ unsigned baudinit; ++ unsigned baudrate; + } rates[] = { + { B2400, 2400 }, + { B9600, 9600 }, +@@ -150,7 +148,7 @@ + struct termios ti; + unsigned int rate = 9600; + char *p; +- int i; ++ size_t i; + + if (!intf->devfile) { + lprintf(LOG_ERR, "Serial device is not specified"); +@@ -474,7 +472,7 @@ + struct serial_term_hdr * term_hdr = (struct serial_term_hdr *) msg; + struct ipmi_send_message_rq * outer_rq = NULL; + struct ipmi_send_message_rq * inner_rq = NULL; +- int bridging_level; ++ size_t bridging_level; + + /* acquire bridging level */ + if (intf->target_addr && intf->target_addr != intf->my_addr) { +@@ -636,7 +634,7 @@ + + /* body */ + for (i = 0; i < msg_len; i++) { +- buf += sprintf( buf, "%02x", msg[i]); ++ buf += sprintf((char *)buf, "%02x", msg[i]); + } + + /* stop character */ +@@ -728,6 +726,7 @@ + clock_t start, tm; + int rv, netFn, rqSeq; + ++ (void) max_len; + start = clock(); + + do { +@@ -774,7 +773,7 @@ + tm = clock() - start; + + tm /= CLOCKS_PER_SEC; +- } while (tm < intf->ssn_params.timeout); ++ } while (tm < (clock_t)intf->ssn_params.timeout); + + return 0; + } From 1dbfc118b6d0ae6e7eb5901cb7b3e87df471c642 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Mon, 4 Nov 2024 08:46:11 +0000 Subject: [PATCH 07/10] mdb_v8 update for gcc 14 --- mdb_v8/Makefile | 6 ++++++ mdb_v8/Patches/gcc14.patch | 11 +++++++++++ 2 files changed, 17 insertions(+) create mode 100644 mdb_v8/Patches/gcc14.patch diff --git a/mdb_v8/Makefile b/mdb_v8/Makefile index deb6d77c..f248b42e 100644 --- a/mdb_v8/Makefile +++ b/mdb_v8/Makefile @@ -28,6 +28,8 @@ VER = mdb_v8-1.4.3 include ../Makefile.defs include ../Makefile.targ +PATCHES = Patches/* + CLEANFILES += .unpack CTF_LIBS = $(VER)/build/ia32/mdb_v8.so \ @@ -66,5 +68,9 @@ $(VER)/GNUMakefile: $(VER).tar.gz -rm -rf $(VER) mkdir -p .unpack gtar x -C .unpack -z --no-same-owner -f $(VER).tar.gz + for p in $(PATCHES); do \ + echo "Applying $$p"; \ + $(GPATCH) -d .unpack/$(VER) -p$(PATCHSTRIP) < "$$p" || exit 1; \ + done mv -f .unpack/$(VER) $(VER) -rmdir .unpack diff --git a/mdb_v8/Patches/gcc14.patch b/mdb_v8/Patches/gcc14.patch new file mode 100644 index 00000000..467faa73 --- /dev/null +++ b/mdb_v8/Patches/gcc14.patch @@ -0,0 +1,11 @@ +--- a/src/mdb_v8.c 2021-11-18 04:24:28.000000000 +0000 ++++ b/src/mdb_v8.c 2024-11-04 08:42:27.895692677 +0000 +@@ -4628,7 +4628,7 @@ + if (read_heap_maybesmi(&nargs, funcinfop, + V8_OFF_SHAREDFUNCTIONINFO_LENGTH) == 0) { + uintptr_t argptr; +- char arg[10]; ++ char arg[25]; + + if (mdb_vread(&argptr, sizeof (argptr), + fptr + V8_OFF_FP_ARGS + nargs * sizeof (uintptr_t)) != -1 && From 88a61d1b3693ca1f5fe3282dc5a7fbeaac81a043 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Mon, 4 Nov 2024 19:05:26 +0000 Subject: [PATCH 08/10] ntp update for gcc 14 --- ntp/Patches/gcc14.patch | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 ntp/Patches/gcc14.patch diff --git a/ntp/Patches/gcc14.patch b/ntp/Patches/gcc14.patch new file mode 100644 index 00000000..7e316779 --- /dev/null +++ b/ntp/Patches/gcc14.patch @@ -0,0 +1,22 @@ +--- lib/isc/unix/ifiter_ioctl.c_orig 2015-03-28 21:21:26.000000000 +0000 ++++ lib/isc/unix/ifiter_ioctl.c 2024-11-04 19:12:34.891744598 +0000 +@@ -557,7 +557,7 @@ + memcpy(&lifreq.lifr_addr, &iter->current.address.type.in6, + sizeof(iter->current.address.type.in6)); + +- if (isc_ioctl(iter->socket, SIOCGLIFADDR, &lifreq) < 0) { ++ if (isc_ioctl(iter->socket, SIOCGLIFADDR, (char *)&lifreq) < 0) { + isc__strerror(errno, strbuf, sizeof(strbuf)); + UNEXPECTED_ERROR(__FILE__, __LINE__, + "%s: getting interface address: %s", +--- sntp/m4/openldap-thread-check.m4 2015-09-21 08:06:08.000000000 +0000 ++++ sntp/m4/openldap-thread-check.m4 2024-11-04 21:24:51.168165279 +0000 +@@ -265,7 +265,7 @@ + #ifndef NULL + #define NULL (void*)0 + #endif +-]], [[pthread_detach(NULL);]])],[ol_cv_func_pthread_detach=yes],[ol_cv_func_pthread_detach=no]) ++]], [[pthread_detach(0);]])],[ol_cv_func_pthread_detach=yes],[ol_cv_func_pthread_detach=no]) + ]) + + if test $ol_cv_func_pthread_detach = no ; then From e9278f09fada3b300b60c5b89353c7e79820c7d5 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Mon, 4 Nov 2024 21:46:44 +0000 Subject: [PATCH 09/10] openldap update for gcc 14 --- openldap/Patches/gcc14.patch | 44 ++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 openldap/Patches/gcc14.patch diff --git a/openldap/Patches/gcc14.patch b/openldap/Patches/gcc14.patch new file mode 100644 index 00000000..44e5366e --- /dev/null +++ b/openldap/Patches/gcc14.patch @@ -0,0 +1,44 @@ +--- a/configure 2023-02-08 18:49:18.000000000 +0000 ++++ b/configure 2024-11-04 22:00:14.208009078 +0000 +@@ -16651,6 +16651,8 @@ + #include + #include + static char *pattern, *string; ++ ++int + main() + { + int rc; +@@ -21024,7 +21026,7 @@ + int + main () + { +-pthread_detach(NULL); ++pthread_detach(0); + ; + return 0; + } +--- a/libraries/libldap/thr_thr.c 2023-02-08 18:49:18.000000000 +0000 ++++ b/libraries/libldap/thr_thr.c 2024-11-04 22:09:56.555660450 +0000 +@@ -22,6 +22,8 @@ + #define LDAP_THREAD_IMPLEMENTATION + #include "ldap_thr_debug.h" /* May rename the symbols defined below */ + ++#include ++ + /******************* + * * + * Solaris Threads * +--- a/libraries/libldap/thr_posix.c 2023-02-08 18:49:18.000000000 +0000 ++++ b/libraries/libldap/thr_posix.c 2024-11-04 22:19:27.888942926 +0000 +@@ -39,6 +39,10 @@ + #include "ldap_thr_debug.h" /* May rename the symbols defined below */ + #include /* For pthread_kill() */ + ++#if defined(HAVE_THR_YIELD) ++#include ++#endif ++ + extern int ldap_int_stackguard; + + #if HAVE_PTHREADS < 6 From 05f7007ee270be01404d0b25b8534a25b78a6c4b Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Mon, 4 Nov 2024 23:05:21 +0000 Subject: [PATCH 10/10] openlldp update for gcc 14 --- openlldp/Patches/openlldp-smartos.diff | 101 ++++++++++++++++++++----- 1 file changed, 82 insertions(+), 19 deletions(-) diff --git a/openlldp/Patches/openlldp-smartos.diff b/openlldp/Patches/openlldp-smartos.diff index 95b53c5d..d4eb638e 100644 --- a/openlldp/Patches/openlldp-smartos.diff +++ b/openlldp/Patches/openlldp-smartos.diff @@ -3628,25 +3628,6 @@ diff -urN openlldp-0.4alpha/src/lldp_main.c openlldp-0.4alpha-32/src/lldp_main.c } void cleanupLLDP(struct lldp_port *lldp_port) { -diff -urN openlldp-0.4alpha/src/lldp_neighbor.c openlldp-0.4alpha-32/src/lldp_neighbor.c ---- openlldp-0.4alpha/src/lldp_neighbor.c 2010-06-08 05:06:29.000000000 +0000 -+++ openlldp-0.4alpha-32/src/lldp_neighbor.c 2013-06-07 20:38:13.752276214 +0000 -@@ -77,6 +77,7 @@ - debug_printf(DEBUG_NORMAL, "gethostname() failed! retval = %d.\n", retval); - } - -+#ifdef linux - strcat(lldp_systemname, "."); - - retval = getdomainname(&lldp_systemname[strlen(lldp_systemname)], 255 - strlen(lldp_systemname)); -@@ -85,6 +86,7 @@ - { - debug_printf(DEBUG_NORMAL, "getdomainname() failed! retval = %d.\n", retval); - } -+#endif - - debug_printf(DEBUG_NORMAL, "lldp_systemname: %s\n", lldp_systemname); - diff -urN openlldp-0.4alpha/src/lldp_port.h openlldp-0.4alpha-32/src/lldp_port.h --- openlldp-0.4alpha/src/lldp_port.h 2010-06-08 05:06:29.000000000 +0000 +++ openlldp-0.4alpha-32/src/lldp_port.h 2013-06-07 20:32:54.322527401 +0000 @@ -4261,3 +4242,85 @@ diff -urN openlldp-0.4alpha/src/platform/Makefile.in openlldp-0.4alpha-32/src/pl maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am +--- openlldp-0.4alpha/src/lldp_neighbor.c 2010-06-08 05:06:29.000000000 +0000 ++++ openlldp-0.4alpha-32/src/lldp_neighbor.c 2024-11-04 22:44:35.026005806 +0000 +@@ -23,6 +23,7 @@ + #include + + #include ++#include + + #include "lldp_port.h" + #include "lldp_debug.h" +@@ -77,6 +78,7 @@ + debug_printf(DEBUG_NORMAL, "gethostname() failed! retval = %d.\n", retval); + } + ++#ifdef linux + strcat(lldp_systemname, "."); + + retval = getdomainname(&lldp_systemname[strlen(lldp_systemname)], 255 - strlen(lldp_systemname)); +@@ -85,6 +87,7 @@ + { + debug_printf(DEBUG_NORMAL, "getdomainname() failed! retval = %d.\n", retval); + } ++#endif + + debug_printf(DEBUG_NORMAL, "lldp_systemname: %s\n", lldp_systemname); + +@@ -118,7 +121,7 @@ + memset(tmp_buffer, 0x0, 2048); + sprintf(buffer, "Interface '%s' has ", lldp_port->if_name); + +- strncat(result, buffer, 2048); ++ strncat(result, buffer, 2047); + + msap_cache = lldp_port->msap_cache; + +@@ -130,7 +133,7 @@ + + sprintf(tmp_buffer, "Neighbor %d:\n", neighbor_count); + +- strncat(info_buffer, tmp_buffer, 2048); ++ strncat(info_buffer, tmp_buffer, 2047); + + memset(tmp_buffer, 0x0, 2048); + +@@ -145,7 +148,7 @@ + if(tlv_name != NULL) { + sprintf(tmp_buffer, "\t%s: ", tlv_name); + +- strncat(info_buffer, tmp_buffer, 2048); ++ strncat(info_buffer, tmp_buffer, 2047); + + //free(tlv_name); + //tlv_name = NULL; +@@ -157,7 +160,7 @@ + if(tlv_subtype != NULL) { + sprintf(tmp_buffer, "\t%s\n", tlv_subtype); + +- strncat(info_buffer, tmp_buffer, 2048); ++ strncat(info_buffer, tmp_buffer, 2047); + + memset(tmp_buffer, 0x0, 2048); + +@@ -166,7 +169,7 @@ + } + } else { + sprintf(tmp_buffer, "\t\tUnknown TLV Type (%d)\n", tlv_list->tlv->type); +- strncat(info_buffer, tmp_buffer, 2048); ++ strncat(info_buffer, tmp_buffer, 2047); + } + + } else { +@@ -184,8 +187,8 @@ + memset(buffer, 0x0, 2048); + + sprintf(buffer, "%d LLDP Neighbors: \n\n", neighbor_count); +- strncat(result, buffer, 2048); +- strncat(result, info_buffer, 2048); ++ strncat(result, buffer, 2047); ++ strncat(result, info_buffer, 2047); + + lldp_port = lldp_port->next; + }