From 021ac67cc29af0f48cebb755fe306339e75b5eb2 Mon Sep 17 00:00:00 2001 From: Michael Cobb michael.cobb@iceotope.com Date: Thu, 5 Sep 2024 09:12:56 +0100 Subject: [meta-morello-distro][PATCH 0/4] GLib-2.0: Add recipes for GLib 2.76.4 and dependencies
These patches contain recipes for purecap GLib-2.0 2.76.4, and dependencies libpcre2 10.40 and libffi 3.4.2. Patches for GLib and libffi are from the CheriBSD CTSRD-CHERI repo (https://github.com/CTSRD-CHERI).
libffi's closures are disabled upstream. A compile time flag has been added to re-enable FFI closures on CHERI (--enable-cheri-ffi-closures). Without re-enabling closures, I am unable to use DBus signals with GDBus. Enabling them allows me to using DBus signals without issues, but YMMV.
Running the GLib tests manually I see 220 passed, 47 fail. I believe the failures are due to not using GLib's build system (i.e. `meson test`) and therefore are not being ran correctly.
Michael Cobb (4): libpcre2: C64 initial commit libffi: C64 initial commit util-linux: enable building of libmount to support GLib glib-2.0: C64 initial commit
.../glib-2.0/glib-2.0-morello_2.76.4.bb | 58 +++ ...0001-Fix-DATADIRNAME-on-uclibc-Linux.patch | 30 ++ ...-gio-querymodules-as-libexec_PROGRAM.patch | 27 ++ ...ng-about-deprecated-paths-in-schemas.patch | 40 ++ ...-correctly-when-building-with-mingw3.patch | 81 ++++ .../0001-add-disable-cxx-build-option.patch | 36 ++ ...ces.c-comment-out-a-build-host-only-.patch | 28 ++ ...on-Run-atomics-test-on-clang-as-well.patch | 29 ++ ...-fix-iconv-libintl-library-not-found.patch | 61 +++ ...sable-testing-host-binaries-when-cro.patch | 59 +++ ...dcode-python-path-into-various-tools.patch | 44 +++ .../glib-2.0/glib-2.0/memory-monitor.patch | 362 ++++++++++++++++++ .../glib-2.0/glib-2.0/meson.cross.d/common | 3 + .../glib-2.0/meson.cross.d/common-glibc | 5 + .../glib-2.0/meson.cross.d/common-linux | 5 + .../glib-2.0/meson.cross.d/common-mingw | 6 + .../glib-2.0/meson.cross.d/common-morello | 3 + .../glib-2.0/meson.cross.d/common-musl | 6 + .../glib-2.0/glib-2.0/skip-timeout.patch | 30 ++ recipes-core/glib-2.0/glib-morello.inc | 170 ++++++++ .../util-linux/util-linux-morello_2.37.4.bb | 4 +- .../libffi/libffi-morello_3.4.2.bb | 41 ++ ...-ffi-closures-flag-to-enable-FFI-clo.patch | 65 ++++ ...m-sysv-reverted-clang-VFP-mitigation.patch | 102 +++++ recipes-support/libffi/libffi/not-win32.patch | 35 ++ .../libpcre/libpcre2-morello_10.40.bb | 69 ++++ .../libpcre/libpcre2/CVE-2022-41409.patch | 75 ++++ 27 files changed, 1472 insertions(+), 2 deletions(-) create mode 100644 recipes-core/glib-2.0/glib-2.0-morello_2.76.4.bb create mode 100644 recipes-core/glib-2.0/glib-2.0/0001-Fix-DATADIRNAME-on-uclibc-Linux.patch create mode 100644 recipes-core/glib-2.0/glib-2.0/0001-Install-gio-querymodules-as-libexec_PROGRAM.patch create mode 100644 recipes-core/glib-2.0/glib-2.0/0001-Remove-the-warning-about-deprecated-paths-in-schemas.patch create mode 100644 recipes-core/glib-2.0/glib-2.0/0001-Set-host_machine-correctly-when-building-with-mingw3.patch create mode 100644 recipes-core/glib-2.0/glib-2.0/0001-add-disable-cxx-build-option.patch create mode 100644 recipes-core/glib-2.0/glib-2.0/0001-gio-tests-resources.c-comment-out-a-build-host-only-.patch create mode 100644 recipes-core/glib-2.0/glib-2.0/0001-meson-Run-atomics-test-on-clang-as-well.patch create mode 100644 recipes-core/glib-2.0/glib-2.0/0002-fix-iconv-libintl-library-not-found.patch create mode 100644 recipes-core/glib-2.0/glib-2.0/0003-Add-option-to-disable-testing-host-binaries-when-cro.patch create mode 100644 recipes-core/glib-2.0/glib-2.0/0010-Do-not-hardcode-python-path-into-various-tools.patch create mode 100644 recipes-core/glib-2.0/glib-2.0/memory-monitor.patch create mode 100644 recipes-core/glib-2.0/glib-2.0/meson.cross.d/common create mode 100644 recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-glibc create mode 100644 recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-linux create mode 100644 recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-mingw create mode 100644 recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-morello create mode 100644 recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-musl create mode 100644 recipes-core/glib-2.0/glib-2.0/skip-timeout.patch create mode 100644 recipes-core/glib-2.0/glib-morello.inc create mode 100644 recipes-support/libffi/libffi-morello_3.4.2.bb create mode 100644 recipes-support/libffi/libffi/0001-Add-enable-cheri-ffi-closures-flag-to-enable-FFI-clo.patch create mode 100644 recipes-support/libffi/libffi/0001-arm-sysv-reverted-clang-VFP-mitigation.patch create mode 100644 recipes-support/libffi/libffi/not-win32.patch create mode 100644 recipes-support/libpcre/libpcre2-morello_10.40.bb create mode 100644 recipes-support/libpcre/libpcre2/CVE-2022-41409.patch
From e6a9d7a853f7afcf876c0c0f47c598639ffc4166 Mon Sep 17 00:00:00 2001 From: Michael Cobb michael.cobb@iceotope.com Date: Tue, 20 Aug 2024 15:10:18 +0100 Subject: [PATCH 1/4] libpcre2: C64 initial commit
Inital commit of libpcre2 10.40 recipe
Signed-off-by: Michael Cobb michael.cobb@iceotope.com --- .../libpcre/libpcre2-morello_10.40.bb | 69 +++++++++++++++++ .../libpcre/libpcre2/CVE-2022-41409.patch | 75 +++++++++++++++++++ 2 files changed, 144 insertions(+) create mode 100644 recipes-support/libpcre/libpcre2-morello_10.40.bb create mode 100644 recipes-support/libpcre/libpcre2/CVE-2022-41409.patch
diff --git a/recipes-support/libpcre/libpcre2-morello_10.40.bb b/recipes-support/libpcre/libpcre2-morello_10.40.bb new file mode 100644 index 0000000..1b7d15a --- /dev/null +++ b/recipes-support/libpcre/libpcre2-morello_10.40.bb @@ -0,0 +1,69 @@ +inherit autotools binconfig-disabled purecap-sysroot + +MORELLO_SRC = "poky/meta/recipes-support/libpcre/libpcre2_10.40.bb" + +DESCRIPTION = "There are two major versions of the PCRE library. The \ +newest version is PCRE2, which is a re-working of the original PCRE \ +library to provide an entirely new API. The original, very widely \ +deployed PCRE library's API and feature are stable, future releases \ + will be for bugfixes only. All new future features will be to PCRE2, \ +not the original PCRE 8.x series." +SUMMARY = "Perl Compatible Regular Expressions version 2" +HOMEPAGE = "http://www.pcre.org" +SECTION = "devel" +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://LICENCE;md5=41bfb977e4933c506588724ce69bf5d2" + +SRC_URI = "https://github.com/PhilipHazel/pcre2/releases/download/pcre2-%24%7BPV%7D/pcr... \ + file://CVE-2022-41409.patch \ +" + +UPSTREAM_CHECK_URI = "https://github.com/PhilipHazel/pcre2/releases" + +SRC_URI[sha256sum] = "14e4b83c4783933dc17e964318e6324f7cae1bc75d8f3c79bc6969f00c159d68" + +CVE_PRODUCT = "pcre2" + +TOOLCHAIN = "${MORELLO_TOOLCHAIN}" + +FILESEXTRAPATHS:prepend := "${THISDIR}/libpcre2:" + +S = "${WORKDIR}/pcre2-${PV}" + +PROVIDES += "pcre2-morello" +DEPENDS += "bzip2-morello zlib-morello" + +BINCONFIG = "${bindir}/pcre2-config" + +EXTRA_OECONF = "\ + --enable-newline-is-lf \ + --with-link-size=2 \ + --with-match-limit=10000000 \ + --enable-pcre2-16 \ + --enable-pcre2-32 \ +" + +CFLAGS += "-D_REENTRANT" +CXXFLAGS:append:powerpc = " -lstdc++" + +do_install:append() { + libtool --finish "${D}${libdir}" +} + +PACKAGES =+ "libpcre2-16-morello libpcre2-32-morello pcre2grep-morello pcre2grep-doc-morello pcre2test-morello pcre2test-doc-morello" + +SUMMARY:pcre2grep-morello = "grep utility that uses perl 5 compatible regexes" +SUMMARY:pcre2grep-doc-morello = "grep utility that uses perl 5 compatible regexes - docs" +SUMMARY:pcre2test-morello = "program for testing Perl-comatible regular expressions" +SUMMARY:pcre2test-doc-morello = "program for testing Perl-comatible regular expressions - docs" + +# prevent a clash with the non-morello version of libpcre2 during do_package_ipk: +PKG:libpcre2-16-morello = "libpcre2-16-0-morello" +PKG:libpcre2-32-morello = "libpcre2-32-0-morello" + +FILES:libpcre2-16-morello = "${libdir}/libpcre2-16.so.*" +FILES:libpcre2-32-morello = "${libdir}/libpcre2-32.so.*" +FILES:pcre2grep-morello = "${bindir}/pcre2grep" +FILES:pcre2grep-morello-doc = "${mandir}/man1/pcre2grep.1" +FILES:pcre2test-morello = "${bindir}/pcre2test" +FILES:pcre2test-morello-doc = "${mandir}/man1/pcre2test.1" diff --git a/recipes-support/libpcre/libpcre2/CVE-2022-41409.patch b/recipes-support/libpcre/libpcre2/CVE-2022-41409.patch new file mode 100644 index 0000000..833348c --- /dev/null +++ b/recipes-support/libpcre/libpcre2/CVE-2022-41409.patch @@ -0,0 +1,75 @@ +From 94e1c001761373b7d9450768aa15d04c25547a35 Mon Sep 17 00:00:00 2001 +From: Philip Hazel Philip.Hazel@gmail.com +Date: Tue, 16 Aug 2022 17:00:45 +0100 +Subject: [PATCH] Diagnose negative repeat value in pcre2test subject line + +CVE: CVE-2022-41409 +Upstream-Status: Backport [https://github.com/PCRE2Project/pcre2/commit/94e1c001761373b7d9450768aa15d04...] + +Signed-off-by: Peter Marko peter.marko@siemens.com + +--- + ChangeLog | 3 +++ + src/pcre2test.c | 4 ++-- + testdata/testinput2 | 3 +++ + testdata/testoutput2 | 4 ++++ + 4 files changed, 12 insertions(+), 2 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index eab50eb7..276eb57a 100644 +--- a/ChangeLog ++++ b/ChangeLog +index eab50eb7..276eb57a 100644 +@@ -1,6 +1,9 @@ + Change Log for PCRE2 + -------------------- + ++20. A negative repeat value in a pcre2test subject line was not being ++diagnosed, leading to infinite looping. ++ + + Version 10.40 15-April-2022 + --------------------------- +diff --git a/src/pcre2test.c b/src/pcre2test.c +index 08f86096..f6f5d66c 100644 +--- a/src/pcre2test.c ++++ b/src/pcre2test.c +@@ -6781,9 +6781,9 @@ while ((c = *p++) != 0) + } + + i = (int32_t)li; +- if (i-- == 0) ++ if (i-- <= 0) + { +- fprintf(outfile, "** Zero repeat not allowed\n"); ++ fprintf(outfile, "** Zero or negative repeat not allowed\n"); + return PR_OK; + } + +diff --git a/testdata/testinput2 b/testdata/testinput2 +index d37d8f30..717ba2ae 100644 +--- a/testdata/testinput2 ++++ b/testdata/testinput2 +@@ -5932,4 +5932,7 @@ a)"xI + /[Aa]{2,3}/BI + aabcd + ++-- ++ [X]{-10} ++ + # End of testinput2 +diff --git a/testdata/testoutput2 b/testdata/testoutput2 +index ce090f8c..d2188d3c 100644 +--- a/testdata/testoutput2 ++++ b/testdata/testoutput2 +@@ -17746,6 +17746,10 @@ Subject length lower bound = 2 + aabcd + 0: aa + ++-- ++ [X]{-10} ++** Zero or negative repeat not allowed ++ + # End of testinput2 + Error -70: PCRE2_ERROR_BADDATA (unknown error number) + Error -62: bad serialized data
From c8ba658eda63dda8f927a1bd464734e833985bf5 Mon Sep 17 00:00:00 2001 From: Michael Cobb michael.cobb@iceotope.com Date: Tue, 20 Aug 2024 15:25:03 +0100 Subject: [PATCH 2/4] libffi: C64 initial commit
libffi version 3.4.2 from CHERIBSD repo: https://github.com/CTSRD-CHERI/libffi/commit/c666fdd8613b4d56130431c3e8f0bb0...
Included patch to add compile time option `--enable-cheri-ffi-closures` to enable ffi closures; this functionality was disabled in the source repo as it was not fully implemented, but needs to be enabled for Glib/GDBus signals to work. Use of FFI closures outside of GDBus signals has not been tested so use at your own risk.
Signed-off-by: Michael Cobb michael.cobb@iceotope.com --- .../libffi/libffi-morello_3.4.2.bb | 41 +++++++ ...-ffi-closures-flag-to-enable-FFI-clo.patch | 65 +++++++++++ ...m-sysv-reverted-clang-VFP-mitigation.patch | 102 ++++++++++++++++++ recipes-support/libffi/libffi/not-win32.patch | 35 ++++++ 4 files changed, 243 insertions(+) create mode 100644 recipes-support/libffi/libffi-morello_3.4.2.bb create mode 100644 recipes-support/libffi/libffi/0001-Add-enable-cheri-ffi-closures-flag-to-enable-FFI-clo.patch create mode 100644 recipes-support/libffi/libffi/0001-arm-sysv-reverted-clang-VFP-mitigation.patch create mode 100644 recipes-support/libffi/libffi/not-win32.patch
diff --git a/recipes-support/libffi/libffi-morello_3.4.2.bb b/recipes-support/libffi/libffi-morello_3.4.2.bb new file mode 100644 index 0000000..7f6ec96 --- /dev/null +++ b/recipes-support/libffi/libffi-morello_3.4.2.bb @@ -0,0 +1,41 @@ +inherit autotools texinfo purecap-sysroot + +MORELLO_SRC = "poky/meta/recipes-support/libffi/*" + +SUMMARY = "A portable foreign function interface library" +HOMEPAGE = "http://sourceware.org/libffi/" +DESCRIPTION = "The `libffi' library provides a portable, high level programming interface to various calling \ +conventions. This allows a programmer to call any function specified by a call interface description at run \ +time. FFI stands for Foreign Function Interface. A foreign function interface is the popular name for the \ +interface that allows code written in one language to call code written in another language. The `libffi' \ +library really only provides the lowest, machine dependent layer of a fully featured foreign function interface. \ +A layer must exist above `libffi' that handles type conversions for values passed between the two languages." + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=679b5c9bdc79a2b93ee574e193e7a7bc" + +SRC_URI = "git://github.com/CTSRD-CHERI/libffi.git;protocol=https;branch=master;rev=c666fdd8613b4d56130431c3e8f0bb05f30f07e8 \ + file://0001-Add-enable-cheri-ffi-closures-flag-to-enable-FFI-clo.patch \ + file://not-win32.patch \ + file://0001-arm-sysv-reverted-clang-VFP-mitigation.patch \ + " +SRC_URI[sha256sum] = "d66c56ad259a82cf2a9dfc408b32bf5da52371500b84745f7fb8b645712df676" + +FILESEXTRAPATHS:prepend = "${THISDIR}/libffi:" + +UPSTREAM_CHECK_URI = "https://github.com/libffi/libffi/releases/" +UPSTREAM_CHECK_REGEX = "libffi-(?P<pver>\d+(.\d+)+).tar" + +TOOLCHAIN = "${MORELLO_TOOLCHAIN}" + +S = "${WORKDIR}/git" + +EXTRA_OECONF += "--disable-builddir --disable-exec-static-tramp" +EXTRA_OECONF += " --enable-cheri-ffi-closures " +EXTRA_OEMAKE += "LIBTOOLFLAGS='--tag=CC'" + +FILES:${PN}-dev += "${libdir}/libffi-${PV}" + +# Doesn't compile in MIPS16e mode due to use of hand-written +# assembly +MIPS_INSTRUCTION_SET = "mips" diff --git a/recipes-support/libffi/libffi/0001-Add-enable-cheri-ffi-closures-flag-to-enable-FFI-clo.patch b/recipes-support/libffi/libffi/0001-Add-enable-cheri-ffi-closures-flag-to-enable-FFI-clo.patch new file mode 100644 index 0000000..b42feac --- /dev/null +++ b/recipes-support/libffi/libffi/0001-Add-enable-cheri-ffi-closures-flag-to-enable-FFI-clo.patch @@ -0,0 +1,65 @@ +From 208cb325d15f016d2fb58e11b1d97e1e4d85739b Mon Sep 17 00:00:00 2001 +From: Michael Cobb michael.cobb@iceotope.com +Date: Wed, 12 Jun 2024 16:37:18 +0100 +Subject: [PATCH] Add --enable-cheri-ffi-closures flag to enable FFI closures + on CHERI + +--- + configure.ac | 9 +++++++++ + include/ffi.h.in | 4 ++++ + src/aarch64/ffitarget.h | 3 ++- + 3 files changed, 15 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 70f6d2c..fbc0125 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -234,6 +234,15 @@ esac + AM_CONDITIONAL(FFI_EXEC_TRAMPOLINE_TABLE, test x$FFI_EXEC_TRAMPOLINE_TABLE = x1) + AC_SUBST(FFI_EXEC_TRAMPOLINE_TABLE) + ++CHERI_FFI_CLOSURES = 0 ++AC_ARG_ENABLE(cheri-ffi-closures, ++[ --enable-cheri-ffi-closures enable FFI closures on CHERI targets], ++ if test "$enable_cheri_ffi_closures" = "yes"; then ++ CHERI_FFI_CLOSURES=1 ++ AC_DEFINE(CHERI_FFI_CLOSURES, 1, [Define if you wish to enable FFI closures on CHERI targets]) ++ AC_SUBST(CHERI_FFI_CLOSURES) ++ fi) ++ + if test x$TARGET = xX86_64; then + AC_CACHE_CHECK([toolchain supports unwind section type], + libffi_cv_as_x86_64_unwind_section_type, [ +diff --git a/include/ffi.h.in b/include/ffi.h.in +index 9fd7a59..42a0cff 100644 +--- a/include/ffi.h.in ++++ b/include/ffi.h.in +@@ -56,6 +56,10 @@ extern "C" { + + /* ---- System configuration information --------------------------------- */ + ++#if defined(__CHERI_PURE_CAPABILITY__) && !defined(CHERI_FFI_CLOSURES) ++#define CHERI_FFI_CLOSURES @CHERI_FFI_CLOSURES@ ++#endif ++ + #include <ffitarget.h> + + #ifndef LIBFFI_ASM +diff --git a/src/aarch64/ffitarget.h b/src/aarch64/ffitarget.h +index 91585c3..17e5b0b 100644 +--- a/src/aarch64/ffitarget.h ++++ b/src/aarch64/ffitarget.h +@@ -61,11 +61,12 @@ typedef enum ffi_abi + + /* ---- Definitions for closures ----------------------------------------- */ + +-#if defined(__CHERI_PURE_CAPABILITY__) ++#if defined(__CHERI_PURE_CAPABILITY__) && !defined(CHERI_FFI_CLOSURES) + /* Not implemented yet for purecap. */ + #define FFI_CLOSURES 0 + #else + #define FFI_CLOSURES 1 ++#warning "FFI_CLOSURES is enabled but this feature may not be supported for purecap" + #endif + #define FFI_NATIVE_RAW_API 0 + diff --git a/recipes-support/libffi/libffi/0001-arm-sysv-reverted-clang-VFP-mitigation.patch b/recipes-support/libffi/libffi/0001-arm-sysv-reverted-clang-VFP-mitigation.patch new file mode 100644 index 0000000..ffeee10 --- /dev/null +++ b/recipes-support/libffi/libffi/0001-arm-sysv-reverted-clang-VFP-mitigation.patch @@ -0,0 +1,102 @@ +From 35d6563ce07e700b54c185f2bc997f946ee18014 Mon Sep 17 00:00:00 2001 +From: Brett Warren brett.warren@arm.com +Date: Fri, 27 Nov 2020 15:28:42 +0000 +Subject: [PATCH] arm/sysv: reverted clang VFP mitigation + +Since commit e3d2812ce43940aacae5bab2d0e965278cb1e7ea, +seperate instructions were used when compiling under clang, +as clang didn't allow the directives at the time. This mitigation +now causes compilation to fail under clang 10, as described by +https://github.com/libffi/libffi/issues/607. Now that +clang supports the LDC and SDC instructions, this mitigation +has been reverted. + +Upstream-Status: Submitted [https://github.com/libffi/libffi/pull/747] +Signed-off-by: Brett Warren brett.warren@arm.com + +--- + src/arm/sysv.S | 33 --------------------------------- + 1 file changed, 33 deletions(-) + +diff --git a/src/arm/sysv.S b/src/arm/sysv.S +index fb36213..e4272a1 100644 +--- a/src/arm/sysv.S ++++ b/src/arm/sysv.S +@@ -142,13 +142,8 @@ ARM_FUNC_START(ffi_call_VFP) + + cmp r3, #3 @ load only d0 if possible + ite le +-#ifdef __clang__ +- vldrle d0, [r0] +- vldmgt r0, {d0-d7} +-#else + ldcle p11, cr0, [r0] @ vldrle d0, [r0] + ldcgt p11, cr0, [r0], {16} @ vldmgt r0, {d0-d7} +-#endif + add r0, r0, #64 @ discard the vfp register args + /* FALLTHRU */ + ARM_FUNC_END(ffi_call_VFP) +@@ -193,25 +188,13 @@ ARM_FUNC_START(ffi_call_SYSV) + #endif + 0: + E(ARM_TYPE_VFP_S) +-#ifdef __clang__ +- vstr s0, [r2] +-#else + stc p10, cr0, [r2] @ vstr s0, [r2] +-#endif + pop {fp,pc} + E(ARM_TYPE_VFP_D) +-#ifdef __clang__ +- vstr d0, [r2] +-#else + stc p11, cr0, [r2] @ vstr d0, [r2] +-#endif + pop {fp,pc} + E(ARM_TYPE_VFP_N) +-#ifdef __clang__ +- vstm r2, {d0-d3} +-#else + stc p11, cr0, [r2], {8} @ vstm r2, {d0-d3} +-#endif + pop {fp,pc} + E(ARM_TYPE_INT64) + str r1, [r2, #4] +@@ -320,11 +303,7 @@ ARM_FUNC_START(ffi_closure_VFP) + add ip, sp, #16 + sub sp, sp, #64+32 @ allocate frame + cfi_adjust_cfa_offset(64+32) +-#ifdef __clang__ +- vstm sp, {d0-d7} +-#else + stc p11, cr0, [sp], {16} @ vstm sp, {d0-d7} +-#endif + stmdb sp!, {ip,lr} + + /* See above. */ +@@ -358,25 +337,13 @@ ARM_FUNC_START_LOCAL(ffi_closure_ret) + cfi_rel_offset(lr, 4) + 0: + E(ARM_TYPE_VFP_S) +-#ifdef __clang__ +- vldr s0, [r2] +-#else + ldc p10, cr0, [r2] @ vldr s0, [r2] +-#endif + b call_epilogue + E(ARM_TYPE_VFP_D) +-#ifdef __clang__ +- vldr d0, [r2] +-#else + ldc p11, cr0, [r2] @ vldr d0, [r2] +-#endif + b call_epilogue + E(ARM_TYPE_VFP_N) +-#ifdef __clang__ +- vldm r2, {d0-d3} +-#else + ldc p11, cr0, [r2], {8} @ vldm r2, {d0-d3} +-#endif + b call_epilogue + E(ARM_TYPE_INT64) + ldr r1, [r2, #4] diff --git a/recipes-support/libffi/libffi/not-win32.patch b/recipes-support/libffi/libffi/not-win32.patch new file mode 100644 index 0000000..0ab9c2e --- /dev/null +++ b/recipes-support/libffi/libffi/not-win32.patch @@ -0,0 +1,35 @@ +From d240a878edf4b42fa4aa3aa01f464f2173f5db1e Mon Sep 17 00:00:00 2001 +From: Ross Burton ross.burton@intel.com +Date: Thu, 4 Feb 2016 16:22:50 +0000 +Subject: [PATCH] libffi: ensure sysroot paths are not in libffi.pc + +libffi's configure assumes that cross-compiled builds are complicated and +introduces convoluted path manipulation involving gcc search paths to the +install paths, resulting in paths like -L/usr/lib/../lib/ appearing in +libffi.pc. When pkg-config is then used to obtain the linker flags for libffi +it can't tell that this path is on the default search path and returns +$SYSROOT/usr/lib/../lib which then gets written all over the target sysroot. +This then means the sstate can't be shared and triggers QA errors. + +As this block is generally pointless, disable it. + +Upstream-Status: Inappropriate +Signed-off-by: Ross Burton ross.burton@intel.com + +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index fbc0125..9dd2078 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -401,7 +401,7 @@ AC_ARG_ENABLE(multi-os-directory, + + # These variables are only ever used when we cross-build to X86_WIN32. + # And we only support this with GCC, so... +-if test "x$GCC" = "xyes"; then ++if false; then + if test -n "$with_cross_host" && + test x"$with_cross_host" != x"no"; then + toolexecdir='${exec_prefix}'/'$(target_alias)'
From 729d4fb40929f301ab2d861368844e0a40afd842 Mon Sep 17 00:00:00 2001 From: Michael Cobb michael.cobb@iceotope.com Date: Wed, 21 Aug 2024 11:54:33 +0100 Subject: [PATCH 3/4] util-linux: enable building of libmount to support GLib
building GLib with `-Dlibmount=enabled` requires building libmount and libuuid
Signed-off-by: Michael Cobb michael.cobb@iceotope.com --- recipes-core/util-linux/util-linux-morello_2.37.4.bb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/recipes-core/util-linux/util-linux-morello_2.37.4.bb b/recipes-core/util-linux/util-linux-morello_2.37.4.bb index 98ad321..c3644cc 100644 --- a/recipes-core/util-linux/util-linux-morello_2.37.4.bb +++ b/recipes-core/util-linux/util-linux-morello_2.37.4.bb @@ -11,7 +11,7 @@ TOOLCHAIN = "${MORELLO_TOOLCHAIN}" PV = "2.37.4"
S = "${WORKDIR}/util-linux-${PV}" -EXTRA_OECONF += "--disable-all-programs --enable-libuuid" +EXTRA_OECONF += "--disable-all-programs --enable-libuuid --enable-libblkid --enable-libmount" LICENSE = "BSD-3-Clause"
do_install() { @@ -20,4 +20,4 @@ do_install() { oe_runmake DESTDIR=${install_dir} install rm -rf ${install_dir}${datadir} ${install_dir}${bindir} ${install_dir}${base_bindir} \ ${install_dir}${sbindir} ${install_dir}${base_sbindir} ${install_dir}${exec_prefix}/sbin -} \ No newline at end of file +}
From 021ac67cc29af0f48cebb755fe306339e75b5eb2 Mon Sep 17 00:00:00 2001 From: Michael Cobb michael.cobb@iceotope.com Date: Tue, 20 Aug 2024 15:34:52 +0100 Subject: [PATCH 4/4] glib-2.0: C64 initial commit
Initial commit of Glib 2.76.4 recipes
Requires util-linux to be built with `--enable-libmount` (see patch 3/4)
Signed-off-by: Michael Cobb michael.cobb@iceotope.com --- .../glib-2.0/glib-2.0-morello_2.76.4.bb | 58 +++ ...0001-Fix-DATADIRNAME-on-uclibc-Linux.patch | 30 ++ ...-gio-querymodules-as-libexec_PROGRAM.patch | 27 ++ ...ng-about-deprecated-paths-in-schemas.patch | 40 ++ ...-correctly-when-building-with-mingw3.patch | 81 ++++ .../0001-add-disable-cxx-build-option.patch | 36 ++ ...ces.c-comment-out-a-build-host-only-.patch | 28 ++ ...on-Run-atomics-test-on-clang-as-well.patch | 29 ++ ...-fix-iconv-libintl-library-not-found.patch | 61 +++ ...sable-testing-host-binaries-when-cro.patch | 59 +++ ...dcode-python-path-into-various-tools.patch | 44 +++ .../glib-2.0/glib-2.0/memory-monitor.patch | 362 ++++++++++++++++++ .../glib-2.0/glib-2.0/meson.cross.d/common | 3 + .../glib-2.0/meson.cross.d/common-glibc | 5 + .../glib-2.0/meson.cross.d/common-linux | 5 + .../glib-2.0/meson.cross.d/common-mingw | 6 + .../glib-2.0/meson.cross.d/common-morello | 3 + .../glib-2.0/meson.cross.d/common-musl | 6 + .../glib-2.0/glib-2.0/skip-timeout.patch | 30 ++ recipes-core/glib-2.0/glib-morello.inc | 170 ++++++++ 20 files changed, 1083 insertions(+) create mode 100644 recipes-core/glib-2.0/glib-2.0-morello_2.76.4.bb create mode 100644 recipes-core/glib-2.0/glib-2.0/0001-Fix-DATADIRNAME-on-uclibc-Linux.patch create mode 100644 recipes-core/glib-2.0/glib-2.0/0001-Install-gio-querymodules-as-libexec_PROGRAM.patch create mode 100644 recipes-core/glib-2.0/glib-2.0/0001-Remove-the-warning-about-deprecated-paths-in-schemas.patch create mode 100644 recipes-core/glib-2.0/glib-2.0/0001-Set-host_machine-correctly-when-building-with-mingw3.patch create mode 100644 recipes-core/glib-2.0/glib-2.0/0001-add-disable-cxx-build-option.patch create mode 100644 recipes-core/glib-2.0/glib-2.0/0001-gio-tests-resources.c-comment-out-a-build-host-only-.patch create mode 100644 recipes-core/glib-2.0/glib-2.0/0001-meson-Run-atomics-test-on-clang-as-well.patch create mode 100644 recipes-core/glib-2.0/glib-2.0/0002-fix-iconv-libintl-library-not-found.patch create mode 100644 recipes-core/glib-2.0/glib-2.0/0003-Add-option-to-disable-testing-host-binaries-when-cro.patch create mode 100644 recipes-core/glib-2.0/glib-2.0/0010-Do-not-hardcode-python-path-into-various-tools.patch create mode 100644 recipes-core/glib-2.0/glib-2.0/memory-monitor.patch create mode 100644 recipes-core/glib-2.0/glib-2.0/meson.cross.d/common create mode 100644 recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-glibc create mode 100644 recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-linux create mode 100644 recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-mingw create mode 100644 recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-morello create mode 100644 recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-musl create mode 100644 recipes-core/glib-2.0/glib-2.0/skip-timeout.patch create mode 100644 recipes-core/glib-2.0/glib-morello.inc
diff --git a/recipes-core/glib-2.0/glib-2.0-morello_2.76.4.bb b/recipes-core/glib-2.0/glib-2.0-morello_2.76.4.bb new file mode 100644 index 0000000..91f73c4 --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0-morello_2.76.4.bb @@ -0,0 +1,58 @@ +require glib-morello.inc + +PE = "1" + +SHRT_VER = "${@oe.utils.trim_version("${PV}", 2)}" +SRC_URI += "git://github.com/CTSRD-CHERI/glib.git;protocol=https;branch=2.76.4-cheriabi;rev=36ccd7a907969b31fdd8e26c1bfd8f539f0e92c3 \ + file://0001-Fix-DATADIRNAME-on-uclibc-Linux.patch \ + file://0001-Remove-the-warning-about-deprecated-paths-in-schemas.patch \ + file://0001-Install-gio-querymodules-as-libexec_PROGRAM.patch \ + file://0010-Do-not-hardcode-python-path-into-various-tools.patch \ + file://0001-Set-host_machine-correctly-when-building-with-mingw3.patch \ + file://0001-meson-Run-atomics-test-on-clang-as-well.patch \ + file://0001-gio-tests-resources.c-comment-out-a-build-host-only-.patch \ + file://memory-monitor.patch \ + file://skip-timeout.patch \ + file://0001-add-disable-cxx-build-option.patch \ + file://0002-fix-iconv-libintl-library-not-found.patch \ + file://0003-Add-option-to-disable-testing-host-binaries-when-cro.patch \ + " + +SRC_URI[sha256sum] = "b9cfb6f7a5bd5b31238fd5d56df226b2dda5ea37611475bf89f6a0f9400fe8bd" + +FILESEXTRAPATHS:prepend := "${THISDIR}/glib-2.0:" + +TOOLCHAIN = "${MORELLO_TOOLCHAIN}" + +CFLAGS += " -DNVALGRIND=1 -DG_ENABLE_EXPERIMENTAL_ABI_COMPILATION" + +# Find any meson cross files in FILESPATH that are relevant for the current +# build (using siteinfo) and add them to EXTRA_OEMESON. +inherit siteinfo +def find_meson_cross_files(d): + if bb.data.inherits_class('native', d): + return "" + + thisdir = os.path.normpath(d.getVar("THISDIR")) + import collections + sitedata = siteinfo_data(d) + # filename -> found + files = collections.OrderedDict() + for path in d.getVar("FILESPATH").split(":"): + for element in sitedata: + filename = os.path.normpath(os.path.join(path, "meson.cross.d", element)) + sanitized_path = filename.replace(thisdir, "${THISDIR}") + if sanitized_path == filename: + if os.path.exists(filename): + bb.error("Cannot add '%s' to --cross-file, because it's not relative to THISDIR '%s' and sstate signature would contain this full path" % (filename, thisdir)) + continue + files[filename.replace(thisdir, "${THISDIR}")] = os.path.exists(filename) + + items = ["--cross-file=" + k for k,v in files.items() if v] + d.appendVar("EXTRA_OEMESON", " " + " ".join(items)) + items = ["%s:%s" % (k, "True" if v else "False") for k,v in files.items()] + d.appendVarFlag("do_configure", "file-checksums", " " + " ".join(items)) + +python () { + find_meson_cross_files(d) +} diff --git a/recipes-core/glib-2.0/glib-2.0/0001-Fix-DATADIRNAME-on-uclibc-Linux.patch b/recipes-core/glib-2.0/glib-2.0/0001-Fix-DATADIRNAME-on-uclibc-Linux.patch new file mode 100644 index 0000000..b5a1933 --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/0001-Fix-DATADIRNAME-on-uclibc-Linux.patch @@ -0,0 +1,30 @@ +From 0d508b650cee67f887e307cb35f3863e872bdd8f Mon Sep 17 00:00:00 2001 +From: Khem Raj raj.khem@gmail.com +Date: Sat, 15 Mar 2014 22:42:29 -0700 +Subject: [PATCH] Fix DATADIRNAME on uclibc/Linux + +translation files are always installed under PREFIX/share/locale in uclibc +based systems therefore lets set DATADIRNAME to "share". + +Signed-off-by: Khem Raj raj.khem@gmail.com +Upstream-Status: Pending + +--- + m4macros/glib-gettext.m4 | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/m4macros/glib-gettext.m4 b/m4macros/glib-gettext.m4 +index df6fbf012..47db864eb 100644 +--- a/m4macros/glib-gettext.m4 ++++ b/m4macros/glib-gettext.m4 +@@ -293,6 +293,10 @@ msgstr "" + CATOBJEXT=.mo + DATADIRNAME=share + ;; ++ *-*-musl* | *-*-linux-uclibc*) ++ CATOBJEXT=.gmo ++ DATADIRNAME=share ++ ;; + *) + CATOBJEXT=.mo + DATADIRNAME=lib diff --git a/recipes-core/glib-2.0/glib-2.0/0001-Install-gio-querymodules-as-libexec_PROGRAM.patch b/recipes-core/glib-2.0/glib-2.0/0001-Install-gio-querymodules-as-libexec_PROGRAM.patch new file mode 100644 index 0000000..c425933 --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/0001-Install-gio-querymodules-as-libexec_PROGRAM.patch @@ -0,0 +1,27 @@ +From 40f9792a6f42733d09de1c2a71be8e9b51d36b9c Mon Sep 17 00:00:00 2001 +From: Jussi Kukkonen jussi.kukkonen@intel.com +Date: Tue, 22 Mar 2016 15:14:58 +0200 +Subject: [PATCH] Install gio-querymodules as libexec_PROGRAM + +We want to install this binary with the gio library, and debian +renamer does not cope with library packages with files in ${bindir} + +Signed-off-by: Jussi Kukkonen jussi.kukkonen@intel.com +Upstream-Status: Inappropriate [OE specific] + +--- + gio/meson.build | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/gio/meson.build b/gio/meson.build +index 462606f3b..0e084ff38 100644 +--- a/gio/meson.build ++++ b/gio/meson.build +@@ -1001,6 +1001,7 @@ gio_querymodules = executable('gio-querymodules', 'gio-querymodules.c', 'giomodu + c_args : gio_c_args, + # intl.lib is not compatible with SAFESEH + link_args : noseh_link_args, ++ install_dir: glib_libexecdir, + dependencies : [libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep]) + + glib_compile_schemas = executable('glib-compile-schemas', diff --git a/recipes-core/glib-2.0/glib-2.0/0001-Remove-the-warning-about-deprecated-paths-in-schemas.patch b/recipes-core/glib-2.0/glib-2.0/0001-Remove-the-warning-about-deprecated-paths-in-schemas.patch new file mode 100644 index 0000000..ea3199c --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/0001-Remove-the-warning-about-deprecated-paths-in-schemas.patch @@ -0,0 +1,40 @@ +From 0c5c690152375e0cd803229076dff40b96e51bbd Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin alex.kanavin@gmail.com +Date: Fri, 12 Jun 2015 17:08:46 +0300 +Subject: [PATCH] Remove the warning about deprecated paths in schemas + +Some schemas in gsettings-desktop-schemas (such as proxy and locale) +are still using deprecated paths, as of 3.16.1. This causes warning +messages, and meta/lib/oe/rootfs.py complaints about them. + +Upstream-Status: Inappropriate +Signed-off-by: Alexander Kanavin alex.kanavin@gmail.com + +--- + gio/glib-compile-schemas.c | 13 ------------- + 1 file changed, 13 deletions(-) + +diff --git a/gio/glib-compile-schemas.c b/gio/glib-compile-schemas.c +index 04ef40457..e791ce254 100644 +--- a/gio/glib-compile-schemas.c ++++ b/gio/glib-compile-schemas.c +@@ -1232,19 +1232,6 @@ parse_state_start_schema (ParseState *state, + return; + } + +- if (path && (g_str_has_prefix (path, "/apps/") || +- g_str_has_prefix (path, "/desktop/") || +- g_str_has_prefix (path, "/system/"))) +- { +- gchar *message = NULL; +- message = g_strdup_printf (_("Warning: Schema “%s” has path “%s”. " +- "Paths starting with " +- "“/apps/”, “/desktop/” or “/system/” are deprecated."), +- id, path); +- g_printerr ("%s\n", message); +- g_free (message); +- } +- + state->schema_state = schema_state_new (path, gettext_domain, + extends, extends_name, list_of); + diff --git a/recipes-core/glib-2.0/glib-2.0/0001-Set-host_machine-correctly-when-building-with-mingw3.patch b/recipes-core/glib-2.0/glib-2.0/0001-Set-host_machine-correctly-when-building-with-mingw3.patch new file mode 100644 index 0000000..ae5f616 --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/0001-Set-host_machine-correctly-when-building-with-mingw3.patch @@ -0,0 +1,81 @@ +From 11fd1fb8c2a861e6c6f4afa5163ee56616c81de2 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin alex.kanavin@gmail.com +Date: Wed, 13 Feb 2019 15:32:05 +0100 +Subject: [PATCH] Set host_machine correctly when building with mingw32 + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin alex.kanavin@gmail.com + +--- + gio/tests/meson.build | 8 ++++---- + glib/tests/meson.build | 2 +- + meson.build | 3 +++ + 3 files changed, 8 insertions(+), 5 deletions(-) + +diff --git a/gio/tests/meson.build b/gio/tests/meson.build +index 2631b1285..1c0016957 100644 +--- a/gio/tests/meson.build ++++ b/gio/tests/meson.build +@@ -29,7 +29,7 @@ endif + + test_cpp_args = test_c_args + +-if host_machine.system() == 'windows' ++if host_system == 'windows' + common_gio_tests_deps += [iphlpapi_dep, winsock2, cc.find_library ('secur32')] + endif + +@@ -225,7 +225,7 @@ if have_dbus_daemon + endif + + # Test programs buildable on UNIX only +-if host_machine.system() != 'windows' ++if host_system != 'windows' + gio_tests += { + 'file' : {}, + 'gdbus-peer-object-manager' : {}, +@@ -551,7 +551,7 @@ if host_machine.system() != 'windows' + endif # unix + + # Test programs buildable on Windows only +-if host_machine.system() == 'windows' ++if host_system == 'windows' + gio_tests += {'win32-streams' : {}} + endif + +@@ -621,7 +621,7 @@ if cc.get_id() != 'msvc' and cc.get_id() != 'clang-cl' + } + endif + +-if host_machine.system() != 'windows' ++if host_system != 'windows' + test_extra_programs += { + 'gdbus-example-unix-fd-client' : { + 'install' : false, +diff --git a/glib/tests/meson.build b/glib/tests/meson.build +index 72a6ff92b..223bd141c 100644 +--- a/glib/tests/meson.build ++++ b/glib/tests/meson.build +@@ -209,7 +209,7 @@ if glib_conf.has('HAVE_EVENTFD') + } + endif + +-if host_machine.system() == 'windows' ++if host_system == 'windows' + if winsock2.found() + glib_tests += { + 'gpoll' : { +diff --git a/meson.build b/meson.build +index a4a271a0a..13f7612e6 100644 +--- a/meson.build ++++ b/meson.build +@@ -52,6 +52,9 @@ else + endif + + host_system = host_machine.system() ++if host_system == 'mingw32' ++ host_system = 'windows' ++endif + + if host_system == 'darwin' + ios_test_code = '''#include <TargetConditionals.h> diff --git a/recipes-core/glib-2.0/glib-2.0/0001-add-disable-cxx-build-option.patch b/recipes-core/glib-2.0/glib-2.0/0001-add-disable-cxx-build-option.patch new file mode 100644 index 0000000..ebf9556 --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/0001-add-disable-cxx-build-option.patch @@ -0,0 +1,36 @@ +From a43ffde17d160e07364b8352925b1c31009b7dfe Mon Sep 17 00:00:00 2001 +From: Michael Cobb michael.cobb@iceotope.com +Date: Wed, 12 Jun 2024 10:13:50 +0100 +Subject: [PATCH] add disable cxx build option + +--- + meson.build | 2 +- + meson_options.txt | 5 +++++ + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/meson.build b/meson.build +index 17d7bc08e..73523db34 100644 +--- a/meson.build ++++ b/meson.build +@@ -19,7 +19,7 @@ foreach std : ['90', '99', '11', '17'] + endif + endforeach + +-have_cxx = add_languages('cpp', native: false, required: get_option('oss_fuzz').enabled()) ++have_cxx = not get_option('disable_cxx') and add_languages('cpp', native: false, required: get_option('oss_fuzz').enabled()) + if have_cxx + cxx = meson.get_compiler('cpp') + cxx_standards = {} +diff --git a/meson_options.txt b/meson_options.txt +index 517d5757c..09ddc9318 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -125,3 +125,8 @@ option('multiarch', + type : 'boolean', + value : false, + description : 'Install some helper executables in per-architecture locations') ++ ++option('disable_cxx', ++ type: 'boolean', ++ value: false, ++ description: 'Disable the use of C++ compiler for tests if your platform does not have a working C++ compiler') diff --git a/recipes-core/glib-2.0/glib-2.0/0001-gio-tests-resources.c-comment-out-a-build-host-only-.patch b/recipes-core/glib-2.0/glib-2.0/0001-gio-tests-resources.c-comment-out-a-build-host-only-.patch new file mode 100644 index 0000000..d59ba74 --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/0001-gio-tests-resources.c-comment-out-a-build-host-only-.patch @@ -0,0 +1,28 @@ +From bb250d23bfc333fe21ea7935ef8895382b616a93 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin alex.kanavin@gmail.com +Date: Wed, 8 Jan 2020 18:22:46 +0100 +Subject: [PATCH] gio/tests/resources.c: comment out a build host-only test + +This test requires building resources in a way that is +not cross-compatible (hardcodes ld and objcopy). + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin alex.kanavin@gmail.com + +--- + gio/tests/resources.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gio/tests/resources.c b/gio/tests/resources.c +index f567914d7..b21b6166d 100644 +--- a/gio/tests/resources.c ++++ b/gio/tests/resources.c +@@ -1068,7 +1068,7 @@ main (int argc, + g_test_add_func ("/resource/automatic", test_resource_automatic); + /* This only uses automatic resources too, so it tests the constructors and destructors */ + g_test_add_func ("/resource/module", test_resource_module); +- g_test_add_func ("/resource/binary-linked", test_resource_binary_linked); ++ /* g_test_add_func ("/resource/binary-linked", test_resource_binary_linked); */ + #endif + g_test_add_func ("/resource/uri/query-info", test_uri_query_info); + g_test_add_func ("/resource/uri/file", test_uri_file); diff --git a/recipes-core/glib-2.0/glib-2.0/0001-meson-Run-atomics-test-on-clang-as-well.patch b/recipes-core/glib-2.0/glib-2.0/0001-meson-Run-atomics-test-on-clang-as-well.patch new file mode 100644 index 0000000..c1760dc --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/0001-meson-Run-atomics-test-on-clang-as-well.patch @@ -0,0 +1,29 @@ +From 880bbcbb2d83c2ad9ef0f9342719c3a0fddf4aec Mon Sep 17 00:00:00 2001 +From: Khem Raj raj.khem@gmail.com +Date: Sat, 12 Oct 2019 17:46:26 -0700 +Subject: [PATCH] meson: Run atomics test on clang as well + +Fixes +./glib-2.62.1/glib/gatomic.c:675:2: error: G_ATOMIC_LOCK_FREE defined, but incapable of lock-free atomics. +^ + +Upstream-Status: Pending +Signed-off-by: Khem Raj raj.khem@gmail.com + +--- + meson.build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/meson.build b/meson.build +index 13f7612e6..17d7bc08e 100644 +--- a/meson.build ++++ b/meson.build +@@ -1905,7 +1905,7 @@ atomicdefine = ''' + # We know that we can always use real ("lock free") atomic operations with MSVC + if cc.get_id() == 'msvc' or cc.get_id() == 'clang-cl' or cc.links(atomictest, name : 'atomic ops') + have_atomic_lock_free = true +- if cc.get_id() == 'gcc' and not cc.compiles(atomicdefine, name : 'atomic ops define') ++ if (cc.get_id() == 'gcc' or cc.get_id() == 'clang') and not cc.compiles(atomicdefine, name : 'atomic ops define') + # Old gcc release may provide + # __sync_bool_compare_and_swap but doesn't define + # __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 diff --git a/recipes-core/glib-2.0/glib-2.0/0002-fix-iconv-libintl-library-not-found.patch b/recipes-core/glib-2.0/glib-2.0/0002-fix-iconv-libintl-library-not-found.patch new file mode 100644 index 0000000..d7d4991 --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/0002-fix-iconv-libintl-library-not-found.patch @@ -0,0 +1,61 @@ +From 8c7150407029080b7f8598559d43606f44e23c8b Mon Sep 17 00:00:00 2001 +From: Michael Cobb michael.cobb@iceotope.com +Date: Wed, 12 Jun 2024 10:15:39 +0100 +Subject: [PATCH] fix iconv/libintl library not found + +--- + meson.build | 19 +++++++++++++++++-- + meson_options.txt | 6 ++++++ + 2 files changed, 23 insertions(+), 2 deletions(-) + +diff --git a/meson.build b/meson.build +index 73523db34..31f90ece1 100644 +--- a/meson.build ++++ b/meson.build +@@ -2043,12 +2043,27 @@ glibconfig_conf.set10('G_HAVE_GROWING_STACK', growing_stack) + # We should never use the MinGW C library's iconv because it may not be + # available in the actual runtime environment. On Windows, we always use + # the built-in implementation ++iconv_opt = get_option('iconv') + if host_system == 'windows' ++ libiconv = [] + # We have a #include "win_iconv.c" in gconvert.c on Windows, so we don't need + # any external library for it +- libiconv = [] ++ if iconv_opt != 'auto' ++ warning('-Diconv was set to @0@, which was ignored') ++ endif + else +- libiconv = dependency('iconv') ++ found_iconv = false ++ if ['auto', 'libc'].contains(iconv_opt) and cc.has_function('iconv_open') ++ libiconv = [] ++ found_iconv = true ++ endif ++ if not found_iconv and ['auto', 'external'].contains(iconv_opt) and cc.has_header_symbol('iconv.h', 'iconv_open') ++ libiconv = [cc.find_library('iconv')] ++ found_iconv = true ++ endif ++ if not found_iconv ++ error('iconv implementation "@0@" not found'.format(iconv_opt)) ++ endif + endif + + pcre2_req = '>=10.32' +diff --git a/meson_options.txt b/meson_options.txt +index 09ddc9318..324351cf7 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -4,6 +4,12 @@ option('runtime_libdir', + description : 'install runtime libraries relative to libdir', + deprecated: true) + ++option('iconv', ++ type : 'combo', ++ choices : ['auto', 'libc', 'external'], ++ value : 'auto', ++ description : 'iconv implementation to use ('libc' = 'Part of the C library'; 'external' = 'External libiconv'; 'auto' = 'Auto-detect which iconv is available')') ++ + option('charsetalias_dir', + type : 'string', + value : '', diff --git a/recipes-core/glib-2.0/glib-2.0/0003-Add-option-to-disable-testing-host-binaries-when-cro.patch b/recipes-core/glib-2.0/glib-2.0/0003-Add-option-to-disable-testing-host-binaries-when-cro.patch new file mode 100644 index 0000000..c7b8928 --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/0003-Add-option-to-disable-testing-host-binaries-when-cro.patch @@ -0,0 +1,59 @@ +From 115959af31829340ea9fbab37e44e879e481f6b6 Mon Sep 17 00:00:00 2001 +From: Michael Cobb michael.cobb@iceotope.com +Date: Wed, 12 Jun 2024 11:22:54 +0100 +Subject: [PATCH] Add option to disable testing host binaries when + cross-compiling + +Fixes the 'frexpl() is missing or broken beyond repair' build error due +to meson trying to run tests under qemu + +Signed-off-by: Michael Cobb michael.cobb@iceotope.com + +--- + meson.build | 5 +++-- + meson_options.txt | 5 +++++ + 2 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/meson.build b/meson.build +index 31f90ece1..ebb7b0b5b 100644 +--- a/meson.build ++++ b/meson.build +@@ -32,7 +32,7 @@ if have_cxx + endforeach + endif + +-cc_can_run = meson.can_run_host_binaries() ++cc_can_run = get_option('can_run_host_binaries') and meson.can_run_host_binaries() + + if cc.get_argument_syntax() == 'msvc' + # Ignore several spurious warnings for things glib does very commonly +@@ -1445,7 +1445,7 @@ endif + # library type. Test for the warnings and set gint64 to whichever + # works. + if long_long_size == long_size +- if cc.compiles('''#if defined(_AIX) && !defined(__GNUC__) ++ r = cc.compiles('''#if defined(_AIX) && !defined(__GNUC__) + #pragma options langlvl=stdc99 + #endif + #pragma GCC diagnostic error "-Wincompatible-pointer-types" +@@ -1456,6 +1456,7 @@ if long_long_size == long_size + long *i2 = &i1; + return 1; + }''', name : 'int64_t is long') ++ if r + int64_t_typedef = 'long' + elif cc.compiles('''#if defined(_AIX) && !defined(__GNUC__) + #pragma options langlvl=stdc99 +diff --git a/meson_options.txt b/meson_options.txt +index 324351cf7..03975ed43 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -136,3 +136,8 @@ option('disable_cxx', + type: 'boolean', + value: false, + description: 'Disable the use of C++ compiler for tests if your platform does not have a working C++ compiler') ++ ++option('can_run_host_binaries', ++ type: 'boolean', ++ value: true, ++ description: 'Disable if cross-compiling and your platform does not have a way to run compiled host binaries') diff --git a/recipes-core/glib-2.0/glib-2.0/0010-Do-not-hardcode-python-path-into-various-tools.patch b/recipes-core/glib-2.0/glib-2.0/0010-Do-not-hardcode-python-path-into-various-tools.patch new file mode 100644 index 0000000..db25ed4 --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/0010-Do-not-hardcode-python-path-into-various-tools.patch @@ -0,0 +1,44 @@ +From a1eddf4f6071e060f61eeeb1c0de06eae8a882ac Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin alex.kanavin@gmail.com +Date: Tue, 3 Oct 2017 10:45:55 +0300 +Subject: [PATCH] Do not hardcode python path into various tools + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin alex.kanavin@gmail.com + +--- + gio/gdbus-2.0/codegen/gdbus-codegen.in | 2 +- + gobject/glib-genmarshal.in | 2 +- + gobject/glib-mkenums.in | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/gio/gdbus-2.0/codegen/gdbus-codegen.in b/gio/gdbus-2.0/codegen/gdbus-codegen.in +index 67d367543..4e92a7afa 100755 +--- a/gio/gdbus-2.0/codegen/gdbus-codegen.in ++++ b/gio/gdbus-2.0/codegen/gdbus-codegen.in +@@ -1,4 +1,4 @@ +-#!/usr/bin/env @PYTHON@ ++#!/usr/bin/env python3 + + # GDBus - GLib D-Bus Library + # +diff --git a/gobject/glib-genmarshal.in b/gobject/glib-genmarshal.in +index aa5af43bd..56e8e2ec4 100755 +--- a/gobject/glib-genmarshal.in ++++ b/gobject/glib-genmarshal.in +@@ -1,4 +1,4 @@ +-#!/usr/bin/env @PYTHON@ ++#!/usr/bin/env python3 + + # pylint: disable=too-many-lines, missing-docstring, invalid-name + +diff --git a/gobject/glib-mkenums.in b/gobject/glib-mkenums.in +index e0c0b39af..6ed03893d 100755 +--- a/gobject/glib-mkenums.in ++++ b/gobject/glib-mkenums.in +@@ -1,4 +1,4 @@ +-#!/usr/bin/env @PYTHON@ ++#!/usr/bin/env python3 + + # If the code below looks horrible and unpythonic, do not panic. + # diff --git a/recipes-core/glib-2.0/glib-2.0/memory-monitor.patch b/recipes-core/glib-2.0/glib-2.0/memory-monitor.patch new file mode 100644 index 0000000..fc069eb --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/memory-monitor.patch @@ -0,0 +1,362 @@ +From e074461e828d47edc00fd912f8b94eb95685bc82 Mon Sep 17 00:00:00 2001 +From: Philip Withnall philip@tecnocode.co.uk +Date: Tue, 23 Jan 2024 11:16:52 +0000 +Subject: [PATCH] Merge branch '2887-memory-monitor-tests' into 'main' + +tests: Fix race condition in memory-monitor-dbus.test + +Closes #2887 + +See merge request GNOME/glib!3844 + +Hopefully these commits fix the occasional failures we've been seeing: +https://bugzilla.yoctoproject.org/show_bug.cgi?id=15362 + +Upstream-Status: Backport +Signed-off-by: Ross Burton ross.burton@arm.com + +--- + gio/tests/memory-monitor-dbus.py.in | 64 +++++++++++++------- + gio/tests/memory-monitor-portal.py.in | 54 ++++++++++------- + gio/tests/power-profile-monitor-dbus.py.in | 35 ++++++----- + gio/tests/power-profile-monitor-portal.py.in | 34 ++++++----- + 4 files changed, 113 insertions(+), 74 deletions(-) + +diff --git a/gio/tests/memory-monitor-dbus.py.in b/gio/tests/memory-monitor-dbus.py.in +index bf3291847..7aae01e70 100755 +--- a/gio/tests/memory-monitor-dbus.py.in ++++ b/gio/tests/memory-monitor-dbus.py.in +@@ -16,7 +16,6 @@ import sys + import subprocess + import fcntl + import os +-import time + + import taptestrunner + +@@ -57,53 +56,74 @@ try: + fcntl.fcntl(self.p_mock.stdout, fcntl.F_SETFL, flags | os.O_NONBLOCK) + self.last_warning = -1 + self.dbusmock = dbus.Interface(self.obj_lmm, dbusmock.MOCK_IFACE) ++ ++ try: ++ self.wait_for_bus_object('org.freedesktop.LowMemoryMonitor', ++ '/org/freedesktop/LowMemoryMonitor', ++ system_bus=True) ++ except: ++ raise ++ + self.memory_monitor = Gio.MemoryMonitor.dup_default() ++ assert("GMemoryMonitorDBus" in str(self.memory_monitor)) + self.memory_monitor.connect("low-memory-warning", self.memory_warning_cb) + self.mainloop = GLib.MainLoop() + self.main_context = self.mainloop.get_context() + ++ # The LowMemoryMonitor API is stateless: it doesn’t expose any ++ # properties, just a warning signal. Emit the signal in a loop until ++ # the GMemoryMonitor instance has initialised and synchronised to ++ # the right state. ++ def emit_warning(level): ++ self.dbusmock.EmitWarning(level) ++ return GLib.SOURCE_CONTINUE ++ ++ idle_id = GLib.idle_add(emit_warning, 0) ++ while self.last_warning != 0: ++ self.main_context.iteration(True) ++ GLib.source_remove(idle_id) ++ + def tearDown(self): + self.p_mock.terminate() + self.p_mock.wait() + +- def assertEventually(self, condition, message=None, timeout=50): ++ def assertEventually(self, condition, message=None, timeout=5): + '''Assert that condition function eventually returns True. + +- Timeout is in deciseconds, defaulting to 50 (5 seconds). message is ++ Timeout is in seconds, defaulting to 5 seconds. message is + printed on failure. + ''' +- while timeout >= 0: +- context = GLib.MainContext.default() +- while context.iteration(False): +- pass +- if condition(): +- break +- timeout -= 1 +- time.sleep(0.1) +- else: +- self.fail(message or 'timed out waiting for ' + str(condition)) ++ if not message: ++ message = 'timed out waiting for ' + str(condition) ++ ++ def timed_out_cb(message): ++ self.fail(message) ++ return GLib.SOURCE_REMOVE ++ ++ timeout_source = GLib.timeout_source_new_seconds(timeout) ++ timeout_source.set_callback(timed_out_cb, message) ++ timeout_source.attach(self.main_context) ++ ++ while not condition(): ++ self.main_context.iteration(True) ++ ++ timeout_source.destroy() + + def memory_warning_cb(self, monitor, level): ++ print("Received memory warning signal, level", level) + self.last_warning = level + self.main_context.wakeup() + + def test_low_memory_warning_signal(self): + '''LowMemoryWarning signal''' + +- # Wait 2 seconds +- timeout = 2 +- while timeout > 0: +- time.sleep(0.5) +- timeout -= 0.5 +- self.main_context.iteration(False) +- + self.dbusmock.EmitWarning(100) + # Wait 2 seconds or until warning +- self.assertEventually(lambda: self.last_warning == 100, "'100' low-memory warning not received", 20) ++ self.assertEventually(lambda: self.last_warning == 100, "'100' low-memory warning not received", 2) + + self.dbusmock.EmitWarning(255) + # Wait 2 seconds or until warning +- self.assertEventually(lambda: self.last_warning == 255, "'255' low-memory warning not received", 20) ++ self.assertEventually(lambda: self.last_warning == 255, "'255' low-memory warning not received", 2) + + except ImportError as e: + @unittest.skip("Cannot import %s" % e.name) +diff --git a/gio/tests/memory-monitor-portal.py.in b/gio/tests/memory-monitor-portal.py.in +index 748cee850..f570508f9 100755 +--- a/gio/tests/memory-monitor-portal.py.in ++++ b/gio/tests/memory-monitor-portal.py.in +@@ -16,7 +16,6 @@ import sys + import subprocess + import fcntl + import os +-import time + + import taptestrunner + +@@ -80,26 +79,44 @@ try: + self.mainloop = GLib.MainLoop() + self.main_context = self.mainloop.get_context() + ++ # The LowMemoryMonitor API is stateless: it doesn’t expose any ++ # properties, just a warning signal. Emit the signal in a loop until ++ # the GMemoryMonitor instance has initialised and synchronised to ++ # the right state. ++ def emit_warning(level): ++ self.dbusmock.EmitWarning(level) ++ return GLib.SOURCE_CONTINUE ++ ++ idle_id = GLib.idle_add(self.emit_warning, 0) ++ while self.last_warning != 0: ++ self.main_context.iteration(True) ++ GLib.source_remove(idle_id) ++ + def tearDown(self): + self.p_mock.terminate() + self.p_mock.wait() + +- def assertEventually(self, condition, message=None, timeout=50): ++ def assertEventually(self, condition, message=None, timeout=5): + '''Assert that condition function eventually returns True. + +- Timeout is in deciseconds, defaulting to 50 (5 seconds). message is ++ Timeout is in seconds, defaulting to 5 seconds. message is + printed on failure. + ''' +- while timeout >= 0: +- context = GLib.MainContext.default() +- while context.iteration(False): +- pass +- if condition(): +- break +- timeout -= 1 +- time.sleep(0.1) +- else: +- self.fail(message or 'timed out waiting for ' + str(condition)) ++ if not message: ++ message = 'timed out waiting for ' + str(condition) ++ ++ def timed_out_cb(message): ++ self.fail(message) ++ return GLib.SOURCE_REMOVE ++ ++ timeout_source = GLib.timeout_source_new_seconds(timeout) ++ timeout_source.set_callback(timed_out_cb, message) ++ timeout_source.attach(self.main_context) ++ ++ while not condition(): ++ self.main_context.iteration(True) ++ ++ timeout_source.destroy() + + def portal_memory_warning_cb(self, monitor, level): + self.last_warning = level +@@ -108,20 +125,13 @@ try: + def test_low_memory_warning_portal_signal(self): + '''LowMemoryWarning signal''' + +- # Wait 2 seconds +- timeout = 2 +- while timeout > 0: +- time.sleep(0.5) +- timeout -= 0.5 +- self.main_context.iteration(False) +- + self.dbusmock.EmitWarning(100) + # Wait 2 seconds or until warning +- self.assertEventually(lambda: self.last_warning == 100, "'100' low-memory warning not received", 20) ++ self.assertEventually(lambda: self.last_warning == 100, "'100' low-memory warning not received", 2) + + self.dbusmock.EmitWarning(255) + # Wait 2 seconds or until warning +- self.assertEventually(lambda: self.last_warning == 255, "'255' low-memory warning not received", 20) ++ self.assertEventually(lambda: self.last_warning == 255, "'255' low-memory warning not received", 2) + + except ImportError as e: + @unittest.skip("Cannot import %s" % e.name) +diff --git a/gio/tests/power-profile-monitor-dbus.py.in b/gio/tests/power-profile-monitor-dbus.py.in +index 06e594f4a..f955afc80 100755 +--- a/gio/tests/power-profile-monitor-dbus.py.in ++++ b/gio/tests/power-profile-monitor-dbus.py.in +@@ -16,7 +16,6 @@ import sys + import subprocess + import fcntl + import os +-import time + + import taptestrunner + +@@ -58,6 +57,7 @@ try: + self.power_saver_enabled = False + self.dbus_props = dbus.Interface(self.obj_ppd, dbus.PROPERTIES_IFACE) + self.power_profile_monitor = Gio.PowerProfileMonitor.dup_default() ++ assert("GPowerProfileMonitorDBus" in str(self.power_profile_monitor)) + self.power_profile_monitor.connect("notify::power-saver-enabled", self.power_saver_enabled_cb) + self.mainloop = GLib.MainLoop() + self.main_context = self.mainloop.get_context() +@@ -66,22 +66,27 @@ try: + self.p_mock.terminate() + self.p_mock.wait() + +- def assertEventually(self, condition, message=None, timeout=50): ++ def assertEventually(self, condition, message=None, timeout=5): + '''Assert that condition function eventually returns True. + +- Timeout is in deciseconds, defaulting to 50 (5 seconds). message is ++ Timeout is in seconds, defaulting to 5 seconds. message is + printed on failure. + ''' +- while timeout >= 0: +- context = GLib.MainContext.default() +- while context.iteration(False): +- pass +- if condition(): +- break +- timeout -= 1 +- time.sleep(0.1) +- else: +- self.fail(message or 'timed out waiting for ' + str(condition)) ++ if not message: ++ message = 'timed out waiting for ' + str(condition) ++ ++ def timed_out_cb(message): ++ self.fail(message) ++ return GLib.SOURCE_REMOVE ++ ++ timeout_source = GLib.timeout_source_new_seconds(timeout) ++ timeout_source.set_callback(timed_out_cb, message) ++ timeout_source.attach(self.main_context) ++ ++ while not condition(): ++ self.main_context.iteration(True) ++ ++ timeout_source.destroy() + + def power_saver_enabled_cb(self, spec, data): + self.power_saver_enabled = self.power_profile_monitor.get_power_saver_enabled() +@@ -92,10 +97,10 @@ try: + + self.assertEqual(self.power_profile_monitor.get_power_saver_enabled(), False) + self.dbus_props.Set('net.hadess.PowerProfiles', 'ActiveProfile', dbus.String('power-saver', variant_level=1)) +- self.assertEventually(lambda: self.power_saver_enabled == True, "power-saver didn't become enabled", 10) ++ self.assertEventually(lambda: self.power_saver_enabled == True, "power-saver didn't become enabled", 1) + + self.dbus_props.Set('net.hadess.PowerProfiles', 'ActiveProfile', dbus.String('balanced', variant_level=1)) +- self.assertEventually(lambda: self.power_saver_enabled == False, "power-saver didn't become disabled", 10) ++ self.assertEventually(lambda: self.power_saver_enabled == False, "power-saver didn't become disabled", 1) + + except ImportError as e: + @unittest.skip("Cannot import %s" % e.name) +diff --git a/gio/tests/power-profile-monitor-portal.py.in b/gio/tests/power-profile-monitor-portal.py.in +index 09e9a450d..ad2abf621 100755 +--- a/gio/tests/power-profile-monitor-portal.py.in ++++ b/gio/tests/power-profile-monitor-portal.py.in +@@ -16,7 +16,6 @@ import sys + import subprocess + import fcntl + import os +-import time + + import taptestrunner + +@@ -90,22 +89,27 @@ try: + self.p_mock.terminate() + self.p_mock.wait() + +- def assertEventually(self, condition, message=None, timeout=50): ++ def assertEventually(self, condition, message=None, timeout=5): + '''Assert that condition function eventually returns True. + +- Timeout is in deciseconds, defaulting to 50 (5 seconds). message is ++ Timeout is in seconds, defaulting to 5 seconds. message is + printed on failure. + ''' +- while timeout >= 0: +- context = GLib.MainContext.default() +- while context.iteration(False): +- pass +- if condition(): +- break +- timeout -= 1 +- time.sleep(0.1) +- else: +- self.fail(message or 'timed out waiting for ' + str(condition)) ++ if not message: ++ message = 'timed out waiting for ' + str(condition) ++ ++ def timed_out_cb(message): ++ self.fail(message) ++ return GLib.SOURCE_REMOVE ++ ++ timeout_source = GLib.timeout_source_new_seconds(timeout) ++ timeout_source.set_callback(timed_out_cb, message) ++ timeout_source.attach(self.main_context) ++ ++ while not condition(): ++ self.main_context.iteration(True) ++ ++ timeout_source.destroy() + + def power_saver_enabled_cb(self, spec, data): + self.power_saver_enabled = self.power_profile_monitor.get_power_saver_enabled() +@@ -116,10 +120,10 @@ try: + + self.assertEqual(self.power_profile_monitor.get_power_saver_enabled(), False) + self.dbus_props.Set('net.hadess.PowerProfiles', 'ActiveProfile', dbus.String('power-saver', variant_level=1)) +- self.assertEventually(lambda: self.power_saver_enabled == True, "power-saver didn't become enabled", 10) ++ self.assertEventually(lambda: self.power_saver_enabled == True, "power-saver didn't become enabled", 1) + + self.dbus_props.Set('net.hadess.PowerProfiles', 'ActiveProfile', dbus.String('balanced', variant_level=1)) +- self.assertEventually(lambda: self.power_saver_enabled == False, "power-saver didn't become disabled", 10) ++ self.assertEventually(lambda: self.power_saver_enabled == False, "power-saver didn't become disabled", 1) + + def test_power_profile_power_saver_enabled_portal_default(self): + '''power-saver-enabled property default value''' diff --git a/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common b/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common new file mode 100644 index 0000000..0d7c5fa --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common @@ -0,0 +1,3 @@ +[properties] +# On all known supported architectures the stack grows down +growing_stack = false diff --git a/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-glibc b/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-glibc new file mode 100644 index 0000000..c4648f5 --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-glibc @@ -0,0 +1,5 @@ +[properties] +have_c99_vsnprintf = true +have_c99_snprintf = true +have_unix98_printf = true +va_val_copy = true diff --git a/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-linux b/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-linux new file mode 100644 index 0000000..adad7e6 --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-linux @@ -0,0 +1,5 @@ +[properties] +have_proc_self_cmdline = true + +[binaries] +env = '/usr/bin/env' diff --git a/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-mingw b/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-mingw new file mode 100644 index 0000000..75f911b --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-mingw @@ -0,0 +1,6 @@ +[properties] +have_c99_vsnprintf = false +have_c99_snprintf = false +have_unix98_printf = false +va_val_copy = true +have_proc_self_cmdline = false diff --git a/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-morello b/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-morello new file mode 100644 index 0000000..ce97555 --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-morello @@ -0,0 +1,3 @@ +[properties] +can_run_host_binaries = false +skip_sanity_check = true diff --git a/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-musl b/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-musl new file mode 100644 index 0000000..3049e51 --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-musl @@ -0,0 +1,6 @@ +[properties] +have_c99_vsnprintf = true +have_c99_snprintf = true +have_unix98_printf = true +va_val_copy = true +have_strlcpy = true diff --git a/recipes-core/glib-2.0/glib-2.0/skip-timeout.patch b/recipes-core/glib-2.0/glib-2.0/skip-timeout.patch new file mode 100644 index 0000000..97d07ff --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/skip-timeout.patch @@ -0,0 +1,30 @@ +From 925243c78f5e3a399be35ed036b47dc8e257c9a1 Mon Sep 17 00:00:00 2001 +From: Ross Burton ross.burton@arm.com +Date: Thu, 28 Mar 2024 16:27:09 +0000 +Subject: [PATCH] Skip /timeout/rounding test + +This test is sensitive to load because it expects certain timeout operations +to succeed in specific time periods. Whilst these timeouts are fairly large, +they're still exceeded inside a qemu on a loaded system. + +https://bugzilla.yoctoproject.org/show_bug.cgi?id=14464 + +Upstream-Status: Inappropriate [OE-specific] +Signed-off-by: Ross Burton ross.burton@arm.com + +--- + glib/tests/timeout.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/glib/tests/timeout.c b/glib/tests/timeout.c +index acbb8f3e1..cdca6bb1d 100644 +--- a/glib/tests/timeout.c ++++ b/glib/tests/timeout.c +@@ -194,7 +194,6 @@ main (int argc, char *argv[]) + g_test_add_func ("/timeout/seconds", test_seconds); + g_test_add_func ("/timeout/weeks-overflow", test_weeks_overflow); + g_test_add_func ("/timeout/far-future-ready-time", test_far_future_ready_time); +- g_test_add_func ("/timeout/rounding", test_rounding); + + return g_test_run (); + } diff --git a/recipes-core/glib-2.0/glib-morello.inc b/recipes-core/glib-2.0/glib-morello.inc new file mode 100644 index 0000000..2924798 --- /dev/null +++ b/recipes-core/glib-2.0/glib-morello.inc @@ -0,0 +1,170 @@ +inherit meson gettext gtk-doc pkgconfig upstream-version-is-even bash-completion manpages gobject-introspection-data purecap-sysroot + +MORELLO_SRC = "poky/meta/recipes-core/glib-2.0/*" + +SUMMARY = "A general-purpose utility library" +DESCRIPTION = "GLib is a general-purpose utility library, which provides many useful data types, macros, type conversions, string utilities, file utilities, a main loop abstraction, and so on." +HOMEPAGE = "https://developer.gnome.org/glib/" + +# pcre is under BSD; +# docs/reference/COPYING is with a 'public domain'-like license! +LICENSE = "LGPL-2.1-or-later & BSD-3-Clause & PD" +LIC_FILES_CHKSUM = "file://COPYING;md5=41890f71f740302b785c27661123bff5 \ + file://glib/glib.h;beginline=4;endline=17;md5=72f7cc2847407f65d8981ef112e4e630 \ + file://LICENSES/LGPL-2.1-or-later.txt;md5=41890f71f740302b785c27661123bff5 \ + file://gmodule/gmodule.h;beginline=4;endline=17;md5=72f7cc2847407f65d8981ef112e4e630 \ + file://docs/reference/COPYING;md5=f51a5100c17af6bae00735cd791e1fcc" +BUGTRACKER = "http://bugzilla.gnome.org" +SECTION = "libs" + +CVE_PRODUCT = "glib" + +DEPENDS = "glib-2.0-native \ + virtual/libintl \ + virtual/libiconv \ + libffi-morello \ + libpcre2-morello \ + zlib-morello \ + python3-packaging-native \ + util-linux-morello \ + " + +CODEGEN_PYTHON_RDEPENDS = "python3 python3-packaging python3-xml" +CODEGEN_PYTHON_RDEPENDS:mingw32 = "" + +RDEPENDS:${PN}-codegen += "${CODEGEN_PYTHON_RDEPENDS}" + +RDEPENDS:${PN}:append = "\ + util-linux-morello \ + zlib-morello \ + " + +PACKAGES += "${PN}-codegen ${PN}-utils" + +LEAD_SONAME = "libglib-2.0.*" + +DEPENDS:append:class-target = "${@' gtk-doc' if d.getVar('GTKDOC_ENABLED') == 'True' else ''}" + +GTKDOC_MESON_OPTION = "gtk_doc" + +S = "${WORKDIR}/git" + +# Allow the configure task to pull in git submodules over the network +do_configure[network] = "1" + +PACKAGECONFIG ??= "libmount \ + ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)}" + +PACKAGECONFIG[libmount] = "-Dlibmount=enabled,-Dlibmount=disabled,util-linux-morello" +PACKAGECONFIG[manpages] = "-Dman=true, -Dman=false, libxslt-native xmlto-native" +PACKAGECONFIG[libelf] = "-Dlibelf=enabled,-Dlibelf=disabled,elfutils" +PACKAGECONFIG[tests] = "-Dinstalled_tests=true,-Dinstalled_tests=false," +PACKAGECONFIG[selinux] = "-Dselinux=enabled,-Dselinux=disabled,libselinux" + +EXTRA_OEMESON += " -Ddtrace=false -Dsystemtap=false -Dtests=true -Dinstalled_tests=true" +EXTRA_OEMESON += " -Ddisable_cxx=true -Dcan_run_host_binaries=false --cross-file=${THISDIR}/glib-2.0/meson.cross.d/common-morello " + +do_configure:prepend() { + sed -i -e '1s,#!.*,#!${USRBINPATH}/env python3,' ${S}/gio/gdbus-2.0/codegen/gdbus-codegen.in +} + +FILES:${PN} = "${libdir}/lib*${SOLIBS} \ + ${libdir}/gio \ + ${libexecdir}/*gio-querymodules \ + ${libexecdir}/*gio-launch-desktop \ + ${datadir}/glib-2.0/schemas \ + " + +FILES:${PN}-utils += "${bindir}/glib-genmarshal \ + ${bindir}/glib-gettextize \ + ${bindir}/glib-mkenums \ + ${bindir}/glib-compile-resources \ + " + +FILES:${PN}-dev += "${libdir}/glib-2.0/include \ + ${libdir}/gio/modules/lib*${SOLIBSDEV} \ + ${libdir}/gio/modules/*.la \ + ${datadir}/glib-2.0/gettext/po/Makefile.in.in \ + ${datadir}/glib-2.0/schemas/gschema.dtd \ + ${datadir}/glib-2.0/valgrind/glib.supp \ + ${datadir}/gettext/its \ + ${datadir}/glib-2.0/dtds/* \ + " + +FILES:${PN}-dbg += "${datadir}/glib-2.0/gdb \ + ${datadir}/gdb \ + " + +FILES:${PN}-codegen = "${datadir}/glib-2.0/codegen/*.py \ + ${bindir}/gdbus-codegen \ + " + +FILES:${PN}-utils = "${bindir}/*" + +SHAREDMIMEDEP = "shared-mime-info" +# When cross compiling for Windows we don't want to include this +SHAREDMIMEDEP:mingw32 = "" + +RRECOMMENDS:${PN} += "${SHAREDMIMEDEP}" + +ARM_INSTRUCTION_SET:armv4 = "arm" +ARM_INSTRUCTION_SET:armv5 = "arm" +# Valgrind runtime detection works using hand-written assembly, which +# doesn't support mips16e +CPPFLAGS:append:class-target:mips16e = " -DNVALGRIND=1" + +# GLib generally requires gettext to be present so for USE_NLS to yes. For +# native builds as i18n is disabled globally we have to add a gettext-native dependency. +USE_NLS:class-target = "yes" + +EXEEXT = "" +EXEEXT:mingw32 = ".exe" + +do_install() { + meson install --destdir "${D}" --no-rebuild +} + +do_install:append () { + if [ -f ${D}${bindir}/gtester-report ]; then + sed ${D}${bindir}/gtester-report -i -e '1s|^#!.*|#!/usr/bin/env python3|' + fi + + # Remove some unpackaged files + rm -rf ${D}${datadir}/glib-2.0/codegen/__pycache__ + rm -f ${D}${datadir}/glib-2.0/codegen/*.pyc + rm -f ${D}${datadir}/glib-2.0/codegen/*.pyo + + if [ -e ${D}${libdir}/charset.alias ]; then + rm -f ${D}${libdir}/charset.alias + fi + + # Make sure gio-querymodules is unique among multilibs + if test "x${MLPREFIX}" != "x"; then + mv ${D}${libexecdir}/gio-querymodules${EXEEXT} ${D}${libexecdir}/${MLPREFIX}gio-querymodules${EXEEXT} + fi + # Autotools does this, meson does not + mkdir -p ${D}${libdir}/gio/modules +} + +do_install:append:class-target () { + # Tests are only installed on targets, not native builds. Separating this out + # keeps glib-2.0-native from depending on DISTRO_FEATURES + if [ -f ${D}${datadir}/installed-tests/glib/gdbus-serialization.test ]; then + if ${@bb.utils.contains("DISTRO_FEATURES", "x11", "false", "true", d)}; then + rm ${D}${datadir}/installed-tests/glib/gdbus-serialization.test + fi + fi + if [ -f ${D}${datadir}/installed-tests/glib/static-link.test ]; then + if test "x${MLPREFIX}" != "x"; then + mv ${D}${datadir}/installed-tests/glib/static-link.test ${D}${datadir}/installed-tests/glib/${MLPREFIX}static-link.test + fi + fi + # https://gitlab.gnome.org/GNOME/glib/-/issues/2810 + rm -f ${D}${datadir}/installed-tests/glib/thread-pool-slow.test +} + +# As we do not build python3 for windows, makes no sense to ship the script that's using it +do_install:append:mingw32() { + rm -f ${D}${bindir}/gtester-report +} +
Hi Michael,
Many thanks for the patches, LGTM.
Kind regards,
On Thu, 5 Sept 2024 at 10:16, Michael Cobb michael.cobb@iceotope.com wrote:
From 021ac67cc29af0f48cebb755fe306339e75b5eb2 Mon Sep 17 00:00:00 2001
From: Michael Cobb michael.cobb@iceotope.com Date: Tue, 20 Aug 2024 15:34:52 +0100 Subject: [PATCH 4/4] glib-2.0: C64 initial commit
Initial commit of Glib 2.76.4 recipes
Requires util-linux to be built with `--enable-libmount` (see patch 3/4)
Signed-off-by: Michael Cobb michael.cobb@iceotope.com
.../glib-2.0/glib-2.0-morello_2.76.4.bb | 58 +++ ...0001-Fix-DATADIRNAME-on-uclibc-Linux.patch | 30 ++ ...-gio-querymodules-as-libexec_PROGRAM.patch | 27 ++ ...ng-about-deprecated-paths-in-schemas.patch | 40 ++ ...-correctly-when-building-with-mingw3.patch | 81 ++++ .../0001-add-disable-cxx-build-option.patch | 36 ++ ...ces.c-comment-out-a-build-host-only-.patch | 28 ++ ...on-Run-atomics-test-on-clang-as-well.patch | 29 ++ ...-fix-iconv-libintl-library-not-found.patch | 61 +++ ...sable-testing-host-binaries-when-cro.patch | 59 +++ ...dcode-python-path-into-various-tools.patch | 44 +++ .../glib-2.0/glib-2.0/memory-monitor.patch | 362 ++++++++++++++++++ .../glib-2.0/glib-2.0/meson.cross.d/common | 3 + .../glib-2.0/meson.cross.d/common-glibc | 5 + .../glib-2.0/meson.cross.d/common-linux | 5 + .../glib-2.0/meson.cross.d/common-mingw | 6 + .../glib-2.0/meson.cross.d/common-morello | 3 + .../glib-2.0/meson.cross.d/common-musl | 6 + .../glib-2.0/glib-2.0/skip-timeout.patch | 30 ++ recipes-core/glib-2.0/glib-morello.inc | 170 ++++++++ 20 files changed, 1083 insertions(+) create mode 100644 recipes-core/glib-2.0/glib-2.0-morello_2.76.4.bb create mode 100644 recipes-core/glib-2.0/glib-2.0/0001-Fix-DATADIRNAME-on-uclibc-Linux.patch create mode 100644 recipes-core/glib-2.0/glib-2.0/0001-Install-gio-querymodules-as-libexec_PROGRAM.patch create mode 100644 recipes-core/glib-2.0/glib-2.0/0001-Remove-the-warning-about-deprecated-paths-in-schemas.patch create mode 100644 recipes-core/glib-2.0/glib-2.0/0001-Set-host_machine-correctly-when-building-with-mingw3.patch create mode 100644 recipes-core/glib-2.0/glib-2.0/0001-add-disable-cxx-build-option.patch create mode 100644 recipes-core/glib-2.0/glib-2.0/0001-gio-tests-resources.c-comment-out-a-build-host-only-.patch create mode 100644 recipes-core/glib-2.0/glib-2.0/0001-meson-Run-atomics-test-on-clang-as-well.patch create mode 100644 recipes-core/glib-2.0/glib-2.0/0002-fix-iconv-libintl-library-not-found.patch create mode 100644 recipes-core/glib-2.0/glib-2.0/0003-Add-option-to-disable-testing-host-binaries-when-cro.patch create mode 100644 recipes-core/glib-2.0/glib-2.0/0010-Do-not-hardcode-python-path-into-various-tools.patch create mode 100644 recipes-core/glib-2.0/glib-2.0/memory-monitor.patch create mode 100644 recipes-core/glib-2.0/glib-2.0/meson.cross.d/common create mode 100644 recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-glibc create mode 100644 recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-linux create mode 100644 recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-mingw create mode 100644 recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-morello create mode 100644 recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-musl create mode 100644 recipes-core/glib-2.0/glib-2.0/skip-timeout.patch create mode 100644 recipes-core/glib-2.0/glib-morello.inc
diff --git a/recipes-core/glib-2.0/glib-2.0-morello_2.76.4.bb b/recipes-core/glib-2.0/glib-2.0-morello_2.76.4.bb new file mode 100644 index 0000000..91f73c4 --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0-morello_2.76.4.bb @@ -0,0 +1,58 @@ +require glib-morello.inc
+PE = "1"
+SHRT_VER = "${@oe.utils.trim_version("${PV}", 2)}" +SRC_URI += "git://github.com/CTSRD-CHERI/glib.git;protocol=https;branch=2.76.4-cheriabi;rev=36ccd7a907969b31fdd8e26c1bfd8f539f0e92c3 \
file://0001-Fix-DATADIRNAME-on-uclibc-Linux.patch \
file://0001-Remove-the-warning-about-deprecated-paths-in-schemas.patch \
file://0001-Install-gio-querymodules-as-libexec_PROGRAM.patch \
file://0010-Do-not-hardcode-python-path-into-various-tools.patch \
file://0001-Set-host_machine-correctly-when-building-with-mingw3.patch \
file://0001-meson-Run-atomics-test-on-clang-as-well.patch \
file://0001-gio-tests-resources.c-comment-out-a-build-host-only-.patch \
file://memory-monitor.patch \
file://skip-timeout.patch \
file://0001-add-disable-cxx-build-option.patch \
file://0002-fix-iconv-libintl-library-not-found.patch \
file://0003-Add-option-to-disable-testing-host-binaries-when-cro.patch \
"
+SRC_URI[sha256sum] = "b9cfb6f7a5bd5b31238fd5d56df226b2dda5ea37611475bf89f6a0f9400fe8bd"
+FILESEXTRAPATHS:prepend := "${THISDIR}/glib-2.0:"
+TOOLCHAIN = "${MORELLO_TOOLCHAIN}"
+CFLAGS += " -DNVALGRIND=1 -DG_ENABLE_EXPERIMENTAL_ABI_COMPILATION"
+# Find any meson cross files in FILESPATH that are relevant for the current +# build (using siteinfo) and add them to EXTRA_OEMESON. +inherit siteinfo +def find_meson_cross_files(d):
- if bb.data.inherits_class('native', d):
return ""
- thisdir = os.path.normpath(d.getVar("THISDIR"))
- import collections
- sitedata = siteinfo_data(d)
- # filename -> found
- files = collections.OrderedDict()
- for path in d.getVar("FILESPATH").split(":"):
for element in sitedata:
filename = os.path.normpath(os.path.join(path, "meson.cross.d", element))
sanitized_path = filename.replace(thisdir, "${THISDIR}")
if sanitized_path == filename:
if os.path.exists(filename):
bb.error("Cannot add '%s' to --cross-file, because it's not relative to THISDIR '%s' and sstate signature would contain this full path" % (filename, thisdir))
continue
files[filename.replace(thisdir, "${THISDIR}")] = os.path.exists(filename)
- items = ["--cross-file=" + k for k,v in files.items() if v]
- d.appendVar("EXTRA_OEMESON", " " + " ".join(items))
- items = ["%s:%s" % (k, "True" if v else "False") for k,v in files.items()]
- d.appendVarFlag("do_configure", "file-checksums", " " + " ".join(items))
+python () {
- find_meson_cross_files(d)
+} diff --git a/recipes-core/glib-2.0/glib-2.0/0001-Fix-DATADIRNAME-on-uclibc-Linux.patch b/recipes-core/glib-2.0/glib-2.0/0001-Fix-DATADIRNAME-on-uclibc-Linux.patch new file mode 100644 index 0000000..b5a1933 --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/0001-Fix-DATADIRNAME-on-uclibc-Linux.patch @@ -0,0 +1,30 @@ +From 0d508b650cee67f887e307cb35f3863e872bdd8f Mon Sep 17 00:00:00 2001 +From: Khem Raj raj.khem@gmail.com +Date: Sat, 15 Mar 2014 22:42:29 -0700 +Subject: [PATCH] Fix DATADIRNAME on uclibc/Linux
+translation files are always installed under PREFIX/share/locale in uclibc +based systems therefore lets set DATADIRNAME to "share".
+Signed-off-by: Khem Raj raj.khem@gmail.com +Upstream-Status: Pending
+---
- m4macros/glib-gettext.m4 | 4 ++++
- 1 file changed, 4 insertions(+)
+diff --git a/m4macros/glib-gettext.m4 b/m4macros/glib-gettext.m4 +index df6fbf012..47db864eb 100644 +--- a/m4macros/glib-gettext.m4 ++++ b/m4macros/glib-gettext.m4 +@@ -293,6 +293,10 @@ msgstr ""
CATOBJEXT=.mo
DATADIRNAME=share
;;
++ *-*-musl* | *-*-linux-uclibc*) ++ CATOBJEXT=.gmo ++ DATADIRNAME=share ++ ;;
*)
CATOBJEXT=.mo
DATADIRNAME=lib
diff --git a/recipes-core/glib-2.0/glib-2.0/0001-Install-gio-querymodules-as-libexec_PROGRAM.patch b/recipes-core/glib-2.0/glib-2.0/0001-Install-gio-querymodules-as-libexec_PROGRAM.patch new file mode 100644 index 0000000..c425933 --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/0001-Install-gio-querymodules-as-libexec_PROGRAM.patch @@ -0,0 +1,27 @@ +From 40f9792a6f42733d09de1c2a71be8e9b51d36b9c Mon Sep 17 00:00:00 2001 +From: Jussi Kukkonen jussi.kukkonen@intel.com +Date: Tue, 22 Mar 2016 15:14:58 +0200 +Subject: [PATCH] Install gio-querymodules as libexec_PROGRAM
+We want to install this binary with the gio library, and debian +renamer does not cope with library packages with files in ${bindir}
+Signed-off-by: Jussi Kukkonen jussi.kukkonen@intel.com +Upstream-Status: Inappropriate [OE specific]
+---
- gio/meson.build | 1 +
- 1 file changed, 1 insertion(+)
+diff --git a/gio/meson.build b/gio/meson.build +index 462606f3b..0e084ff38 100644 +--- a/gio/meson.build ++++ b/gio/meson.build +@@ -1001,6 +1001,7 @@ gio_querymodules = executable('gio-querymodules', 'gio-querymodules.c', 'giomodu
- c_args : gio_c_args,
- # intl.lib is not compatible with SAFESEH
- link_args : noseh_link_args,
++ install_dir: glib_libexecdir,
- dependencies : [libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep])
- glib_compile_schemas = executable('glib-compile-schemas',
diff --git a/recipes-core/glib-2.0/glib-2.0/0001-Remove-the-warning-about-deprecated-paths-in-schemas.patch b/recipes-core/glib-2.0/glib-2.0/0001-Remove-the-warning-about-deprecated-paths-in-schemas.patch new file mode 100644 index 0000000..ea3199c --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/0001-Remove-the-warning-about-deprecated-paths-in-schemas.patch @@ -0,0 +1,40 @@ +From 0c5c690152375e0cd803229076dff40b96e51bbd Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin alex.kanavin@gmail.com +Date: Fri, 12 Jun 2015 17:08:46 +0300 +Subject: [PATCH] Remove the warning about deprecated paths in schemas
+Some schemas in gsettings-desktop-schemas (such as proxy and locale) +are still using deprecated paths, as of 3.16.1. This causes warning +messages, and meta/lib/oe/rootfs.py complaints about them.
+Upstream-Status: Inappropriate +Signed-off-by: Alexander Kanavin alex.kanavin@gmail.com
+---
- gio/glib-compile-schemas.c | 13 -------------
- 1 file changed, 13 deletions(-)
+diff --git a/gio/glib-compile-schemas.c b/gio/glib-compile-schemas.c +index 04ef40457..e791ce254 100644 +--- a/gio/glib-compile-schemas.c ++++ b/gio/glib-compile-schemas.c +@@ -1232,19 +1232,6 @@ parse_state_start_schema (ParseState *state,
return;
}
+- if (path && (g_str_has_prefix (path, "/apps/") || +- g_str_has_prefix (path, "/desktop/") || +- g_str_has_prefix (path, "/system/"))) +- { +- gchar *message = NULL; +- message = g_strdup_printf (_("Warning: Schema “%s” has path “%s”. " +- "Paths starting with " +- "“/apps/”, “/desktop/” or “/system/” are deprecated."), +- id, path); +- g_printerr ("%s\n", message); +- g_free (message); +- } +-
- state->schema_state = schema_state_new (path, gettext_domain,
extends, extends_name, list_of);
diff --git a/recipes-core/glib-2.0/glib-2.0/0001-Set-host_machine-correctly-when-building-with-mingw3.patch b/recipes-core/glib-2.0/glib-2.0/0001-Set-host_machine-correctly-when-building-with-mingw3.patch new file mode 100644 index 0000000..ae5f616 --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/0001-Set-host_machine-correctly-when-building-with-mingw3.patch @@ -0,0 +1,81 @@ +From 11fd1fb8c2a861e6c6f4afa5163ee56616c81de2 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin alex.kanavin@gmail.com +Date: Wed, 13 Feb 2019 15:32:05 +0100 +Subject: [PATCH] Set host_machine correctly when building with mingw32
+Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin alex.kanavin@gmail.com
+---
- gio/tests/meson.build | 8 ++++----
- glib/tests/meson.build | 2 +-
- meson.build | 3 +++
- 3 files changed, 8 insertions(+), 5 deletions(-)
+diff --git a/gio/tests/meson.build b/gio/tests/meson.build +index 2631b1285..1c0016957 100644 +--- a/gio/tests/meson.build ++++ b/gio/tests/meson.build +@@ -29,7 +29,7 @@ endif
- test_cpp_args = test_c_args
+-if host_machine.system() == 'windows' ++if host_system == 'windows'
- common_gio_tests_deps += [iphlpapi_dep, winsock2, cc.find_library ('secur32')]
- endif
+@@ -225,7 +225,7 @@ if have_dbus_daemon
- endif
- # Test programs buildable on UNIX only
+-if host_machine.system() != 'windows' ++if host_system != 'windows'
- gio_tests += {
'file' : {},
'gdbus-peer-object-manager' : {},
+@@ -551,7 +551,7 @@ if host_machine.system() != 'windows'
- endif # unix
- # Test programs buildable on Windows only
+-if host_machine.system() == 'windows' ++if host_system == 'windows'
- gio_tests += {'win32-streams' : {}}
- endif
+@@ -621,7 +621,7 @@ if cc.get_id() != 'msvc' and cc.get_id() != 'clang-cl'
- }
- endif
+-if host_machine.system() != 'windows' ++if host_system != 'windows'
- test_extra_programs += {
'gdbus-example-unix-fd-client' : {
'install' : false,
+diff --git a/glib/tests/meson.build b/glib/tests/meson.build +index 72a6ff92b..223bd141c 100644 +--- a/glib/tests/meson.build ++++ b/glib/tests/meson.build +@@ -209,7 +209,7 @@ if glib_conf.has('HAVE_EVENTFD')
- }
- endif
+-if host_machine.system() == 'windows' ++if host_system == 'windows'
- if winsock2.found()
glib_tests += {
'gpoll' : {
+diff --git a/meson.build b/meson.build +index a4a271a0a..13f7612e6 100644 +--- a/meson.build ++++ b/meson.build +@@ -52,6 +52,9 @@ else
- endif
- host_system = host_machine.system()
++if host_system == 'mingw32' ++ host_system = 'windows' ++endif
- if host_system == 'darwin'
- ios_test_code = '''#include <TargetConditionals.h>
diff --git a/recipes-core/glib-2.0/glib-2.0/0001-add-disable-cxx-build-option.patch b/recipes-core/glib-2.0/glib-2.0/0001-add-disable-cxx-build-option.patch new file mode 100644 index 0000000..ebf9556 --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/0001-add-disable-cxx-build-option.patch @@ -0,0 +1,36 @@ +From a43ffde17d160e07364b8352925b1c31009b7dfe Mon Sep 17 00:00:00 2001 +From: Michael Cobb michael.cobb@iceotope.com +Date: Wed, 12 Jun 2024 10:13:50 +0100 +Subject: [PATCH] add disable cxx build option
+---
- meson.build | 2 +-
- meson_options.txt | 5 +++++
- 2 files changed, 6 insertions(+), 1 deletion(-)
+diff --git a/meson.build b/meson.build +index 17d7bc08e..73523db34 100644 +--- a/meson.build ++++ b/meson.build +@@ -19,7 +19,7 @@ foreach std : ['90', '99', '11', '17']
- endif
- endforeach
+-have_cxx = add_languages('cpp', native: false, required: get_option('oss_fuzz').enabled()) ++have_cxx = not get_option('disable_cxx') and add_languages('cpp', native: false, required: get_option('oss_fuzz').enabled())
- if have_cxx
- cxx = meson.get_compiler('cpp')
- cxx_standards = {}
+diff --git a/meson_options.txt b/meson_options.txt +index 517d5757c..09ddc9318 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -125,3 +125,8 @@ option('multiarch',
type : 'boolean',
value : false,
description : 'Install some helper executables in per-architecture locations')
++ ++option('disable_cxx', ++ type: 'boolean', ++ value: false, ++ description: 'Disable the use of C++ compiler for tests if your platform does not have a working C++ compiler') diff --git a/recipes-core/glib-2.0/glib-2.0/0001-gio-tests-resources.c-comment-out-a-build-host-only-.patch b/recipes-core/glib-2.0/glib-2.0/0001-gio-tests-resources.c-comment-out-a-build-host-only-.patch new file mode 100644 index 0000000..d59ba74 --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/0001-gio-tests-resources.c-comment-out-a-build-host-only-.patch @@ -0,0 +1,28 @@ +From bb250d23bfc333fe21ea7935ef8895382b616a93 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin alex.kanavin@gmail.com +Date: Wed, 8 Jan 2020 18:22:46 +0100 +Subject: [PATCH] gio/tests/resources.c: comment out a build host-only test
+This test requires building resources in a way that is +not cross-compatible (hardcodes ld and objcopy).
+Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin alex.kanavin@gmail.com
+---
- gio/tests/resources.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+diff --git a/gio/tests/resources.c b/gio/tests/resources.c +index f567914d7..b21b6166d 100644 +--- a/gio/tests/resources.c ++++ b/gio/tests/resources.c +@@ -1068,7 +1068,7 @@ main (int argc,
- g_test_add_func ("/resource/automatic", test_resource_automatic);
- /* This only uses automatic resources too, so it tests the constructors and destructors */
- g_test_add_func ("/resource/module", test_resource_module);
+- g_test_add_func ("/resource/binary-linked", test_resource_binary_linked); ++ /* g_test_add_func ("/resource/binary-linked", test_resource_binary_linked); */
- #endif
- g_test_add_func ("/resource/uri/query-info", test_uri_query_info);
- g_test_add_func ("/resource/uri/file", test_uri_file);
diff --git a/recipes-core/glib-2.0/glib-2.0/0001-meson-Run-atomics-test-on-clang-as-well.patch b/recipes-core/glib-2.0/glib-2.0/0001-meson-Run-atomics-test-on-clang-as-well.patch new file mode 100644 index 0000000..c1760dc --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/0001-meson-Run-atomics-test-on-clang-as-well.patch @@ -0,0 +1,29 @@ +From 880bbcbb2d83c2ad9ef0f9342719c3a0fddf4aec Mon Sep 17 00:00:00 2001 +From: Khem Raj raj.khem@gmail.com +Date: Sat, 12 Oct 2019 17:46:26 -0700 +Subject: [PATCH] meson: Run atomics test on clang as well
+Fixes +./glib-2.62.1/glib/gatomic.c:675:2: error: G_ATOMIC_LOCK_FREE defined, but incapable of lock-free atomics. +^
+Upstream-Status: Pending +Signed-off-by: Khem Raj raj.khem@gmail.com
+---
- meson.build | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+diff --git a/meson.build b/meson.build +index 13f7612e6..17d7bc08e 100644 +--- a/meson.build ++++ b/meson.build +@@ -1905,7 +1905,7 @@ atomicdefine = '''
- # We know that we can always use real ("lock free") atomic operations with MSVC
- if cc.get_id() == 'msvc' or cc.get_id() == 'clang-cl' or cc.links(atomictest, name : 'atomic ops')
- have_atomic_lock_free = true
+- if cc.get_id() == 'gcc' and not cc.compiles(atomicdefine, name : 'atomic ops define') ++ if (cc.get_id() == 'gcc' or cc.get_id() == 'clang') and not cc.compiles(atomicdefine, name : 'atomic ops define')
# Old gcc release may provide
# __sync_bool_compare_and_swap but doesn't define
# __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
diff --git a/recipes-core/glib-2.0/glib-2.0/0002-fix-iconv-libintl-library-not-found.patch b/recipes-core/glib-2.0/glib-2.0/0002-fix-iconv-libintl-library-not-found.patch new file mode 100644 index 0000000..d7d4991 --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/0002-fix-iconv-libintl-library-not-found.patch @@ -0,0 +1,61 @@ +From 8c7150407029080b7f8598559d43606f44e23c8b Mon Sep 17 00:00:00 2001 +From: Michael Cobb michael.cobb@iceotope.com +Date: Wed, 12 Jun 2024 10:15:39 +0100 +Subject: [PATCH] fix iconv/libintl library not found
+---
- meson.build | 19 +++++++++++++++++--
- meson_options.txt | 6 ++++++
- 2 files changed, 23 insertions(+), 2 deletions(-)
+diff --git a/meson.build b/meson.build +index 73523db34..31f90ece1 100644 +--- a/meson.build ++++ b/meson.build +@@ -2043,12 +2043,27 @@ glibconfig_conf.set10('G_HAVE_GROWING_STACK', growing_stack)
- # We should never use the MinGW C library's iconv because it may not be
- # available in the actual runtime environment. On Windows, we always use
- # the built-in implementation
++iconv_opt = get_option('iconv')
- if host_system == 'windows'
++ libiconv = []
- # We have a #include "win_iconv.c" in gconvert.c on Windows, so we don't need
- # any external library for it
+- libiconv = [] ++ if iconv_opt != 'auto' ++ warning('-Diconv was set to @0@, which was ignored') ++ endif
- else
+- libiconv = dependency('iconv') ++ found_iconv = false ++ if ['auto', 'libc'].contains(iconv_opt) and cc.has_function('iconv_open') ++ libiconv = [] ++ found_iconv = true ++ endif ++ if not found_iconv and ['auto', 'external'].contains(iconv_opt) and cc.has_header_symbol('iconv.h', 'iconv_open') ++ libiconv = [cc.find_library('iconv')] ++ found_iconv = true ++ endif ++ if not found_iconv ++ error('iconv implementation "@0@" not found'.format(iconv_opt)) ++ endif
- endif
- pcre2_req = '>=10.32'
+diff --git a/meson_options.txt b/meson_options.txt +index 09ddc9318..324351cf7 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -4,6 +4,12 @@ option('runtime_libdir',
description : 'install runtime libraries relative to libdir',
deprecated: true)
++option('iconv', ++ type : 'combo', ++ choices : ['auto', 'libc', 'external'], ++ value : 'auto', ++ description : 'iconv implementation to use ('libc' = 'Part of the C library'; 'external' = 'External libiconv'; 'auto' = 'Auto-detect which iconv is available')') ++
- option('charsetalias_dir',
type : 'string',
value : '',
diff --git a/recipes-core/glib-2.0/glib-2.0/0003-Add-option-to-disable-testing-host-binaries-when-cro.patch b/recipes-core/glib-2.0/glib-2.0/0003-Add-option-to-disable-testing-host-binaries-when-cro.patch new file mode 100644 index 0000000..c7b8928 --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/0003-Add-option-to-disable-testing-host-binaries-when-cro.patch @@ -0,0 +1,59 @@ +From 115959af31829340ea9fbab37e44e879e481f6b6 Mon Sep 17 00:00:00 2001 +From: Michael Cobb michael.cobb@iceotope.com +Date: Wed, 12 Jun 2024 11:22:54 +0100 +Subject: [PATCH] Add option to disable testing host binaries when
- cross-compiling
+Fixes the 'frexpl() is missing or broken beyond repair' build error due +to meson trying to run tests under qemu
+Signed-off-by: Michael Cobb michael.cobb@iceotope.com
+---
- meson.build | 5 +++--
- meson_options.txt | 5 +++++
- 2 files changed, 8 insertions(+), 2 deletions(-)
+diff --git a/meson.build b/meson.build +index 31f90ece1..ebb7b0b5b 100644 +--- a/meson.build ++++ b/meson.build +@@ -32,7 +32,7 @@ if have_cxx
- endforeach
- endif
+-cc_can_run = meson.can_run_host_binaries() ++cc_can_run = get_option('can_run_host_binaries') and meson.can_run_host_binaries()
- if cc.get_argument_syntax() == 'msvc'
- # Ignore several spurious warnings for things glib does very commonly
+@@ -1445,7 +1445,7 @@ endif
- # library type. Test for the warnings and set gint64 to whichever
- # works.
- if long_long_size == long_size
+- if cc.compiles('''#if defined(_AIX) && !defined(__GNUC__) ++ r = cc.compiles('''#if defined(_AIX) && !defined(__GNUC__)
#pragma options langlvl=stdc99
#endif
#pragma GCC diagnostic error "-Wincompatible-pointer-types"
+@@ -1456,6 +1456,7 @@ if long_long_size == long_size
long *i2 = &i1;
return 1;
}''', name : 'int64_t is long')
++ if r
int64_t_typedef = 'long'
- elif cc.compiles('''#if defined(_AIX) && !defined(__GNUC__)
#pragma options langlvl=stdc99
+diff --git a/meson_options.txt b/meson_options.txt +index 324351cf7..03975ed43 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -136,3 +136,8 @@ option('disable_cxx',
type: 'boolean',
value: false,
description: 'Disable the use of C++ compiler for tests if your platform does not have a working C++ compiler')
++ ++option('can_run_host_binaries', ++ type: 'boolean', ++ value: true, ++ description: 'Disable if cross-compiling and your platform does not have a way to run compiled host binaries') diff --git a/recipes-core/glib-2.0/glib-2.0/0010-Do-not-hardcode-python-path-into-various-tools.patch b/recipes-core/glib-2.0/glib-2.0/0010-Do-not-hardcode-python-path-into-various-tools.patch new file mode 100644 index 0000000..db25ed4 --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/0010-Do-not-hardcode-python-path-into-various-tools.patch @@ -0,0 +1,44 @@ +From a1eddf4f6071e060f61eeeb1c0de06eae8a882ac Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin alex.kanavin@gmail.com +Date: Tue, 3 Oct 2017 10:45:55 +0300 +Subject: [PATCH] Do not hardcode python path into various tools
+Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin alex.kanavin@gmail.com
+---
- gio/gdbus-2.0/codegen/gdbus-codegen.in | 2 +-
- gobject/glib-genmarshal.in | 2 +-
- gobject/glib-mkenums.in | 2 +-
- 3 files changed, 3 insertions(+), 3 deletions(-)
+diff --git a/gio/gdbus-2.0/codegen/gdbus-codegen.in b/gio/gdbus-2.0/codegen/gdbus-codegen.in +index 67d367543..4e92a7afa 100755 +--- a/gio/gdbus-2.0/codegen/gdbus-codegen.in ++++ b/gio/gdbus-2.0/codegen/gdbus-codegen.in +@@ -1,4 +1,4 @@ +-#!/usr/bin/env @PYTHON@ ++#!/usr/bin/env python3
- # GDBus - GLib D-Bus Library
- #
+diff --git a/gobject/glib-genmarshal.in b/gobject/glib-genmarshal.in +index aa5af43bd..56e8e2ec4 100755 +--- a/gobject/glib-genmarshal.in ++++ b/gobject/glib-genmarshal.in +@@ -1,4 +1,4 @@ +-#!/usr/bin/env @PYTHON@ ++#!/usr/bin/env python3
- # pylint: disable=too-many-lines, missing-docstring, invalid-name
+diff --git a/gobject/glib-mkenums.in b/gobject/glib-mkenums.in +index e0c0b39af..6ed03893d 100755 +--- a/gobject/glib-mkenums.in ++++ b/gobject/glib-mkenums.in +@@ -1,4 +1,4 @@ +-#!/usr/bin/env @PYTHON@ ++#!/usr/bin/env python3
- # If the code below looks horrible and unpythonic, do not panic.
- #
diff --git a/recipes-core/glib-2.0/glib-2.0/memory-monitor.patch b/recipes-core/glib-2.0/glib-2.0/memory-monitor.patch new file mode 100644 index 0000000..fc069eb --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/memory-monitor.patch @@ -0,0 +1,362 @@ +From e074461e828d47edc00fd912f8b94eb95685bc82 Mon Sep 17 00:00:00 2001 +From: Philip Withnall philip@tecnocode.co.uk +Date: Tue, 23 Jan 2024 11:16:52 +0000 +Subject: [PATCH] Merge branch '2887-memory-monitor-tests' into 'main'
+tests: Fix race condition in memory-monitor-dbus.test
+Closes #2887
+See merge request GNOME/glib!3844
+Hopefully these commits fix the occasional failures we've been seeing: +https://bugzilla.yoctoproject.org/show_bug.cgi?id=15362
+Upstream-Status: Backport +Signed-off-by: Ross Burton ross.burton@arm.com
+---
- gio/tests/memory-monitor-dbus.py.in | 64 +++++++++++++-------
- gio/tests/memory-monitor-portal.py.in | 54 ++++++++++-------
- gio/tests/power-profile-monitor-dbus.py.in | 35 ++++++-----
- gio/tests/power-profile-monitor-portal.py.in | 34 ++++++-----
- 4 files changed, 113 insertions(+), 74 deletions(-)
+diff --git a/gio/tests/memory-monitor-dbus.py.in b/gio/tests/memory-monitor-dbus.py.in +index bf3291847..7aae01e70 100755 +--- a/gio/tests/memory-monitor-dbus.py.in ++++ b/gio/tests/memory-monitor-dbus.py.in +@@ -16,7 +16,6 @@ import sys
- import subprocess
- import fcntl
- import os
+-import time
- import taptestrunner
+@@ -57,53 +56,74 @@ try:
fcntl.fcntl(self.p_mock.stdout, fcntl.F_SETFL, flags | os.O_NONBLOCK)
self.last_warning = -1
self.dbusmock = dbus.Interface(self.obj_lmm, dbusmock.MOCK_IFACE)
++ ++ try: ++ self.wait_for_bus_object('org.freedesktop.LowMemoryMonitor', ++ '/org/freedesktop/LowMemoryMonitor', ++ system_bus=True) ++ except: ++ raise ++
self.memory_monitor = Gio.MemoryMonitor.dup_default()
++ assert("GMemoryMonitorDBus" in str(self.memory_monitor))
self.memory_monitor.connect("low-memory-warning", self.memory_warning_cb)
self.mainloop = GLib.MainLoop()
self.main_context = self.mainloop.get_context()
++ # The LowMemoryMonitor API is stateless: it doesn’t expose any ++ # properties, just a warning signal. Emit the signal in a loop until ++ # the GMemoryMonitor instance has initialised and synchronised to ++ # the right state. ++ def emit_warning(level): ++ self.dbusmock.EmitWarning(level) ++ return GLib.SOURCE_CONTINUE ++ ++ idle_id = GLib.idle_add(emit_warning, 0) ++ while self.last_warning != 0: ++ self.main_context.iteration(True) ++ GLib.source_remove(idle_id) ++
def tearDown(self):
self.p_mock.terminate()
self.p_mock.wait()
+- def assertEventually(self, condition, message=None, timeout=50): ++ def assertEventually(self, condition, message=None, timeout=5):
'''Assert that condition function eventually returns True.
+- Timeout is in deciseconds, defaulting to 50 (5 seconds). message is ++ Timeout is in seconds, defaulting to 5 seconds. message is
printed on failure.
'''
+- while timeout >= 0: +- context = GLib.MainContext.default() +- while context.iteration(False): +- pass +- if condition(): +- break +- timeout -= 1 +- time.sleep(0.1) +- else: +- self.fail(message or 'timed out waiting for ' + str(condition)) ++ if not message: ++ message = 'timed out waiting for ' + str(condition) ++ ++ def timed_out_cb(message): ++ self.fail(message) ++ return GLib.SOURCE_REMOVE ++ ++ timeout_source = GLib.timeout_source_new_seconds(timeout) ++ timeout_source.set_callback(timed_out_cb, message) ++ timeout_source.attach(self.main_context) ++ ++ while not condition(): ++ self.main_context.iteration(True) ++ ++ timeout_source.destroy()
def memory_warning_cb(self, monitor, level):
++ print("Received memory warning signal, level", level)
self.last_warning = level
self.main_context.wakeup()
def test_low_memory_warning_signal(self):
'''LowMemoryWarning signal'''
+- # Wait 2 seconds +- timeout = 2 +- while timeout > 0: +- time.sleep(0.5) +- timeout -= 0.5 +- self.main_context.iteration(False) +-
self.dbusmock.EmitWarning(100)
# Wait 2 seconds or until warning
+- self.assertEventually(lambda: self.last_warning == 100, "'100' low-memory warning not received", 20) ++ self.assertEventually(lambda: self.last_warning == 100, "'100' low-memory warning not received", 2)
self.dbusmock.EmitWarning(255)
# Wait 2 seconds or until warning
+- self.assertEventually(lambda: self.last_warning == 255, "'255' low-memory warning not received", 20) ++ self.assertEventually(lambda: self.last_warning == 255, "'255' low-memory warning not received", 2)
- except ImportError as e:
@unittest.skip("Cannot import %s" % e.name)
+diff --git a/gio/tests/memory-monitor-portal.py.in b/gio/tests/memory-monitor-portal.py.in +index 748cee850..f570508f9 100755 +--- a/gio/tests/memory-monitor-portal.py.in ++++ b/gio/tests/memory-monitor-portal.py.in +@@ -16,7 +16,6 @@ import sys
- import subprocess
- import fcntl
- import os
+-import time
- import taptestrunner
+@@ -80,26 +79,44 @@ try:
self.mainloop = GLib.MainLoop()
self.main_context = self.mainloop.get_context()
++ # The LowMemoryMonitor API is stateless: it doesn’t expose any ++ # properties, just a warning signal. Emit the signal in a loop until ++ # the GMemoryMonitor instance has initialised and synchronised to ++ # the right state. ++ def emit_warning(level): ++ self.dbusmock.EmitWarning(level) ++ return GLib.SOURCE_CONTINUE ++ ++ idle_id = GLib.idle_add(self.emit_warning, 0) ++ while self.last_warning != 0: ++ self.main_context.iteration(True) ++ GLib.source_remove(idle_id) ++
def tearDown(self):
self.p_mock.terminate()
self.p_mock.wait()
+- def assertEventually(self, condition, message=None, timeout=50): ++ def assertEventually(self, condition, message=None, timeout=5):
'''Assert that condition function eventually returns True.
+- Timeout is in deciseconds, defaulting to 50 (5 seconds). message is ++ Timeout is in seconds, defaulting to 5 seconds. message is
printed on failure.
'''
+- while timeout >= 0: +- context = GLib.MainContext.default() +- while context.iteration(False): +- pass +- if condition(): +- break +- timeout -= 1 +- time.sleep(0.1) +- else: +- self.fail(message or 'timed out waiting for ' + str(condition)) ++ if not message: ++ message = 'timed out waiting for ' + str(condition) ++ ++ def timed_out_cb(message): ++ self.fail(message) ++ return GLib.SOURCE_REMOVE ++ ++ timeout_source = GLib.timeout_source_new_seconds(timeout) ++ timeout_source.set_callback(timed_out_cb, message) ++ timeout_source.attach(self.main_context) ++ ++ while not condition(): ++ self.main_context.iteration(True) ++ ++ timeout_source.destroy()
def portal_memory_warning_cb(self, monitor, level):
self.last_warning = level
+@@ -108,20 +125,13 @@ try:
def test_low_memory_warning_portal_signal(self):
'''LowMemoryWarning signal'''
+- # Wait 2 seconds +- timeout = 2 +- while timeout > 0: +- time.sleep(0.5) +- timeout -= 0.5 +- self.main_context.iteration(False) +-
self.dbusmock.EmitWarning(100)
# Wait 2 seconds or until warning
+- self.assertEventually(lambda: self.last_warning == 100, "'100' low-memory warning not received", 20) ++ self.assertEventually(lambda: self.last_warning == 100, "'100' low-memory warning not received", 2)
self.dbusmock.EmitWarning(255)
# Wait 2 seconds or until warning
+- self.assertEventually(lambda: self.last_warning == 255, "'255' low-memory warning not received", 20) ++ self.assertEventually(lambda: self.last_warning == 255, "'255' low-memory warning not received", 2)
- except ImportError as e:
@unittest.skip("Cannot import %s" % e.name)
+diff --git a/gio/tests/power-profile-monitor-dbus.py.in b/gio/tests/power-profile-monitor-dbus.py.in +index 06e594f4a..f955afc80 100755 +--- a/gio/tests/power-profile-monitor-dbus.py.in ++++ b/gio/tests/power-profile-monitor-dbus.py.in +@@ -16,7 +16,6 @@ import sys
- import subprocess
- import fcntl
- import os
+-import time
- import taptestrunner
+@@ -58,6 +57,7 @@ try:
self.power_saver_enabled = False
self.dbus_props = dbus.Interface(self.obj_ppd, dbus.PROPERTIES_IFACE)
self.power_profile_monitor = Gio.PowerProfileMonitor.dup_default()
++ assert("GPowerProfileMonitorDBus" in str(self.power_profile_monitor))
self.power_profile_monitor.connect("notify::power-saver-enabled", self.power_saver_enabled_cb)
self.mainloop = GLib.MainLoop()
self.main_context = self.mainloop.get_context()
+@@ -66,22 +66,27 @@ try:
self.p_mock.terminate()
self.p_mock.wait()
+- def assertEventually(self, condition, message=None, timeout=50): ++ def assertEventually(self, condition, message=None, timeout=5):
'''Assert that condition function eventually returns True.
+- Timeout is in deciseconds, defaulting to 50 (5 seconds). message is ++ Timeout is in seconds, defaulting to 5 seconds. message is
printed on failure.
'''
+- while timeout >= 0: +- context = GLib.MainContext.default() +- while context.iteration(False): +- pass +- if condition(): +- break +- timeout -= 1 +- time.sleep(0.1) +- else: +- self.fail(message or 'timed out waiting for ' + str(condition)) ++ if not message: ++ message = 'timed out waiting for ' + str(condition) ++ ++ def timed_out_cb(message): ++ self.fail(message) ++ return GLib.SOURCE_REMOVE ++ ++ timeout_source = GLib.timeout_source_new_seconds(timeout) ++ timeout_source.set_callback(timed_out_cb, message) ++ timeout_source.attach(self.main_context) ++ ++ while not condition(): ++ self.main_context.iteration(True) ++ ++ timeout_source.destroy()
def power_saver_enabled_cb(self, spec, data):
self.power_saver_enabled = self.power_profile_monitor.get_power_saver_enabled()
+@@ -92,10 +97,10 @@ try:
self.assertEqual(self.power_profile_monitor.get_power_saver_enabled(), False)
self.dbus_props.Set('net.hadess.PowerProfiles', 'ActiveProfile', dbus.String('power-saver', variant_level=1))
+- self.assertEventually(lambda: self.power_saver_enabled == True, "power-saver didn't become enabled", 10) ++ self.assertEventually(lambda: self.power_saver_enabled == True, "power-saver didn't become enabled", 1)
self.dbus_props.Set('net.hadess.PowerProfiles', 'ActiveProfile', dbus.String('balanced', variant_level=1))
+- self.assertEventually(lambda: self.power_saver_enabled == False, "power-saver didn't become disabled", 10) ++ self.assertEventually(lambda: self.power_saver_enabled == False, "power-saver didn't become disabled", 1)
- except ImportError as e:
@unittest.skip("Cannot import %s" % e.name)
+diff --git a/gio/tests/power-profile-monitor-portal.py.in b/gio/tests/power-profile-monitor-portal.py.in +index 09e9a450d..ad2abf621 100755 +--- a/gio/tests/power-profile-monitor-portal.py.in ++++ b/gio/tests/power-profile-monitor-portal.py.in +@@ -16,7 +16,6 @@ import sys
- import subprocess
- import fcntl
- import os
+-import time
- import taptestrunner
+@@ -90,22 +89,27 @@ try:
self.p_mock.terminate()
self.p_mock.wait()
+- def assertEventually(self, condition, message=None, timeout=50): ++ def assertEventually(self, condition, message=None, timeout=5):
'''Assert that condition function eventually returns True.
+- Timeout is in deciseconds, defaulting to 50 (5 seconds). message is ++ Timeout is in seconds, defaulting to 5 seconds. message is
printed on failure.
'''
+- while timeout >= 0: +- context = GLib.MainContext.default() +- while context.iteration(False): +- pass +- if condition(): +- break +- timeout -= 1 +- time.sleep(0.1) +- else: +- self.fail(message or 'timed out waiting for ' + str(condition)) ++ if not message: ++ message = 'timed out waiting for ' + str(condition) ++ ++ def timed_out_cb(message): ++ self.fail(message) ++ return GLib.SOURCE_REMOVE ++ ++ timeout_source = GLib.timeout_source_new_seconds(timeout) ++ timeout_source.set_callback(timed_out_cb, message) ++ timeout_source.attach(self.main_context) ++ ++ while not condition(): ++ self.main_context.iteration(True) ++ ++ timeout_source.destroy()
def power_saver_enabled_cb(self, spec, data):
self.power_saver_enabled = self.power_profile_monitor.get_power_saver_enabled()
+@@ -116,10 +120,10 @@ try:
self.assertEqual(self.power_profile_monitor.get_power_saver_enabled(), False)
self.dbus_props.Set('net.hadess.PowerProfiles', 'ActiveProfile', dbus.String('power-saver', variant_level=1))
+- self.assertEventually(lambda: self.power_saver_enabled == True, "power-saver didn't become enabled", 10) ++ self.assertEventually(lambda: self.power_saver_enabled == True, "power-saver didn't become enabled", 1)
self.dbus_props.Set('net.hadess.PowerProfiles', 'ActiveProfile', dbus.String('balanced', variant_level=1))
+- self.assertEventually(lambda: self.power_saver_enabled == False, "power-saver didn't become disabled", 10) ++ self.assertEventually(lambda: self.power_saver_enabled == False, "power-saver didn't become disabled", 1)
def test_power_profile_power_saver_enabled_portal_default(self):
'''power-saver-enabled property default value'''
diff --git a/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common b/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common new file mode 100644 index 0000000..0d7c5fa --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common @@ -0,0 +1,3 @@ +[properties] +# On all known supported architectures the stack grows down +growing_stack = false diff --git a/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-glibc b/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-glibc new file mode 100644 index 0000000..c4648f5 --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-glibc @@ -0,0 +1,5 @@ +[properties] +have_c99_vsnprintf = true +have_c99_snprintf = true +have_unix98_printf = true +va_val_copy = true diff --git a/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-linux b/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-linux new file mode 100644 index 0000000..adad7e6 --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-linux @@ -0,0 +1,5 @@ +[properties] +have_proc_self_cmdline = true
+[binaries] +env = '/usr/bin/env' diff --git a/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-mingw b/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-mingw new file mode 100644 index 0000000..75f911b --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-mingw @@ -0,0 +1,6 @@ +[properties] +have_c99_vsnprintf = false +have_c99_snprintf = false +have_unix98_printf = false +va_val_copy = true +have_proc_self_cmdline = false diff --git a/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-morello b/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-morello new file mode 100644 index 0000000..ce97555 --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-morello @@ -0,0 +1,3 @@ +[properties] +can_run_host_binaries = false +skip_sanity_check = true diff --git a/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-musl b/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-musl new file mode 100644 index 0000000..3049e51 --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-musl @@ -0,0 +1,6 @@ +[properties] +have_c99_vsnprintf = true +have_c99_snprintf = true +have_unix98_printf = true +va_val_copy = true +have_strlcpy = true diff --git a/recipes-core/glib-2.0/glib-2.0/skip-timeout.patch b/recipes-core/glib-2.0/glib-2.0/skip-timeout.patch new file mode 100644 index 0000000..97d07ff --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/skip-timeout.patch @@ -0,0 +1,30 @@ +From 925243c78f5e3a399be35ed036b47dc8e257c9a1 Mon Sep 17 00:00:00 2001 +From: Ross Burton ross.burton@arm.com +Date: Thu, 28 Mar 2024 16:27:09 +0000 +Subject: [PATCH] Skip /timeout/rounding test
+This test is sensitive to load because it expects certain timeout operations +to succeed in specific time periods. Whilst these timeouts are fairly large, +they're still exceeded inside a qemu on a loaded system.
+https://bugzilla.yoctoproject.org/show_bug.cgi?id=14464
+Upstream-Status: Inappropriate [OE-specific] +Signed-off-by: Ross Burton ross.burton@arm.com
+---
- glib/tests/timeout.c | 1 -
- 1 file changed, 1 deletion(-)
+diff --git a/glib/tests/timeout.c b/glib/tests/timeout.c +index acbb8f3e1..cdca6bb1d 100644 +--- a/glib/tests/timeout.c ++++ b/glib/tests/timeout.c +@@ -194,7 +194,6 @@ main (int argc, char *argv[])
- g_test_add_func ("/timeout/seconds", test_seconds);
- g_test_add_func ("/timeout/weeks-overflow", test_weeks_overflow);
- g_test_add_func ("/timeout/far-future-ready-time", test_far_future_ready_time);
+- g_test_add_func ("/timeout/rounding", test_rounding);
- return g_test_run ();
- }
diff --git a/recipes-core/glib-2.0/glib-morello.inc b/recipes-core/glib-2.0/glib-morello.inc new file mode 100644 index 0000000..2924798 --- /dev/null +++ b/recipes-core/glib-2.0/glib-morello.inc @@ -0,0 +1,170 @@ +inherit meson gettext gtk-doc pkgconfig upstream-version-is-even bash-completion manpages gobject-introspection-data purecap-sysroot
+MORELLO_SRC = "poky/meta/recipes-core/glib-2.0/*"
+SUMMARY = "A general-purpose utility library" +DESCRIPTION = "GLib is a general-purpose utility library, which provides many useful data types, macros, type conversions, string utilities, file utilities, a main loop abstraction, and so on." +HOMEPAGE = "https://developer.gnome.org/glib/"
+# pcre is under BSD; +# docs/reference/COPYING is with a 'public domain'-like license! +LICENSE = "LGPL-2.1-or-later & BSD-3-Clause & PD" +LIC_FILES_CHKSUM = "file://COPYING;md5=41890f71f740302b785c27661123bff5 \
file://glib/glib.h;beginline=4;endline=17;md5=72f7cc2847407f65d8981ef112e4e630 \
file://LICENSES/LGPL-2.1-or-later.txt;md5=41890f71f740302b785c27661123bff5 \
file://gmodule/gmodule.h;beginline=4;endline=17;md5=72f7cc2847407f65d8981ef112e4e630 \
file://docs/reference/COPYING;md5=f51a5100c17af6bae00735cd791e1fcc"
+BUGTRACKER = "http://bugzilla.gnome.org" +SECTION = "libs"
+CVE_PRODUCT = "glib"
+DEPENDS = "glib-2.0-native \
virtual/libintl \
virtual/libiconv \
libffi-morello \
libpcre2-morello \
zlib-morello \
python3-packaging-native \
util-linux-morello \
"
+CODEGEN_PYTHON_RDEPENDS = "python3 python3-packaging python3-xml" +CODEGEN_PYTHON_RDEPENDS:mingw32 = ""
+RDEPENDS:${PN}-codegen += "${CODEGEN_PYTHON_RDEPENDS}"
+RDEPENDS:${PN}:append = "\
util-linux-morello \
zlib-morello \
"
+PACKAGES += "${PN}-codegen ${PN}-utils"
+LEAD_SONAME = "libglib-2.0.*"
+DEPENDS:append:class-target = "${@' gtk-doc' if d.getVar('GTKDOC_ENABLED') == 'True' else ''}"
+GTKDOC_MESON_OPTION = "gtk_doc"
+S = "${WORKDIR}/git"
+# Allow the configure task to pull in git submodules over the network +do_configure[network] = "1"
+PACKAGECONFIG ??= "libmount \
${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)}"
+PACKAGECONFIG[libmount] = "-Dlibmount=enabled,-Dlibmount=disabled,util-linux-morello" +PACKAGECONFIG[manpages] = "-Dman=true, -Dman=false, libxslt-native xmlto-native" +PACKAGECONFIG[libelf] = "-Dlibelf=enabled,-Dlibelf=disabled,elfutils" +PACKAGECONFIG[tests] = "-Dinstalled_tests=true,-Dinstalled_tests=false," +PACKAGECONFIG[selinux] = "-Dselinux=enabled,-Dselinux=disabled,libselinux"
+EXTRA_OEMESON += " -Ddtrace=false -Dsystemtap=false -Dtests=true -Dinstalled_tests=true" +EXTRA_OEMESON += " -Ddisable_cxx=true -Dcan_run_host_binaries=false --cross-file=${THISDIR}/glib-2.0/meson.cross.d/common-morello "
+do_configure:prepend() {
sed -i -e '1s,#!.*,#!${USRBINPATH}/env python3,' ${S}/gio/gdbus-2.0/codegen/gdbus-codegen.in
+}
+FILES:${PN} = "${libdir}/lib*${SOLIBS} \
${libdir}/gio \
${libexecdir}/*gio-querymodules \
${libexecdir}/*gio-launch-desktop \
${datadir}/glib-2.0/schemas \
"
+FILES:${PN}-utils += "${bindir}/glib-genmarshal \
${bindir}/glib-gettextize \
${bindir}/glib-mkenums \
${bindir}/glib-compile-resources \
"
+FILES:${PN}-dev += "${libdir}/glib-2.0/include \
${libdir}/gio/modules/lib*${SOLIBSDEV} \
${libdir}/gio/modules/*.la \
${datadir}/glib-2.0/gettext/po/Makefile.in.in \
${datadir}/glib-2.0/schemas/gschema.dtd \
${datadir}/glib-2.0/valgrind/glib.supp \
${datadir}/gettext/its \
${datadir}/glib-2.0/dtds/* \
"
+FILES:${PN}-dbg += "${datadir}/glib-2.0/gdb \
${datadir}/gdb \
"
+FILES:${PN}-codegen = "${datadir}/glib-2.0/codegen/*.py \
${bindir}/gdbus-codegen \
"
+FILES:${PN}-utils = "${bindir}/*"
+SHAREDMIMEDEP = "shared-mime-info" +# When cross compiling for Windows we don't want to include this +SHAREDMIMEDEP:mingw32 = ""
+RRECOMMENDS:${PN} += "${SHAREDMIMEDEP}"
+ARM_INSTRUCTION_SET:armv4 = "arm" +ARM_INSTRUCTION_SET:armv5 = "arm" +# Valgrind runtime detection works using hand-written assembly, which +# doesn't support mips16e +CPPFLAGS:append:class-target:mips16e = " -DNVALGRIND=1"
+# GLib generally requires gettext to be present so for USE_NLS to yes. For +# native builds as i18n is disabled globally we have to add a gettext-native dependency. +USE_NLS:class-target = "yes"
+EXEEXT = "" +EXEEXT:mingw32 = ".exe"
+do_install() {
- meson install --destdir "${D}" --no-rebuild
+}
+do_install:append () {
if [ -f ${D}${bindir}/gtester-report ]; then
sed ${D}${bindir}/gtester-report -i -e '1s|^#!.*|#!/usr/bin/env python3|'
fi
# Remove some unpackaged files
rm -rf ${D}${datadir}/glib-2.0/codegen/__pycache__
rm -f ${D}${datadir}/glib-2.0/codegen/*.pyc
rm -f ${D}${datadir}/glib-2.0/codegen/*.pyo
if [ -e ${D}${libdir}/charset.alias ]; then
rm -f ${D}${libdir}/charset.alias
fi
# Make sure gio-querymodules is unique among multilibs
if test "x${MLPREFIX}" != "x"; then
mv ${D}${libexecdir}/gio-querymodules${EXEEXT} ${D}${libexecdir}/${MLPREFIX}gio-querymodules${EXEEXT}
fi
# Autotools does this, meson does not
mkdir -p ${D}${libdir}/gio/modules
+}
+do_install:append:class-target () {
# Tests are only installed on targets, not native builds. Separating this out
# keeps glib-2.0-native from depending on DISTRO_FEATURES
if [ -f ${D}${datadir}/installed-tests/glib/gdbus-serialization.test ]; then
if ${@bb.utils.contains("DISTRO_FEATURES", "x11", "false", "true", d)}; then
rm ${D}${datadir}/installed-tests/glib/gdbus-serialization.test
fi
fi
if [ -f ${D}${datadir}/installed-tests/glib/static-link.test ]; then
if test "x${MLPREFIX}" != "x"; then
mv ${D}${datadir}/installed-tests/glib/static-link.test ${D}${datadir}/installed-tests/glib/${MLPREFIX}static-link.test
fi
fi
# https://gitlab.gnome.org/GNOME/glib/-/issues/2810
rm -f ${D}${datadir}/installed-tests/glib/thread-pool-slow.test
+}
+# As we do not build python3 for windows, makes no sense to ship the script that's using it +do_install:append:mingw32() {
rm -f ${D}${bindir}/gtester-report
+}
-- 2.43.0 _______________________________________________ linux-morello-distros mailing list -- linux-morello-distros@op-lists.linaro.org To unsubscribe send an email to linux-morello-distros-leave@op-lists.linaro.org
linux-morello-distros@op-lists.linaro.org