From patchwork Fri Dec 4 19:37:57 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 107475 Received: from mail-dy1-f173.google.com (mail-dy1-f173.google.com [74.125.82.173]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.396.1796413079884634743 for ; Fri, 04 Dec 2026 11:37:59 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20260707 header.b=KYysnbvt; spf=pass (domain: gmail.com, ip: 74.125.82.173, mailfrom: raj.khem@gmail.com) Received: by mail-dy1-f173.google.com with SMTP id 5a478bee46e88-386ab9ab619so2145402eec.1 for ; Fri, 04 Dec 2026 11:37:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796413079; x=1797017879; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=6SdZ0wOQKb2zzxFbefTdzKYsFSsPon2219dkx7WhO+I=; b=KYysnbvtHopDXOx5tEGG8Rx2pkhvYtev+mH8ItZX5mZHBWOSo77aw2X9YDjX+XCYz5 Wrlryfu87h2/EO4uYzz2ydqzLhMmTLUuTRfZKQ3NjqsNzlGF2uOFTUkqF+kdDc6lpgjD ngiiqacpm6DZvvICymrDA4+CC1k1TsGlFNTmbSue9l61uahi052elMmOPNzayyCni+vS UiyI+U+HKVLzCuRDXwEn6OMJHZp1F+mU01M/prBJI3QSGERFAXk3i3FsQnfYWZhRawgK aehqf0UsRMcaARjmmHlgTxFuwWFIrseQWphe/xjNEy/sXOR3j8CWjiNMvuyeORoY8GCx PYbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796413079; x=1797017879; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=6SdZ0wOQKb2zzxFbefTdzKYsFSsPon2219dkx7WhO+I=; b=FtFvFIKQgJ0+5h62j9uo3Fha6pmrKNwbRzoSZowaCB+QLezUBweG2Uzvg9X9iM1kD1 w3gt1QO5E/iF0G6koiCTPvZf9hepSU/wYGeBXqXJVQEeD6VaxG4b62gBYj8LriVmzKZW PRrM16od7rsGMpEpHy23EHwGP6WgPEnE4nw+cTm7TPyN0KGLZs4oRC7IvZF4uxTUofgC a0b8zu5GARMnqbEUVBlbqeDrcRskWpyAfIl/FZolqwDoldt/CBrKvkN0qOmz8chHYvNg sYqSPGwnWIPW4dvZH9c318M//44bMIY/LyFq4tSqZ653yht+hAc30WwnfAS7sPZ1g6Nt /QTQ== X-Gm-Message-State: AB4q+uFiaJKeMUga3ZfD15c6QMu9Gr2DDEDCtNnVcBhpv24hgJp46sBX 3ywo6YVfUT95W/RV8UBHuRP50vxrecluYOZ38MTiVWbNaGbix2zm2h+J2buat/Ha X-Gm-Gg: AZFdTZcZ7KGaTW33Dxtvc1/kHxgTT8dTC5yn7TY+/EUOwxfh14Z5zKhx2EFqEHdBLxB Q2HTWypj5Lvjfk1Si0FrIrzKoWuQzJ4qAN8olIm/+RCpWmsAbt7lwdCCqVj8O814DIfsyFRcgG3 iXtoswa4+S/WvCudhRsK63CpfyDYoUZdA32rdiVj3wg4FBXOt4RKe1TnryjYkoZO/3ISuU0VGm5 zzyMU9mHCDeMSBU4TJ4XVJiEfNBH/NrFTfvBVkp+f0gwkxWXwi4SvzghlCugunCSxGGXWaDggae BPxasvtPy625VM3mEQ5MXZsAI49hbdTsKQhjXYM69/gnOzsGi/cIQdumZvPpSUy7IxzJI4j8Ki2 whMdclCy+VwvydHViH8kSLy+SmopmAg6iwXasC5ymDx3Alh9CjVUPoTGQ+tmyUpRQ+0XX7cQpq7 39emOIsfMfU7+capz3k0fX9Sf2jLZHhXyT3NlNbr78tjHcUuomD/Mm6DQgk81flcYDyPgQr1uLP oQqmZcMcr4wrMWaphli1/vAUVp61xLuV+j3fFHbsaGn1lexz/Tbvz+1wQ/uZtQI/I7k5rOKdbEM abQpqFEJBN0YiSVVW0p0n3igPtYG31o3jzb8pRzcjR1NNoOdTXUn+mg3q/evG4+djAio/KAox7F XK7Pe3Xs32P+XUpxw0kfh/JYf0oy6viLct5ORd95rKBBJOEMsirVtnmqvK2ZWYC+2WsAzyn1EW5 Hi9uT4Mea30d/mXkA4MRSXtclTwOowYmVfGX9oJQHYbFAv+mAF6J393JtLYt0hz1Qb685HKf2iT MT4GNTRPZ5PRGz7vJc9EPUNM1uCldHlnxX/TPEOVmNsDcsh3+q56If48zwQB/GJffwyCqtUSTx5 Jearj/4lo1gH/ew4cZid15z42A== X-Received: by 2002:a05:693c:65c4:b0:386:c5b8:960b with SMTP id 5a478bee46e88-387520ed568mr3105483eec.17.1796413078970; Fri, 04 Dec 2026 11:37:58 -0800 (PST) Return-Path: Received: from apollo.tail3ccdd3.ts.net ([147.160.63.35]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3875207ac8csm11570795eec.2.2026.12.04.11.37.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2026 11:37:58 -0800 (PST) From: Khem Raj X-Google-Original-From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH v2] venus-protocol: Fix tests build with clang Date: Fri, 4 Dec 2026 11:37:57 -0800 Message-ID: <20261204193757.951297-1-khem.raj@oss.qualcomm.com> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204063216.2449490-2-khem.raj@oss.qualcomm.com> References: <20261204063216.2449490-2-khem.raj@oss.qualcomm.com> 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 ; Fri, 04 Dec 2026 19:38:06 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/252099 The generated reply sizeof helpers pass the address of an uninitialized return value to vn_sizeof_(). Newer clang reports this with -Wuninitialized-const-pointer, and since the project builds with werror=true, the tests fail to compile: error: variable 'ret' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] Initialize the value in the generator templates. AI-Generated: Uses Claude Code Signed-off-by: Khem Raj --- v2: Update the patch to match the upstream MR after review: declare ret const and initialize it with { 0 }. ...ize-ret-before-passing-it-to-vn_size.patch | 48 +++++++++++++++++++ .../mesa/venus-protocol_1.1.3.bb | 4 +- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-graphics/mesa/venus-protocol/0001-templates-Initialize-ret-before-passing-it-to-vn_size.patch diff --git a/meta/recipes-graphics/mesa/venus-protocol/0001-templates-Initialize-ret-before-passing-it-to-vn_size.patch b/meta/recipes-graphics/mesa/venus-protocol/0001-templates-Initialize-ret-before-passing-it-to-vn_size.patch new file mode 100644 index 0000000000..be10f27f34 --- /dev/null +++ b/meta/recipes-graphics/mesa/venus-protocol/0001-templates-Initialize-ret-before-passing-it-to-vn_size.patch @@ -0,0 +1,48 @@ +From 18f7b4316c73d61002417762708fd2bad02626d1 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 3 Dec 2026 19:54:38 -0800 +Subject: [PATCH] templates: Initialize ret before passing it to vn_sizeof_*() + +The generated vn_sizeof_*_reply() and vn_decode_*_args_temp() helpers +declare the return value and pass its address to vn_sizeof_() +without initializing it. Newer clang (seen with clang 23) reports this +with -Wuninitialized-const-pointer, and the tests fail to build because +the project sets werror=true: + + error: variable 'ret' is uninitialized when passed as a const pointer + argument here [-Werror,-Wuninitialized-const-pointer] + cmd_size += vn_sizeof_VkResult(&ret); + +The value is never read, only its size is used. Declare it const and +zero-initialize it. + +Mesa's copy of the generated driver headers emits the same warning. + +Upstream-Status: Submitted [https://gitlab.freedesktop.org/virgl/venus-protocol/-/merge_requests/128] +Signed-off-by: Khem Raj +--- + templates/types_command.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/templates/types_command.h b/templates/types_command.h +index 7c20641..13e72ad 100644 +--- a/templates/types_command.h ++++ b/templates/types_command.h +@@ -40,7 +40,7 @@ static inline void vn_decode_${ty.name}_args_temp(struct vn_cs_decoder *dec, str + size_t offset = vn_sizeof_VkCommandTypeEXT(&cmd_type); + % if ty.ret: + +- ${ty.ret.to_c()}; ++ const ${ty.ret.to_c()} = { 0 }; + ${GEN.sizeof_command_reply(ty, ty.ret, '', 'offset')} + % endif + % for var in ty.variables: +@@ -64,7 +64,7 @@ static inline size_t vn_sizeof_${ty.name}_reply(${ty.c_func_params()}) + size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type); + + % if ty.ret: +- ${ty.ret.to_c()}; ++ const ${ty.ret.to_c()} = { 0 }; + ${GEN.sizeof_command_reply(ty, ty.ret, '', 'cmd_size')} + % endif + % for var in ty.variables: diff --git a/meta/recipes-graphics/mesa/venus-protocol_1.1.3.bb b/meta/recipes-graphics/mesa/venus-protocol_1.1.3.bb index e7701a76f6..80699394d7 100644 --- a/meta/recipes-graphics/mesa/venus-protocol_1.1.3.bb +++ b/meta/recipes-graphics/mesa/venus-protocol_1.1.3.bb @@ -12,7 +12,9 @@ LICENSE = "MIT AND (Apache-2.0 OR MIT)" LIC_FILES_CHKSUM = "file://meson.build;beginline=1;endline=2;md5=7e736041c5167e57165490a93689761e \ file://xmls/vk.xml;beginline=4;endline=5;md5=6784716613b13820761ca251591ef4e1" -SRC_URI = "git://gitlab.freedesktop.org/virgl/venus-protocol.git;protocol=https;branch=main;tag=v${PV}" +SRC_URI = "git://gitlab.freedesktop.org/virgl/venus-protocol.git;protocol=https;branch=main;tag=v${PV} \ + file://0001-templates-Initialize-ret-before-passing-it-to-vn_size.patch \ + " SRCREV = "ca19b6358d7cc491bc3e4de76f04c6700876a8fa" DEPENDS = "python3-mako-native"