Skip to contentSkip to conversation

gcc: backport a fix for building with gcc-16

PATCH New [email protected] 1 participant 4 messages Apr 10

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 gcc: backport a fix for building with gcc-16

From: Martin Jansa <[email protected]>

Fixes:
https://errors.yoctoproject.org/Errors/Details/905192/
when building on host with gcc-16

Compared to 15.2 used in whinlatter this needs 2 additional backports.

---
 meta/recipes-devtools/gcc/gcc-13.4.inc        |   3 +
 ...dy-Make-it-buildable-by-C-11-to-C-26.patch | 257 ++++++++++++++++++
 ...build-Remove-INCLUDE_MEMORY-PR117737.patch |  46 ++++
 ...am-include-above-safe-ctype.h-PR1177.patch |  54 ++++
 4 files changed, 360 insertions(+)
 create mode 100644 meta/recipes-devtools/gcc/gcc/0028-libcody-Make-it-buildable-by-C-11-to-C-26.patch
 create mode 100644 meta/recipes-devtools/gcc/gcc/0029-build-Remove-INCLUDE_MEMORY-PR117737.patch
 create mode 100644 meta/recipes-devtools/gcc/gcc/0030-build-Move-sstream-include-above-safe-ctype.h-PR1177.patch
meta/recipes-devtools/gcc/gcc-13.4.inc +3 -0
index eefae13530..2017c44498 100644
@@ -66,6 +66,9 @@ SRC_URI = "${BASEURI} \
            file://0024-Avoid-hardcoded-build-paths-into-ppc-libgcc.patch \
            file://0025-gcc-testsuite-tweaks-for-mips-OE.patch \
            file://0027-Fix-gcc-vect-module-testcases.patch \
+           file://0028-libcody-Make-it-buildable-by-C-11-to-C-26.patch \
+           file://0029-build-Remove-INCLUDE_MEMORY-PR117737.patch \
+           file://0030-build-Move-sstream-include-above-safe-ctype.h-PR1177.patch \
 "
 SRC_URI[sha256sum] = "9c4ce6dbb040568fdc545588ac03c5cbc95a8dbf0c7aa490170843afb59ca8f5"
 
meta/recipes-devtools/gcc/gcc/0028-libcody-Make-it-buildable-by-C-11-to-C-26.patch new file +257 -0

257 lines not on this page · raw message

meta/recipes-devtools/gcc/gcc/0029-build-Remove-INCLUDE_MEMORY-PR117737.patch new file +46 -0

46 lines not on this page · raw message

meta/recipes-devtools/gcc/gcc/0030-build-Move-sstream-include-above-safe-ctype.h-PR1177.patch new file +54 -0

54 lines not on this page · raw message

#1 lore raw

PATCH 2/4 libxcrypt: avoid discarded-qualifiers build failure with glibc 2.43

From: Hemanth Kumar M D <[email protected]>

With the glibc 2.43 upgrade, building nativesdk-libxcrypt triggers a -Wdiscarded-qualifiers warning in crypt-gost-yescrypt.c and crypt-sm3-yescrypt.c which becomes a build failure due to -Werror.

---
 meta/recipes-core/libxcrypt/libxcrypt.inc | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-core/libxcrypt/libxcrypt.inc +1 -0
index ee6875aa05..11ec87c14e 100644
@@ -23,6 +23,7 @@ S = "${WORKDIR}/git"
 BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}"
 TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${includedir} -Wno-error"
 CPPFLAGS:append:class-nativesdk = " -Wno-error"
+CFLAGS:append:class-nativesdk = " -Wno-error=discarded-qualifiers"
 
 API = "--disable-obsolete-api"
 EXTRA_OECONF += "${API}"
#2 lore raw

PATCH 3/4 libxcrypt: Fix build wrt C23 support

In reply to [email protected]

From: Khem Raj <[email protected]>

latest glibc has better C23 support and exposes this problem

Fixes following errors seen in nativesdk-libxcrypt

| ../sources/libxcrypt-4.5.2/lib/crypt-sm3-yescrypt.c:139:9: error: initializing 'char *' with an expression of type 'const char *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
|   139 |   char *hptr = strchr ((const char *) intbuf->retval + 3, '$');
|       |         ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| 6 errors generated.

Compared to wrynose remove lib/crypt-sm3-yescrypt.c change, because the file doesn't exist in the version used in scarthgap, it was failing only in lib/crypt-gost-yescrypt.c

---
 ...24d6e87aeae631bc0a7bb1ba983cf8def4de.patch | 29 +++++++++++++++++++
 meta/recipes-core/libxcrypt/libxcrypt.inc     |  4 ++-
 2 files changed, 32 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-core/libxcrypt/files/174c24d6e87aeae631bc0a7bb1ba983cf8def4de.patch
meta/recipes-core/libxcrypt/files/174c24d6e87aeae631bc0a7bb1ba983cf8def4de.patch new file +29 -0
new file mode 100644
index 0000000000..456788e585
@@ -0,0 +1,29 @@
+From 174c24d6e87aeae631bc0a7bb1ba983cf8def4de Mon Sep 17 00:00:00 2001
+From: Stanislav Zidek <[email protected]>
+Date: Wed, 10 Dec 2025 14:03:54 +0100
+Subject: [PATCH] fix -Werror=discarded-qualifiers
+
+On Fedora rawhide (to be Fedora 44), gcc became more strict
+wrt. const-ness.
+
+Upstream-Status: Backport [https://github.com/besser82/libxcrypt/pull/220 without lib/crypt-sm3-yescrypt.c]
+Signed-off-by: Khem Raj <[email protected]>
+
+---
+ lib/crypt-gost-yescrypt.c | 2 +-
+ lib/crypt-sm3-yescrypt.c  | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/crypt-gost-yescrypt.c b/lib/crypt-gost-yescrypt.c
+index 190ae94b..e9dc7e80 100644
+--- a/lib/crypt-gost-yescrypt.c
++++ b/lib/crypt-gost-yescrypt.c
+@@ -131,7 +131,7 @@ crypt_gost_yescrypt_rn (const char *phrase, size_t phr_size,
+   intbuf->outbuf[1] = 'g';
+
+   /* extract yescrypt output from "$y$param$salt$output" */
+-  char *hptr = strchr ((const char *) intbuf->retval + 3, '$');
++  char *hptr = strchr ((char *) intbuf->retval + 3, '$');
+   if (!hptr)
+     {
+       errno = EINVAL;
meta/recipes-core/libxcrypt/libxcrypt.inc +3 -1
index 11ec87c14e..4e240f4d14 100644
@@ -9,7 +9,9 @@ LIC_FILES_CHKSUM = "file://LICENSING;md5=c0a30e2b1502c55a7f37e412cd6c6a4b \
 
 inherit autotools pkgconfig
 
-SRC_URI = "git://github.com/besser82/libxcrypt.git;branch=${SRCBRANCH};protocol=https"
+SRC_URI = "git://github.com/besser82/libxcrypt.git;branch=${SRCBRANCH};protocol=https \
+           file://174c24d6e87aeae631bc0a7bb1ba983cf8def4de.patch \
+"
 SRCREV = "f531a36aa916a22ef2ce7d270ba381e264250cbf"
 SRCBRANCH ?= "master"
 
#3 lore raw

PATCH 4/4 libxcrypt: Use configure knob to disable warnings as errors

In reply to [email protected]

From: Khem Raj <[email protected]>

Passing Wno-error via environment flags for target and nativesdk is intended but is not effective due to command line ordering and as a result some patches have been added to disable particular kind of warning as error. Given the scenario, warnings as errors should be disabled for all builds, this makes it portable across hosts and across compilers ( gcc, clang ) and glibc versions.

---
 meta/recipes-core/libxcrypt/libxcrypt.inc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
meta/recipes-core/libxcrypt/libxcrypt.inc +3 -3
index 4e240f4d14..25c4fde813 100644
@@ -23,9 +23,9 @@ PROVIDES = "virtual/crypt"
 S = "${WORKDIR}/git"
 
 BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}"
-TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${includedir} -Wno-error"
-CPPFLAGS:append:class-nativesdk = " -Wno-error"
-CFLAGS:append:class-nativesdk = " -Wno-error=discarded-qualifiers"
+TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${includedir}"
+
+EXTRA_OECONF += "--disable-werror"
 
 API = "--disable-obsolete-api"
 EXTRA_OECONF += "${API}"