From patchwork Tue Dec 1 06:21:59 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 106710 Received: from mail-dl1-f54.google.com (mail-dl1-f54.google.com [74.125.82.54]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.5655.1796106129300415464 for ; Mon, 30 Nov 2026 22:22:09 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20260707 header.b=RMkVg+2n; spf=pass (domain: gmail.com, ip: 74.125.82.54, mailfrom: raj.khem@gmail.com) Received: by mail-dl1-f54.google.com with SMTP id a92af1059eb24-1a2761c69fbso19034575c88.0 for ; Mon, 30 Nov 2026 22:22:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796106129; x=1796710929; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=SvnqVHAmsPvLFI8ntfuxpKfu4W5xeEUwzTfQnFGQX50=; b=RMkVg+2n4Ik4YUXOm3wOUedovnALprBKlcTDSwgqG+tsw2woKaYVYSmUoWGrkA0bbf 34We8MmUlUAEc7709c3pAzGof+yNxH+dD5/3oO1qR25oCODmyKFAp/noPwV4nSGqjykb 1GS1TSKjIPD8nLVwLYspbG6DJHU/X0oH3s5n7RDWWeH9j6y/wYI7i6eE6aMQY/7HYED6 SYj3EiSkSEwWgsbIKw8MW9VIisr8JWiIVW6dGWP4I+nxoSxLLskOCfD3IkGwSZchguai 9AM+cIpqoYGBPrS/Fw3ksY/DZABbMUZ8sw5Z4lCm9RgC07Ioe32h8wUYOyd7QrbdEwJZ 5Knw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796106129; x=1796710929; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to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1HJxM2Ox7 389z1xPnDeHxMwhy2x6uFyEU6pTVIMdtnhEGcWFw44/TrxtRRjGlYchL/yUT2gNOsPUk9II1T3y 7hr2qnSRpMVea/1HaO/W3OUC4/WVP/F2Pd4mnvI4iky4mKQDhDRvn+xR7/GdGxHmIGBVQninTp+ 6RfZ1kpmArkJrwtFZLlJ7caBJn/57KioIQaHVa15pJfZYw5csPcdx1tnEBmynlulFh/qM82jR22 y49uNyPiLJLuaNuW3Pt8YjZ7IJluMLFuv7VkYW5zp+oZRK4Rx8LB2CcjPi8uH/gjfc4etbkrb7p RMEwOjanoLICxoQ2lO73lNAP6omR3DYpp3f51FSZ/1M1H2Y9siueKHwvOSghyRsX7mhz+XeucY2 +u66 X-Received: by 2002:a05:7022:321:b0:145:287:ce91 with SMTP id a92af1059eb24-1b5568cb6b6mr53550268c88.14.1796106128534; Mon, 30 Nov 2026 22:22:08 -0800 (PST) Return-Path: Received: from apollo.tail3ccdd3.ts.net ([147.160.63.35]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1b5567ff27bsm97216293c88.6.2026.11.30.22.22.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 22:22:08 -0800 (PST) From: Khem Raj X-Google-Original-From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH] glib-2.0: Fix the string test build with clang on unsigned char targets Date: Mon, 30 Nov 2026 22:21:59 -0800 Message-ID: <20261201062159.756717-1-khem.raj@oss.qualcomm.com> X-Mailer: git-send-email 2.56.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Tue, 01 Dec 2026 06:22:14 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/251690 glib 2.90.2 adds -Werror=sign-conversion to the string and testing tests for every compiler with gcc-style arguments (cc.get_argument_syntax() instead of cc.get_id()), so clang now gets it too. Where char is unsigned (arm, aarch64, riscv) the string test fails to build: glib/tests/string.c:351:36: error: implicit conversion changes signedness: 'int' to 'gchar' (aka 'char') [-Werror,-Wsign-conversion] Backport the upstream fix, which casts the value to char. Reproduced and checked by building both tests with clang -funsigned-char; testing.c already builds. AI-Generated: Uses Claude Code Signed-off-by: Khem Raj --- ...ng-on-arm64-OpenBSD-in-GString-tests.patch | 30 +++++++++++++++++++ meta/recipes-core/glib-2.0/glib.inc | 1 + 2 files changed, 31 insertions(+) create mode 100644 meta/recipes-core/glib-2.0/files/0001-Wsign-conversion-warning-on-arm64-OpenBSD-in-GString-tests.patch diff --git a/meta/recipes-core/glib-2.0/files/0001-Wsign-conversion-warning-on-arm64-OpenBSD-in-GString-tests.patch b/meta/recipes-core/glib-2.0/files/0001-Wsign-conversion-warning-on-arm64-OpenBSD-in-GString-tests.patch new file mode 100644 index 0000000000..056b22695d --- /dev/null +++ b/meta/recipes-core/glib-2.0/files/0001-Wsign-conversion-warning-on-arm64-OpenBSD-in-GString-tests.patch @@ -0,0 +1,30 @@ +From 29fb84735c9c1ce0c3b72d3fc21bdf9744e37f64 Mon Sep 17 00:00:00 2001 +From: Antoine Jacoutot +Date: Sun, 25 Oct 2026 19:33:56 +0000 +Subject: [PATCH] -Wsign-conversion warning on arm64 OpenBSD in GString tests + +glib 2.90.2 passes -Werror=sign-conversion to the string test with clang +as well (cc.get_argument_syntax() instead of cc.get_id()), so it fails +to build where char is unsigned (arm, aarch64, riscv): + + string.c:351:36: error: implicit conversion changes signedness: 'int' to 'gchar' (aka 'char') [-Werror,-Wsign-conversion] + +Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/29fb84735c9c1ce0c3b72d3fc21bdf9744e37f64] +Signed-off-by: Khem Raj +--- + glib/tests/string.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/glib/tests/string.c b/glib/tests/string.c +index 3d922961692..73a125d4116 100644 +--- a/glib/tests/string.c ++++ b/glib/tests/string.c +@@ -348,7 +348,7 @@ test_string_prepend_c (void) + string = g_string_new ("hi pete!"); + + for (i = 0; i < 10000; i++) +- g_string_prepend_c (string, 'a'+(i%26)); ++ g_string_prepend_c (string, (char)('a'+(i%26))); + + g_assert((strlen("hi pete!") + 10000) == string->len); + g_assert((strlen("hi pete!") + 10000) == strlen(string->str)); diff --git a/meta/recipes-core/glib-2.0/glib.inc b/meta/recipes-core/glib-2.0/glib.inc index 844841e88e..7258cf3170 100644 --- a/meta/recipes-core/glib-2.0/glib.inc +++ b/meta/recipes-core/glib-2.0/glib.inc @@ -237,6 +237,7 @@ SRC_URI += "file://run-ptest \ file://skip-monotonic-time-similar.patch \ file://0001-tests-gdbus-server-auth-Create-the-long-path-inside-.patch \ file://0001-girepository-Only-prepend-library-path-for-g-ir-scann.patch \ + file://0001-Wsign-conversion-warning-on-arm64-OpenBSD-in-GString-tests.patch \ " SRC_URI:append:class-native = " file://relocate-modules.patch \ file://0001-meson.build-do-not-enable-pidfd-features-on-native-g.patch \