From patchwork Sun Dec 6 01:14:41 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 107536 Received: from mail-dl1-f52.google.com (mail-dl1-f52.google.com [74.125.82.52]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.639.1796519683728141129 for ; Sat, 05 Dec 2026 17:14:43 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20260707 header.b=BXHwtbF5; spf=pass (domain: gmail.com, ip: 74.125.82.52, mailfrom: raj.khem@gmail.com) Received: by mail-dl1-f52.google.com with SMTP id a92af1059eb24-1b5d5f5a5adso4294404c88.1 for ; Sat, 05 Dec 2026 17:14:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796519683; x=1797124483; 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=E+1rvGIYNAfHkdr0uWBUQqmPYMsHpqaY8t8kUzJe/wY=; b=BXHwtbF5QXWxjxaCFPN0S2gAvcxCNBjyl1g04v3y66Y+cuZmXAz5zpr1JBxGZWfwwZ +RQt/Pix9L5RL0i4zSlysJP/WltdEMCEU5ru6gjS4pmB/0UYi7uWKC01LquyLySPD4oG cyB6Sc4ffBS6fo9H/TeGxPHDeQSycMbClxth/4END6XD2bJ75QE2Nag7NnUgs5Ska0+t +y8y7UBro+qzeYTlzzQnxh/bI5Nh8SlSqnGDSJssBix6XLOoJ1CQ3ubj6r7P2xxp0h4j iXhs2k4IL02VV/x11uVy23ksxThh7RuWx74d1iFqmAqsnMrDir+CR2FMceuJkcfgcPUo WXtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796519683; x=1797124483; 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=E+1rvGIYNAfHkdr0uWBUQqmPYMsHpqaY8t8kUzJe/wY=; b=iwHY/ulRHHob0VEq6w8r7mf2NBU+ja21YZodzT1VAUhf2ni9b3ZweqKQ1cF4/Eslu7 4VgcTxW+DITHST1kOYQLWxN7DzYrsqmHuS1n6ZvVdxYoOSTgDCXxQ7c1dHy13ro330Qc 2S43Pvbv4P0gBqC7Fb+FDYOHDLRgzzfLx7Cf6EuhZMiiNznoxvPSNGoa0MEm1SgSfoFG AnXuB4e66Oe5uSFILeB7gPhzGrcqMYTRsLW2Leb86ar+oULdHcr5Zsalbx2pgjt0jImA OicRdiOSZ2/ZW+xkChiK4+2ZdXtnvlAQm5VPTVy5/il60kVMQEtGUfwJTXvlVLPANHiY 7O+w== X-Gm-Message-State: APuU4Z/Nt+7fPyr0acqAW23QqW8sCKhHmm9quIQW6IDy+Hqmdp0/vBCx XNt1gzLOtAqswAAxi6+XY9eBS/4qWK0mqo8FOE1Cqp0EXDmcK+CyoIHXJQU7cx/lCvP0Yg== X-Gm-Gg: AZFdTZeMPWbXEFJCNFpl7oCEnNlZjkS3SAsRIQL0aT0H0QoToNuPPqElaABPsmqHDIz BnUjs3aVj90yNXfaAQek/rSZ0iX6osQIM1Ci4kqvoytwWBogPmudScn2GABYY16Z/p/zWzdkC3P aDmgWYhUqU+yM+468qU23XIm9+czfxl8s4LHrdQ333fBiLz0wv7NQ/fSkVbW0ZjLss85d65W047 vOjGKJ2UKDvI3yG7B+5LFmrlvlIclzcs6BcOb9u8/3g75NTRDhMBItVCSBnZ8sAF86+05I7s/qa oyMNtoNIxJPdWiAkY4LYFH4+X57DG0+VTEyhOupl3repc+3FKLnSfipv3AB3zFPAWES68s3WKnf uAKSef+1stbJWCnlLQlbJs6vABxUHlyqqvkVCQ5oyzBGDJwmu8DrYUF2ycNkUElYCpIKP7JPoq8 3mfsR5HzGJEzzSgNSb31m7p4fT06fKLnf51i6TMR2qJNQoXJxfugWzhX2V/ZN/kzOatRTiPFoKY 0nNsqFVpko1e5YaSiHwdfP2zj+Ryj7BqjeirZzo1+sDxqrd31gmku8BPRpMUGW19AD5q5y0gN8V ag+44KLZXIzLG6Aegq+sHPOFOxFbkSCyWZ+mMZkH6C/23Btw1RyGL4JbTujmrNnRAT5L52za7u3 pVmnbQr52Iu0WKKUit/d8yWy2rPRYY9HorgUF4dCEohHnMSRjFHHYstA6cYbDOCAztW3l5jyY+3 tNjQBaaP9/FOQMZm2MHK8eQl2sH3c/wM0zdT2d3vgHacQzmIBgzVrUfI71zmERGb5Tn9R7XIo8W rzlNYKdXj8C7RamXwKqidXKlc9GvPXS8oEQ8oeCfHpfCrVG1vC+GqXcmypxLIHRwv5bHzdN8maS MuqMgFSAhp9KEbl+NjHCqGzh+Q== X-Received: by 2002:a05:7022:287:10b0:1b2:48db:23dd with SMTP id a92af1059eb24-1b5d70d27f7mr6085694c88.16.1796519682983; Sat, 05 Dec 2026 17:14:42 -0800 (PST) Return-Path: Received: from apollo.tail3ccdd3.ts.net ([147.160.63.35]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1b5d6323d8esm22842366c88.0.2026.12.05.17.14.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Dec 2026 17:14:42 -0800 (PST) From: Khem Raj X-Google-Original-From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH v3] venus-protocol: Fix tests build with clang Date: Sat, 5 Dec 2026 17:14:41 -0800 Message-ID: <20261206011441.1257572-1-khem.raj@oss.qualcomm.com> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204193757.951297-1-khem.raj@oss.qualcomm.com> References: <20261204193757.951297-1-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 ; Sun, 06 Dec 2026 01:14:52 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/252122 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. Signed-off-by: Khem Raj --- v3: The fix was merged upstream (c26b440); mark the patch as a Backport. ...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..c844129b73 --- /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: Backport [https://gitlab.freedesktop.org/virgl/venus-protocol/-/commit/c26b440a5fb6a861b7e38deeeb18aed786d3ae6b] +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"