bit7z: Fix build with clang
PATCH 1/7 bit7z: Fix build with clang
The 4.1.0 upgrade added two CXXFLAGS that only work with GCC, which breaks the clang build of the testsuite (BIT7Z_WARNINGS_AS_ERRORS defaults to BIT7Z_BUILD_TESTS, so -Werror is on whenever ptest is enabled).
error: unknown warning option '-Wno-sfinae-incomplete'; did you mean
'-Wno-delete-incomplete'? [-Werror,-Wunknown-warning-option]
-Wsfinae-incomplete is a GCC 15+ diagnostic that clang does not have, so only pass it when building with GCC.
cpm_cache/ghc_filesystem/include/ghc/filesystem.hpp:4090:41: error:
implicit conversion changes signedness: 'int' to 'mode_t' (aka 'unsigned int') [-Werror,-Wsign-conversion]
Upstream declares the ghc::filesystem include directory as a SYSTEM one (target_include_directories(ghc_filesystem SYSTEM INTERFACE ...) in cmake/Dependencies.cmake), which keeps warnings from that header quiet. Passing it as a plain -I undoes that, so use -isystem instead.
There is nothing to upgrade to here, 4.1.0 is the latest release and upstream master is a single documentation commit ahead of it.
--- meta-oe/recipes-extended/7zip/bit7z_4.1.0.bb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
meta-oe/recipes-extended/7zip/bit7z_4.1.0.bb +9 -2
@@ -35,8 +35,15 @@ DEPENDS = "7zip" EXTRA_OECMAKE += "-DBIT7Z_CUSTOM_7ZIP_PATH=${STAGING_INCDIR}/7zip" -CXXFLAGS:append = " -Wno-error=array-bounds -Wno-sfinae-incomplete" -CXXFLAGS:append = " -I${B}/cpm_cache/ghc_filesystem/include" +CXXFLAGS:append = " -Wno-error=array-bounds" +# -Wsfinae-incomplete is a GCC 15+ diagnostic, clang does not know the option +# and errors out on it because the testsuite build enables -Werror. +CXXFLAGS:append:toolchain-gcc = " -Wno-sfinae-incomplete" +# Use -isystem, the same way upstream declares this include directory +# (target_include_directories(ghc_filesystem SYSTEM INTERFACE ...) in +# cmake/Dependencies.cmake). With a plain -I the warnings coming out of +# ghc/filesystem.hpp are reported and the testsuite build enables -Werror. +CXXFLAGS:append = " -isystem ${B}/cpm_cache/ghc_filesystem/include" PACKAGECONFIG ??= "${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)}" PACKAGECONFIG[tests] = " \
PATCH 2/7 gnome-disk-utility: fix build without x11 in DISTRO_FEATURES
gnome-disk-utility 46.1 fails to build on a wayland-only distro configuration (no x11 in DISTRO_FEATURES) for three separate reasons, all of them latent X11 assumptions in the GTK3 code line.
do_configure fails first:
Run-time dependency libcanberra-gtk3 found: NO (tried pkg-config) meson.build:75:18: ERROR: Dependency "libcanberra-gtk3" not found
meson.build requires libcanberra-gtk3 unconditionally, but libcanberra's gtk3 support is itself X11-only (its configure.ac does PKG_CHECK_MODULES(GTK3, [gtk+-3.0 ... gdk-3.0 x11]), the sources use gdk_x11_get_xatom_by_name_for_display()/GDK_WINDOW_XID, and libcanberra-gtk3.pc links -lX11), so the meta-oe recipe correctly leaves the gtk3 PACKAGECONFIG off here and the dependency can never be satisfied. Drop it, along with the three ca_gtk_play_for_widget() sound effect call sites; upstream removed libcanberra entirely by the same route after 46.1 was released.
Once that is out of the way do_compile fails on the X11 backend header:
gdupasswordstrengthwidget.c:14:10: fatal error: 'gdk/gdkx.h' file not found gduvolumegrid.c:14:10: fatal error: 'gdk/gdkx.h' file not found gduestimator.c:14:10: fatal error: 'gdk/gdkx.h' file not found
gtk+3 only installs gdk/gdkx.h when its X11 backend is enabled. None of these three files calls any X11-specific GDK API, so the include is simply dead weight and can be dropped.
Neither fix is available upstream for this code line: the GTK4 / libadwaita rewrite deleted or renamed the affected files rather than fixing them, and no in-flight merge request touches the GTK3 sources that 46.1 still builds. 46.1 remains the latest stable release.
AI-Generated: Uses Claude Code
--- ...Drop-the-libcanberra-gtk3-dependency.patch | 122 ++++++++++++++++++ ...s-drop-the-unused-gdk-gdkx.h-include.patch | 68 ++++++++++ .../gnome-disk-utility_46.1.bb | 5 +- 3 files changed, 194 insertions(+), 1 deletion(-) create mode 100644 meta-gnome/dynamic-layers/meta-multimedia/recipes-gnome/gnome-disk-utility/gnome-disk-utility/0001-Drop-the-libcanberra-gtk3-dependency.patch create mode 100644 meta-gnome/dynamic-layers/meta-multimedia/recipes-gnome/gnome-disk-utility/gnome-disk-utility/0002-disks-drop-the-unused-gdk-gdkx.h-include.patch
meta-gnome/dynamic-layers/meta-multimedia/recipes-gnome/gnome-disk-utility/gnome-disk-utility/0001-Drop-the-libcanberra-gtk3-dependency.patch new file +122 -0
@@ -0,0 +1,122 @@ +From: Khem Raj <[email protected]> +Date: Wed, 10 Sep 2026 06:00:00 +0000 +Subject: [PATCH] Drop the libcanberra-gtk3 dependency + +libcanberra-gtk3 links -lX11 and its gtk3 module is built only when +X11 is enabled (configure.ac gates HAVE_GTK3 on `gdk-3.0 x11`), so it +is unavailable on wayland-only distro configurations. That makes +gnome-disk-utility's hard `dependency('libcanberra-gtk3', ...)` fail +at meson configure time there: + + Run-time dependency libcanberra-gtk3 found: NO (tried pkg-config) + ../gnome-disk-utility-46.1/meson.build:75:18: ERROR: Dependency + "libcanberra-gtk3" not found (tried pkg-config) + +Upstream reached the same conclusion and dropped libcanberra +entirely ahead of the GTK4/libadwaita port (GNOME/gnome-disk-utility! +efa67dc5, !ecdd9c37, !ec6d8018), disabling the three sound-effect call +sites and removing the dependency; that work landed after 46.1, the +last stable release, so backport the same, minimal change here rather +than carrying libcanberra-gtk3 as a hard requirement. + +Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/gnome-disk-utility/-/commit/ec6d801899e440245319cdbb06555783b72808d1] +Signed-off-by: Khem Raj <[email protected]> +--- + meson.build | 1 - + src/disks/gducreatediskimagedialog.c | 12 ++++-------- + src/disks/gdurestorediskimagedialog.c | 8 +++----- + src/disks/meson.build | 1 - + 4 files changed, 7 insertions(+), 15 deletions(-) + +diff --git a/meson.build b/meson.build +index 1111111..2222222 100644 +--- a/meson.build ++++ b/meson.build +@@ -72,7 +72,6 @@ dvdread_dep = dependency('dvdread', version: '>= 4.2.0') + gio_unix_dep = dependency('gio-unix-2.0', version: '>= 2.31.0') + gmodule_dep = dependency('gmodule-2.0') + gtk_dep = dependency('gtk+-3.0', version: '>= 3.16.0') +-libcanberra_dep = dependency('libcanberra-gtk3', version: '>= 0.1') + # Keep the version here synchronised with subprojects/libhandy.wrap + libhandy_dep = dependency('libhandy-1', version: '>= 1.5.0', fallback: ['libhandy', 'libhandy_dep']) + liblzma_dep = dependency('liblzma', version: '>= 5.0.5') +diff --git a/src/disks/gducreatediskimagedialog.c b/src/disks/gducreatediskimagedialog.c +index 1111111..2222222 100644 +--- a/src/disks/gducreatediskimagedialog.c ++++ b/src/disks/gducreatediskimagedialog.c +@@ -20,8 +20,6 @@ + #include <sys/ioctl.h> + #include <linux/fs.h> + +-#include <canberra-gtk.h> +- + #include "gduapplication.h" + #include "gduwindow.h" + #include "gducreatediskimagedialog.h" +@@ -304,10 +302,9 @@ play_read_error_sound (DialogData *data) + * CA_PROP_EVENT_DESCRIPTION + */ + sound_message = _("Disk image read error"); +- ca_gtk_play_for_widget (GTK_WIDGET (data->window), 0, +- CA_PROP_EVENT_ID, "dialog-warning", +- CA_PROP_EVENT_DESCRIPTION, sound_message, +- NULL); ++ /* libcanberra-gtk3 is X11-only and unavailable on wayland-only builds; ++ * disabled upstream too (GNOME!ec6d8018) ahead of the GTK4 port. */ ++ (void) sound_message; + } + + /* ---------------------------------------------------------------------------------------------------- */ +@@ -407,10 +404,9 @@ play_complete_sound (DialogData *data) + + /* Translators: A descriptive string for the 'complete' sound, see CA_PROP_EVENT_DESCRIPTION */ + sound_message = _("Disk image copying complete"); +- ca_gtk_play_for_widget (GTK_WIDGET (data->window), 0, +- CA_PROP_EVENT_ID, "complete", +- CA_PROP_EVENT_DESCRIPTION, sound_message, +- NULL); ++ /* libcanberra-gtk3 is X11-only and unavailable on wayland-only builds; ++ * disabled upstream too (GNOME!ec6d8018) ahead of the GTK4 port. */ ++ (void) sound_message; + } + + /* ---------------------------------------------------------------------------------------------------- */ +diff --git a/src/disks/gdurestorediskimagedialog.c b/src/disks/gdurestorediskimagedialog.c +index 1111111..2222222 100644 +--- a/src/disks/gdurestorediskimagedialog.c ++++ b/src/disks/gdurestorediskimagedialog.c +@@ -16,8 +16,6 @@ + #include <sys/ioctl.h> + #include <linux/fs.h> + +-#include <canberra-gtk.h> +- + #include "gduapplication.h" + #include "gduwindow.h" + #include "gdurestorediskimagedialog.h" +@@ -610,10 +608,9 @@ play_complete_sound (DialogData *data) + + /* Translators: A descriptive string for the 'complete' sound, see CA_PROP_EVENT_DESCRIPTION */ + sound_message = _("Disk image copying complete"); +- ca_gtk_play_for_widget (GTK_WIDGET (data->dialog), 0, +- CA_PROP_EVENT_ID, "complete", +- CA_PROP_EVENT_DESCRIPTION, sound_message, +- NULL); ++ /* libcanberra-gtk3 is X11-only and unavailable on wayland-only builds; ++ * disabled upstream too (GNOME!ec6d8018) ahead of the GTK4 port. */ ++ (void) sound_message; + + if (data->inhibit_cookie > 0) + { +diff --git a/src/disks/meson.build b/src/disks/meson.build +index 1111111..2222222 100644 +--- a/src/disks/meson.build ++++ b/src/disks/meson.build +@@ -83,7 +83,6 @@ deps = [ + dvdread_dep, + gio_unix_dep, + gmodule_dep, +- libcanberra_dep, + libgdu_dep, + libhandy_dep, + liblzma_dep,
meta-gnome/dynamic-layers/meta-multimedia/recipes-gnome/gnome-disk-utility/gnome-disk-utility/0002-disks-drop-the-unused-gdk-gdkx.h-include.patch new file +68 -0
68 lines not on this page · raw message
meta-gnome/dynamic-layers/meta-multimedia/recipes-gnome/gnome-disk-utility/gnome-disk-utility_46.1.bb +4 -1
@@ -7,7 +7,6 @@ SECTION = "gnome" DEPENDS = " \ desktop-file-utils-native \ gtk+3 \ - libcanberra \ libdvdread \ libnotify \ libsecret \
@@ -28,6 +27,10 @@ PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" # As soon as elogind is of interest this needs rework: meson option is combo PACKAGECONFIG[systemd] = "-Dlogind=libsystemd,-Dlogind=none,systemd" +SRC_URI += "file://0001-Drop-the-libcanberra-gtk3-dependency.patch \ + file://0002-disks-drop-the-unused-gdk-gdkx.h-include.patch \ +" + SRC_URI[archive.sha256sum] = "c24e9439a04d70bcfae349ca134c7005435fe2b6f452114df878bff0b89bbffe" EXTRA_OEMESON = "-Dman=false"
PATCH 3/7 mutter: only enable desktop OpenGL when x11 is in DISTRO_FEATURES
In reply to Khem Rajmutter fails to configure on a wayland-only distro configuration:
Run-time dependency gl found: NO (tried pkg-config and system) ../sources/mutter-50.4/meson.build:191:11: ERROR: Dependency "gl" not found (tried pkg-config and system)
The recipe enabled the opengl PACKAGECONFIG unconditionally, which passes -Dopengl=true and makes meson require desktop OpenGL:
have_gl = get_option('opengl')
if have_gl
gl_dep = dependency('gl')
Desktop GL is not available here. libGL.so and gl.pc are products of mesa's GLX library - see FILES:libgl-mesa-dev in mesa.inc - and mesa only builds GLX when its x11 PACKAGECONFIG is on, since PACKAGECONFIG[x11] passes -Dglx=disabled when it is off. Without x11 in DISTRO_FEATURES mesa is therefore configured -Dopengl=true -Dglx=disabled -Dplatforms='wayland' and stages only egl.pc, glesv1_cm.pc and glesv2.pc, with no libGL and no gl.pc.
The dependency looked satisfied because mesa PROVIDES virtual/libgl unconditionally, so the virtual/libgl entry in PACKAGECONFIG[opengl] resolves at the bitbake level even though nothing ever lands in the sysroot. mesa also installs the GL/*.h headers regardless of GLX, so meson's 'system' fallback clears the header probe before failing on the missing library.
mutter builds fine against GLESv2 alone - it only errors out if neither GL nor GLES2 is enabled - and egl plus gles2 are already enabled here, which is the usual configuration for a wayland-only compositor. Gate opengl on x11 so it follows the same condition that decides whether desktop GL exists at all; x11 builds are unaffected.
AI-Generated: Uses Claude Code
--- meta-gnome/recipes-gnome/mutter/mutter_50.4.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta-gnome/recipes-gnome/mutter/mutter_50.4.bb +1 -1
@@ -46,7 +46,7 @@ PACKAGECONFIG ??= " \ native-backend \ egl \ gles2 \ - opengl \ + ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'opengl', '', d)} \ fonts \ bash-completion \ gnome-desktop \
PATCH 4/7 wvstreams: fix build with OpenSSL 4
In reply to Khem RajOpenSSL 4.0 breaks the X.509 code in two ways: struct asn1_string_st is opaque, so ASN1_INTEGER / ASN1_OCTET_STRING / ASN1_BIT_STRING / ASN1_TIME can no longer be dereferenced, and X509_get_ext(), X509_EXTENSION_get_data(), X509_get0_pubkey_bitstr(), X509_get_subject_name(), X509_get_issuer_name() and X509_REQ_get_subject_name() all gained const.
Switch to the ASN1_STRING_get0_data() / ASN1_STRING_length() / ASN1_STRING_type() accessors, available since OpenSSL 1.1.0, and propagate const to the locals that only read through those pointers.
Three call sites needed a mutable X509_NAME: they fetched the existing name, edited it in place and installed it again. The getters have no mutable counterpart, so duplicate with X509_NAME_dup(), edit the copy and free it once the setter has taken its own copy, preserving the previous behaviour of merging into the existing DN.
AI-Generated: Uses Claude Code
--- .../0001-crypto-build-against-OpenSSL-4.patch | 265 ++++++++++++++++++ .../wvdial/wvstreams_4.6.1.bb | 1 + 2 files changed, 266 insertions(+) create mode 100644 meta-oe/recipes-connectivity/wvdial/wvstreams/0001-crypto-build-against-OpenSSL-4.patch
meta-oe/recipes-connectivity/wvdial/wvstreams/0001-crypto-build-against-OpenSSL-4.patch new file +265 -0
@@ -0,0 +1,265 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +Date: Wed, 3 Sep 2026 01:30:00 +0000 +Subject: [PATCH] crypto: build against OpenSSL 4 + +OpenSSL 4.0 brings two changes that wvstreams' X.509 code trips over: + + - struct asn1_string_st is opaque, so ASN1_INTEGER / ASN1_OCTET_STRING / + ASN1_BIT_STRING / ASN1_TIME can no longer be dereferenced; + - several getters gained const: X509_get_ext(), X509_EXTENSION_get_data(), + X509_get0_pubkey_bitstr(), X509_get_subject_name(), + X509_get_issuer_name() and X509_REQ_get_subject_name(). + +Use the ASN1_STRING_get0_data() / ASN1_STRING_length() / ASN1_STRING_type() +accessors, which have existed since OpenSSL 1.1.0, and propagate const to +the locals that only ever read through those pointers. + +Three call sites did rely on getting a mutable X509_NAME back: they fetched +the certificate's (or request's) existing name, edited it in place through +set_name_entry() and then installed it again. There is no mutable +counterpart to those getters, so duplicate the name with X509_NAME_dup(), +edit the copy, and free it after the setter has taken its own copy. That +keeps the previous behaviour of merging into the existing DN rather than +starting from an empty one. + +WvX509::set_subject(X509_NAME *) becomes set_subject(const X509_NAME *) so +that wvx509mgr.cc can keep passing X509_REQ_get_subject_name() straight in; +the implementation only forwards to X509_set_subject_name(), which takes a +const pointer. + +set_aki() and WvCRL's constructor used one X509_EXTENSION * for both the +borrowed extension returned by X509_get_ext() and the freshly built one they +own and free, which no longer type checks now that the former is const. Give +the owned extension its own variable. + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <[email protected]> +--- +--- a/include/wvx509.h ++++ b/include/wvx509.h +@@ -161,7 +161,7 @@ + */ + WvString get_subject() const; + void set_subject(WvStringParm name); +- void set_subject(X509_NAME *name); ++ void set_subject(const X509_NAME *name); + + /** + * get and set the serialNumber field of the certificate +--- a/crypto/wvcrl.cc ++++ b/crypto/wvcrl.cc +@@ -56,7 +56,7 @@ + + // most of this copied from wvx509.cc, sigh + ASN1_OCTET_STRING *ikeyid = NULL; +- X509_EXTENSION *ext; ++ const X509_EXTENSION *ext; + int i = X509_get_ext_by_NID(ca.cert, NID_subject_key_identifier, -1); + if ((i >= 0) && (ext = X509_get_ext(ca.cert, i))) + ikeyid = static_cast<ASN1_OCTET_STRING *>(X509V3_EXT_d2i(ext)); +@@ -67,9 +67,10 @@ + akeyid->issuer = NULL; + akeyid->serial = NULL; + akeyid->keyid = ikeyid; +- ext = X509V3_EXT_i2d(NID_authority_key_identifier, 0, akeyid); +- X509_CRL_add_ext(crl, ext, -1); +- X509_EXTENSION_free(ext); ++ X509_EXTENSION *akiext = ++ X509V3_EXT_i2d(NID_authority_key_identifier, 0, akeyid); ++ X509_CRL_add_ext(crl, akiext, -1); ++ X509_EXTENSION_free(akiext); + AUTHORITY_KEYID_free(akeyid); + } + +@@ -169,7 +170,8 @@ + &i, NULL)); + if (aki) + { +- char *tmp = hex_to_string(aki->keyid->data, aki->keyid->length); ++ char *tmp = hex_to_string(ASN1_STRING_get0_data(aki->keyid), ++ ASN1_STRING_length(aki->keyid)); + WvString str(tmp); + + OPENSSL_free(tmp); +--- a/crypto/wvx509.cc ++++ b/crypto/wvx509.cc +@@ -306,11 +306,12 @@ + + X509_REQ_set_pubkey(certreq, pk); + +- name = X509_REQ_get_subject_name(certreq); ++ name = X509_NAME_dup(X509_REQ_get_subject_name(certreq)); + + debug("Creating Certificate request for %s\n", subject); + set_name_entry(name, subject); + X509_REQ_set_subject_name(certreq, name); ++ X509_NAME_free(name); + char *sub_name = X509_NAME_oneline(X509_REQ_get_subject_name(certreq), + 0, 0); + debug("SubjectDN: %s\n", sub_name); +@@ -606,9 +607,10 @@ + { + CHECK_CERT_EXISTS_SET("issuer"); + +- X509_NAME *name = X509_get_issuer_name(cert); ++ X509_NAME *name = X509_NAME_dup(X509_get_issuer_name(cert)); + set_name_entry(name, issuer); + X509_set_issuer_name(cert, name); ++ X509_NAME_free(name); + } + + +@@ -616,7 +618,7 @@ + { + CHECK_CERT_EXISTS_SET("issuer"); + +- X509_NAME *casubj = X509_get_subject_name(cacert.cert); ++ const X509_NAME *casubj = X509_get_subject_name(cacert.cert); + X509_set_issuer_name(cert, casubj); + } + +@@ -636,13 +638,14 @@ + { + CHECK_CERT_EXISTS_SET("subject"); + +- X509_NAME *name = X509_get_subject_name(cert); ++ X509_NAME *name = X509_NAME_dup(X509_get_subject_name(cert)); + set_name_entry(name, subject); + X509_set_subject_name(cert, name); ++ X509_NAME_free(name); + } + + +-void WvX509::set_subject(X509_NAME *name) ++void WvX509::set_subject(const X509_NAME *name) + { + CHECK_CERT_EXISTS_SET("subject"); + +@@ -799,7 +802,8 @@ + ca = constraints->ca; + if (constraints->pathlen) + { +- if ((constraints->pathlen->type == V_ASN1_NEG_INTEGER) || !ca) ++ if ((ASN1_STRING_type(constraints->pathlen) == ++ V_ASN1_NEG_INTEGER) || !ca) + { + debug("Path length type not valid when getting basic " + "constraints.\n"); +@@ -1153,7 +1157,7 @@ + int index = X509_get_ext_by_NID(cert, nid, -1); + if (index >= 0) + { +- X509_EXTENSION *ext = X509_get_ext(cert, index); ++ const X509_EXTENSION *ext = X509_get_ext(cert, index); + + if (ext) + { +@@ -1162,11 +1166,13 @@ + #else + X509V3_EXT_METHOD *method = X509V3_EXT_get(ext); + #endif +- ASN1_OCTET_STRING *ext_data_str = X509_EXTENSION_get_data(ext); ++ const ASN1_OCTET_STRING *ext_data_str = ++ X509_EXTENSION_get_data(ext); + if (!method) + { + WvDynBuf buf; +- buf.put(ext_data_str->data, ext_data_str->length); ++ buf.put(ASN1_STRING_get0_data(ext_data_str), ++ ASN1_STRING_length(ext_data_str)); + retval = buf.getstr(); + } + else +@@ -1177,21 +1183,22 @@ + // even though it's const (at least as of version 0.9.8e). + // gah. + #if OPENSSL_VERSION_NUMBER >= 0x0090800fL +- const unsigned char * ext_value_data = ext_data_str->data; ++ const unsigned char * ext_value_data = ++ ASN1_STRING_get0_data(ext_data_str); + #else + unsigned char *ext_value_data = ext->value->data; + #endif + if (method->it) + { + ext_data = ASN1_item_d2i(NULL, &ext_value_data, +- ext_data_str->length, ++ ASN1_STRING_length(ext_data_str), + ASN1_ITEM_ptr(method->it)); + TRACE("Applied generic conversion!\n"); + } + else + { + ext_data = method->d2i(NULL, &ext_value_data, +- ext_data_str->length); ++ ASN1_STRING_length(ext_data_str)); + TRACE("Applied method specific conversion!\n"); + } + +@@ -1343,7 +1350,7 @@ + } + + +-static time_t ASN1_TIME_to_time_t(ASN1_TIME *t) ++static time_t ASN1_TIME_to_time_t(const ASN1_TIME *t) + { + struct tm newtime; + char *p = NULL; +@@ -1351,7 +1358,7 @@ + memset(&d,'\0',sizeof(d)); + memset(&newtime,'\0',sizeof newtime); + +- if (t->type == V_ASN1_GENERALIZEDTIME) ++ if (ASN1_STRING_type(t) == V_ASN1_GENERALIZEDTIME) + { + // For time values >= 2050, OpenSSL uses + // ASN1_GENERALIZEDTIME - which we'll worry about +@@ -1359,7 +1366,7 @@ + return 0; + } + +- p = (char *)t->data; ++ p = (char *)ASN1_STRING_get0_data(t); + sscanf(p,"%2s%2s%2s%2s%2s%2sZ", d, &d[3], &d[6], &d[9], &d[12], &d[15]); + + int year = strtol(d, (char **)NULL, 10); +@@ -1452,11 +1459,12 @@ + CHECK_CERT_EXISTS_SET("ski"); + + ASN1_OCTET_STRING *oct = ASN1_OCTET_STRING_new(); +- ASN1_BIT_STRING *pk = X509_get0_pubkey_bitstr(cert); ++ const ASN1_BIT_STRING *pk = X509_get0_pubkey_bitstr(cert); + unsigned char pkey_dig[EVP_MAX_MD_SIZE]; + unsigned int diglen; + +- EVP_Digest(pk->data, pk->length, pkey_dig, &diglen, EVP_sha1(), NULL); ++ EVP_Digest(ASN1_STRING_get0_data(pk), ASN1_STRING_length(pk), pkey_dig, ++ &diglen, EVP_sha1(), NULL); + + ASN1_OCTET_STRING_set(oct, pkey_dig, diglen); + X509_EXTENSION *ext = X509V3_EXT_i2d(NID_subject_key_identifier, 0, +@@ -1474,7 +1482,7 @@ + // can't set a meaningful AKI for subordinate certification without the + // parent having an SKI + ASN1_OCTET_STRING *ikeyid = NULL; +- X509_EXTENSION *ext; ++ const X509_EXTENSION *ext; + int i = X509_get_ext_by_NID(cacert.cert, NID_subject_key_identifier, -1); + if ((i >= 0) && (ext = X509_get_ext(cacert.cert, i))) + ikeyid = static_cast<ASN1_OCTET_STRING *>(X509V3_EXT_d2i(ext)); +@@ -1486,9 +1494,10 @@ + akeyid->issuer = NULL; + akeyid->serial = NULL; + akeyid->keyid = ikeyid; +- ext = X509V3_EXT_i2d(NID_authority_key_identifier, 0, akeyid); +- X509_add_ext(cert, ext, -1); +- X509_EXTENSION_free(ext); ++ X509_EXTENSION *akiext = ++ X509V3_EXT_i2d(NID_authority_key_identifier, 0, akeyid); ++ X509_add_ext(cert, akiext, -1); ++ X509_EXTENSION_free(akiext); + AUTHORITY_KEYID_free(akeyid); + } +
meta-oe/recipes-connectivity/wvdial/wvstreams_4.6.1.bb +1 -0
@@ -23,6 +23,7 @@ SRC_URI = "https://storage.googleapis.com/google-code-archive-downloads/v2/code. file://openssl-buildfix.patch \ file://0001-Forward-port-to-OpenSSL-1.1.x.patch \ file://0001-Fix-narrowing-conversion-error.patch \ + file://0001-crypto-build-against-OpenSSL-4.patch \ " SRC_URI[sha256sum] = "8403f5fbf83aa9ac0c6ce15d97fd85607488152aa84e007b7d0621b8ebc07633"
PATCH 5/7 extract-cert: fix build with OpenSSL 4
In reply to Khem RajOpenSSL 4.0 removed the ENGINE API. <openssl/engine.h> still exists as a source-compatibility stub, so both binaries fail to link:
ld.lld: error: undefined symbol: ENGINE_load_builtin_engines ld.lld: error: undefined symbol: ENGINE_by_id ld.lld: error: undefined symbol: ENGINE_init ld.lld: error: undefined symbol: ENGINE_ctrl_cmd_string ld.lld: error: undefined symbol: ENGINE_load_public_key
The ENGINE use is confined to the "pkcs11:" input branch of each tool, so compile that branch out on OpenSSL 4 and diagnose the unsupported input instead. Reading certificates and public keys from PEM files, which is what the kernel build and most other users do, is unaffected.
Providers supersede engines, but none exposes an equivalent of the pkcs11 engine's LOAD_CERT_CTRL command, so there is nothing to port to yet.
AI-Generated: Uses Claude Code
--- ...ot-use-the-ENGINE-API-with-OpenSSL-4.patch | 99 +++++++++++++++++++ .../extract-cert/extract-cert_0.3.bb | 4 +- 2 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 meta-oe/recipes-devtools/extract-cert/extract-cert/0001-Do-not-use-the-ENGINE-API-with-OpenSSL-4.patch
meta-oe/recipes-devtools/extract-cert/extract-cert/0001-Do-not-use-the-ENGINE-API-with-OpenSSL-4.patch new file +99 -0
@@ -0,0 +1,99 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +Date: Wed, 3 Sep 2026 01:30:00 +0000 +Subject: [PATCH] Do not use the ENGINE API with OpenSSL 4 + +OpenSSL 4.0 removed the ENGINE API. <openssl/engine.h> still exists, but +only as a source-compatibility stub, so both binaries now fail to link: + + ld.lld: error: undefined symbol: ENGINE_load_builtin_engines + ld.lld: error: undefined symbol: ENGINE_by_id + ld.lld: error: undefined symbol: ENGINE_init + ld.lld: error: undefined symbol: ENGINE_ctrl_cmd_string + ld.lld: error: undefined symbol: ENGINE_load_public_key + +The ENGINE use is confined to the "pkcs11:" input branch of each tool, so +compile that branch out on OpenSSL 4 and diagnose the unsupported input +instead. Reading certificates and public keys from PEM files - which is +what the kernel build and most other users actually do - is unaffected. + +Providers supersede engines, but no provider exposes an equivalent of the +pkcs11 engine's LOAD_CERT_CTRL command, so there is nothing to port to +yet; pkcs11-provider based support would be a separate feature. + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <[email protected]> +--- +--- a/extract-cert.c ++++ b/extract-cert.c +@@ -21,7 +21,9 @@ + #include <openssl/bio.h> + #include <openssl/pem.h> + #include <openssl/err.h> ++#if OPENSSL_VERSION_MAJOR < 4 + #include <openssl/engine.h> ++#endif + + #define PKEY_ID_PKCS7 2 + +@@ -112,6 +114,16 @@ + fclose(f); + exit(0); + } else if (!strncmp(cert_src, "pkcs11:", 7)) { ++#if OPENSSL_VERSION_MAJOR >= 4 ++ /* ++ * OpenSSL 4.0 removed the ENGINE API, and with it the pkcs11 ++ * engine that was used here to pull an object off a token. No ++ * provider based replacement for the engine's LOAD_CERT_CTRL ++ * command exists, so fail loudly rather than quietly emitting ++ * nothing. ++ */ ++ ERR(1, "PKCS#11 URIs require OpenSSL < 4.0 (ENGINE API removed)"); ++#else + ENGINE *e; + struct { + const char *cert_id; +@@ -134,6 +146,7 @@ + ENGINE_ctrl_cmd(e, "LOAD_CERT_CTRL", 0, &parms, NULL, 1); + ERR(!parms.cert, "Get X.509 from PKCS#11"); + write_cert(parms.cert); ++#endif + } else { + BIO *b; + X509 *x509; +--- a/spki-hash.c ++++ b/spki-hash.c +@@ -23,7 +23,9 @@ + #include <openssl/bio.h> + #include <openssl/pem.h> + #include <openssl/err.h> ++#if OPENSSL_VERSION_MAJOR < 4 + #include <openssl/engine.h> ++#endif + + #define PKEY_ID_PKCS7 2 + +@@ -110,6 +112,14 @@ + src = argv[1]; + + if (!strncmp(src, "pkcs11:", 7)) { ++#if OPENSSL_VERSION_MAJOR >= 4 ++ /* ++ * OpenSSL 4.0 removed the ENGINE API, and with it the pkcs11 ++ * engine that was used here to load a public key off a token. ++ * Fail loudly rather than quietly hashing nothing. ++ */ ++ ERR(1, "PKCS#11 URIs require OpenSSL < 4.0 (ENGINE API removed)"); ++#else + ENGINE *e; + ENGINE_load_builtin_engines(); + drain_openssl_errors(); +@@ -124,6 +134,7 @@ + + key = ENGINE_load_public_key(e, src, NULL, NULL); + ERR(!key, "ENGINE_load_public_key"); ++#endif + } else { + BIO *b; +
meta-oe/recipes-devtools/extract-cert/extract-cert_0.3.bb +3 -1
@@ -4,7 +4,9 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c" DEPENDS = "openssl" -SRC_URI = "git://git.pengutronix.de/git/extract-cert;protocol=https;branch=master;" +SRC_URI = "git://git.pengutronix.de/git/extract-cert;protocol=https;branch=master; \ + file://0001-Do-not-use-the-ENGINE-API-with-OpenSSL-4.patch \ + " SRCREV = "d652b4e8279aef2a85f58676ab472744bafeafc9"
PATCH 6/7 imx-cst: fix remaining build failures with OpenSSL 4
In reply to Khem RajTwo more OpenSSL 4.0 breakages on top of the ASN.1 opacity already handled by 0012-fix-openssl-4-asn1-opaque.patch.
The ENGINE API is gone. <openssl/engine.h> is still shipped as a source-compatibility stub, so linking fails on ENGINE_free, ENGINE_load_builtin_engines, ENGINE_by_id, ENGINE_init, ENGINE_finish, ENGINE_ctrl_cmd and ENGINE_load_private_key. Define OPENSSL_ENGINE_STUBS, which OpenSSL 4 provides for exactly this case: the declarations become inline no-ops returning failure, so the file compiles and links unchanged. OPENSSL_SUPPRESS_DEPRECATED is already defined there, so the stubs' deprecation attributes do not trip -Werror. That leaves ENGINE_by_id() returning NULL, which the existing code fed straight into ENGINE_init() - a NULL dereference predating OpenSSL 4 - so check it and report what went wrong, mentioning OpenSSL 4 so the failure is not mistaken for a missing module. PKCS#11 backed signing genuinely is unavailable there, as no provider exposes an equivalent of the pkcs11 engine's LOAD_CERT_CTRL.
X509_get_subject_name() now returns const X509_NAME *, so its result can no longer be the destination of X509_NAME_add_entry_by_txt():
src/tools/pki_tree/pki_helper.c:440:10: error: assigning to 'X509_NAME *' from 'const X509_NAME *' discards qualifiers
There is no mutable counterpart, so build the subject name standalone and install it with X509_set_subject_name(); both setters copy it, so it is freed once the issuer name has been set from it too.
AI-Generated: Uses Claude Code
--- ...015-fix-openssl-4-engine-api-removal.patch | 67 +++++++++++++++++++ ...016-fix-openssl-4-const-subject-name.patch | 48 +++++++++++++ .../recipes-support/imx-cst/imx-cst_4.0.1.bb | 2 + 3 files changed, 117 insertions(+) create mode 100644 meta-oe/recipes-support/imx-cst/imx-cst/0015-fix-openssl-4-engine-api-removal.patch create mode 100644 meta-oe/recipes-support/imx-cst/imx-cst/0016-fix-openssl-4-const-subject-name.patch
meta-oe/recipes-support/imx-cst/imx-cst/0015-fix-openssl-4-engine-api-removal.patch new file +67 -0
@@ -0,0 +1,67 @@ +From: Khem Raj <[email protected]> +Date: Wed, 3 Sep 2026 01:30:00 +0000 +Subject: Fix FTBFS with OpenSSL 4.0: ENGINE API removal + +OpenSSL 4.0 removed the ENGINE API. <openssl/engine.h> is still shipped, +but only as a source-compatibility stub, so linking fails: + + ld.lld: error: undefined symbol: ENGINE_free + ld.lld: error: undefined symbol: ENGINE_load_builtin_engines + ld.lld: error: undefined symbol: ENGINE_by_id + ld.lld: error: undefined symbol: ENGINE_init + ld.lld: error: undefined symbol: ENGINE_finish + ld.lld: error: undefined symbol: ENGINE_ctrl_cmd + ld.lld: error: undefined symbol: ENGINE_load_private_key + +Define OPENSSL_ENGINE_STUBS, which OpenSSL 4 offers exactly for this +case: the ENGINE_* declarations become inline no-ops returning failure, +so the file compiles and links unchanged. OPENSSL_SUPPRESS_DEPRECATED is +already defined here, so the stubs' deprecation attributes do not trip +-Werror either. + +That leaves ENGINE_by_id() returning NULL at runtime, which the existing +code fed straight into ENGINE_init() - a NULL dereference that predates +OpenSSL 4. Check the result and print what went wrong instead, noting the +OpenSSL 4 situation so the failure is not mistaken for a missing module. + +Providers replace engines upstream, but nothing exposes an equivalent of +the pkcs11 engine's LOAD_CERT_CTRL command yet, so PKCS#11 backed signing +genuinely is unavailable with OpenSSL 4. + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <[email protected]> +--- +--- a/src/lib/back_end/engine.c ++++ b/src/lib/back_end/engine.c +@@ -4,6 +4,13 @@ + */ + + #define OPENSSL_SUPPRESS_DEPRECATED ++/* ++ * OpenSSL 4.0 removed the ENGINE API. <openssl/engine.h> still declares ++ * it for source compatibility, and defining OPENSSL_ENGINE_STUBS turns the ++ * declarations into inline no-ops so this file keeps linking. The pkcs11 ++ * engine simply does not exist there, which engine_ctx_init() reports. ++ */ ++#define OPENSSL_ENGINE_STUBS + + #include "engine.h" + #include "err.h" +@@ -63,6 +70,16 @@ + + ctx->engine = ENGINE_by_id("pkcs11"); + ++ if (!ctx->engine) { ++ fprintf(stderr, "ERROR: cannot load the pkcs11 OpenSSL engine\n"); ++#if OPENSSL_VERSION_MAJOR >= 4 ++ fprintf(stderr, ++ "ERROR: OpenSSL 4.0 removed ENGINE support, so PKCS#11 " ++ "backed signing is unavailable\n"); ++#endif ++ return 0; ++ } ++ + #ifdef DEBUG + ENGINE_ctrl_cmd_string(ctx->engine, "VERBOSE", NULL, 0); + #endif
meta-oe/recipes-support/imx-cst/imx-cst/0016-fix-openssl-4-const-subject-name.patch new file +48 -0
48 lines not on this page · raw message
meta-oe/recipes-support/imx-cst/imx-cst_4.0.1.bb +2 -0
@@ -27,6 +27,8 @@ SRC_URI = "\ file://0012-fix-openssl-4-asn1-opaque.patch \ file://0013-convlb-remove-redundant-NULL-definition.patch \ file://0014-fix-pointer-sign-errors-with-clang.patch \ + file://0015-fix-openssl-4-engine-api-removal.patch \ + file://0016-fix-openssl-4-const-subject-name.patch \ " SRC_URI[sha256sum] = "fd92a1a9faa10fb81bbf752c7ee1e257f17e1ec4c2964f8a47adf8a3eaa7df41"
PATCH 7/7 synergy: fix build with OpenSSL 4
In reply to Khem RajTLSv1_2_server_method() and TLSv1_2_client_method() were deprecated in OpenSSL 1.1.0 and removed in OpenSSL 4.0, so do_compile fails:
SecureSocket.cpp:386:18: error: use of undeclared identifier 'TLSv1_2_server_method'; did you mean 'TLS_server_method'? SecureSocket.cpp:389:18: error: use of undeclared identifier 'TLSv1_2_client_method'; did you mean 'TLS_client_method'?
Backport the two upstream commits that deal with this, neither of which is in the v1.10.1 SRCREV pinned here - they first shipped in v1.11.0:
4fea67e078479cc00afe6b1201c54c997a41fc70
"#6390 Updated OpenSSL For better security with TLS1.3"
4d3cf2c6 "Preventing older insecure version of TLS/SSL"
The first swaps the removed version specific methods for the version flexible ones; the second restores the TLS 1.2 floor with SSL_CTX_set_options(). Both are needed: the first on its own silently drops the minimum version the original code deliberately enforced, for the PCI compliance reasons its comment describes. Since TLS 1.3 can now be negotiated, the hardcoded "TLSv1.2" reported to the user is replaced with the version actually in use, retiring k_tlsString.
Upgrading the recipe instead is not an option today. Upstream renamed the repository to symless/synergy and the latest release, v1.20.4, is the rebranded deskflow codebase with a different cmake layout, a Qt6 GUI and a changed LICENSE; more importantly it hard requires the ext/synergy-extra submodule, declared with an ssh URL and carrying no license at all, and its cmake aborts without it. That has been true since v1.16.x. No pending upstream pull request addresses the build failure either, since upstream fixed it in tree back in 2019.
The backport differs from upstream in two intentional ways, both noted in the patch: upstream's pre-1.1.0 fallback defines the client method to SSLv23_server_method, and upstream sets the context options before checking SSL_CTX_new() for NULL.
AI-Generated: Uses Claude Code
--- ...ot-use-the-removed-TLSv1_2_-method-c.patch | 113 ++++++++++++++++++ .../recipes-support/synergy/synergy_git.bb | 1 + 2 files changed, 114 insertions(+) create mode 100644 meta-oe/recipes-support/synergy/synergy/0001-SecureSocket-do-not-use-the-removed-TLSv1_2_-method-c.patch
meta-oe/recipes-support/synergy/synergy/0001-SecureSocket-do-not-use-the-removed-TLSv1_2_-method-c.patch new file +113 -0
@@ -0,0 +1,113 @@ +From: Khem Raj <[email protected]> +Date: Thu, 10 Sep 2026 19:20:00 +0000 +Subject: [PATCH] SecureSocket: do not use the removed TLSv1_2_*_method calls + +The version specific TLSv1_2_server_method() and TLSv1_2_client_method() +were deprecated in OpenSSL 1.1.0 and removed outright in OpenSSL 4.0, so +do_compile fails: + + SecureSocket.cpp:386:18: error: use of undeclared identifier 'TLSv1_2_server_method'; did you mean 'TLS_server_method'? + SecureSocket.cpp:389:18: error: use of undeclared identifier 'TLSv1_2_client_method'; did you mean 'TLS_client_method'? + +Pick the version flexible method instead and keep the TLS 1.2 floor the +old code was after by excluding every earlier version through +SSL_CTX_set_options(). Since TLS 1.3 can now be negotiated, the hardcoded +"TLSv1.2" that was reported to the user is replaced with the version +actually in use, which also retires k_tlsString. + +This is a backport of two upstream commits, neither of which is in the +v1.10.1 SRCREV this recipe pins (they first shipped in v1.11.0): + + 4fea67e078479cc00afe6b1201c54c997a41fc70 + "#6390 Updated OpenSSL For better security with TLS1.3" + 4d3cf2c6 "Preventing older insecure version of TLS/SSL" + +Two deliberate differences from upstream: + + - upstream's pre-1.1.0 fallback defines SSL_CLIENT_METHOD to + SSLv23_server_method, so a client would ask for a server method. That + typo is still present upstream; use SSLv23_client_method here. Only the + OPENSSL_VERSION_NUMBER > 0x10100000L branch is taken in this build, so + the difference is inert here, but there is no reason to copy the bug. + + - upstream calls SSL_CTX_set_options() before checking SSL_CTX_new() for + NULL, which dereferences a NULL context on allocation failure. Check + first and return, then set the options. + +Upstream-Status: Backport [4fea67e078479cc00afe6b1201c54c997a41fc70 and +4d3cf2c6, adapted to v1.10.1; the two differences above are not upstream] +Signed-off-by: Khem Raj <[email protected]> +--- +diff --git a/src/lib/net/SecureSocket.cpp b/src/lib/net/SecureSocket.cpp +index 1111111..2222222 100644 +--- a/src/lib/net/SecureSocket.cpp ++++ b/src/lib/net/SecureSocket.cpp +@@ -37,8 +37,16 @@ + + #define MAX_ERROR_SIZE 65535 + ++//Add the new function names in case older ones are deprecated ++#if OPENSSL_VERSION_NUMBER > 0x10100000L ++#define SSL_SERVER_METHOD TLS_server_method ++#define SSL_CLIENT_METHOD TLS_client_method ++#else ++#define SSL_SERVER_METHOD SSLv23_server_method ++#define SSL_CLIENT_METHOD SSLv23_client_method ++#endif ++ + static const float s_retryDelay = 0.01f; +-const char* k_tlsString = "TLSv1.2"; + + enum { + kMsgSize = 128 +@@ -376,26 +384,33 @@ + showSecureLibInfo(); + } + +- // only use TLS 1.2 (latest as of 27 jul 18). previously we were using +- // the SSLv23_server_method and SSLv23_client_method functions with ++ // only use TLS 1.2 or newer. previously we were using the ++ // SSLv23_server_method and SSLv23_client_method functions with + // SSL_OP_NO_SSLv3, but not SSL_OP_NO_SSLv2, so there was a potential + // vulnerability where it could fall back to SSLv2 (not TLS). also, + // the SSLv23_*_method functions could fall back to TLS 1.0 and 1.1, +- // which are nolonger PCI compliant. ++ // which are nolonger PCI compliant. the version specific ++ // TLSv1_2_*_method functions were removed in OpenSSL 4.0, so pick the ++ // version flexible method and exclude everything below TLS 1.2 below. + if (server) { +- method = TLSv1_2_server_method(); ++ method = SSL_SERVER_METHOD(); + } + else { +- method = TLSv1_2_client_method(); ++ method = SSL_CLIENT_METHOD(); + } +- ++ + // create new context from method + SSL_METHOD* m = const_cast<SSL_METHOD*>(method); + m_ssl->m_context = SSL_CTX_new(m); + + if (m_ssl->m_context == NULL) { + showError(); ++ return; + } ++ ++ // prevent the use of every version prior to TLS 1.2, as they are known ++ // to be vulnerable ++ SSL_CTX_set_options(m_ssl->m_context, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1); + } + + void +@@ -848,9 +863,7 @@ + LOG((CLOG_DEBUG "openssl cipher: %s", msg)); + + // show user a simpler version of the openssl cipher output +- if (std::string(msg).find(k_tlsString) != std::string::npos) { +- LOG((CLOG_INFO "network encryption protocol: %s", k_tlsString)); +- } ++ LOG((CLOG_INFO "network encryption protocol: %s", SSL_CIPHER_get_version(cipher))); + } + else { + LOG((CLOG_ERR "could not get secure socket cipher"));
meta-oe/recipes-support/synergy/synergy_git.bb +1 -0
@@ -11,6 +11,7 @@ REQUIRED_DISTRO_FEATURES = "x11" SRC_URI = "git://github.com/symless/synergy-core;protocol=https;nobranch=1" SRC_URI += "file://CVE-2020-15117.patch" +SRC_URI += "file://0001-SecureSocket-do-not-use-the-removed-TLSv1_2_-method-c.patch" # Version 1.10.1-stable SRCREV ?= "1b4c076127687aceac931d269e898beaac1cad9f"