From patchwork Thu May 14 13:34:44 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jo=C3=A3o_Marcos_Costa?= X-Patchwork-Id: 88103 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85827CD4F39 for ; Thu, 14 May 2026 13:35:36 +0000 (UTC) Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.11150.1778765726237917963 for ; Thu, 14 May 2026 06:35:27 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@bootlin.com header.s=dkim header.b=rRpQeaAC; spf=pass (domain: bootlin.com, ip: 185.246.85.4, mailfrom: joaomarcos.costa@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 6E6C54E42C9B for ; Thu, 14 May 2026 13:35:24 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 4589C60495; Thu, 14 May 2026 13:35:24 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 48E9B11AF8FBA; Thu, 14 May 2026 15:35:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1778765723; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=jS6u0Te3Y5iIrTg5Ou8Op/M1zaU7J0lYN1YEJKPo6T0=; b=rRpQeaACDct95wbnvp62KnLdgcFRwdczPUQHXFMUEa2KR8SdFXTqEC85hseWuzNrGKOg9B R+6Ppt3e4hbCJJh9UEzynNefgS1C7+Ep80V+jhkcp6wWHWTYqSwLqQ2AvJdgoz17WIGRda eHR8vTjTg0beGs3AKATTcHWkBAVZdZQPWtEivMYT/KvJEyl0cflWUvehgXXKXABM7UBufW evsDtcRMi8iWrQW7qGQt0I1haqlyrAltdY29318+Fbd5OOKuLavR+JJjrzBkXGNB7N6F9q sKborrUQ1lZR46aN8ejdVu+ASshNLiPl+iUkjIgJER6at63i7YdjPcY8oDMQXA== From: =?utf-8?q?Jo=C3=A3o_Marcos_Costa?= To: openembedded-core@lists.openembedded.org Cc: thomas.petazzoni@bootlin.com, quentin.schulz@cherry.de, raj.khem@gmail.com, Ross.Burton@arm.com, =?utf-8?q?Jo=C3=A3o_Marcos_Costa?= Subject: [PATCH 1/3] ovmf: simplify PACKAGECONFIG's default value Date: Thu, 14 May 2026 15:34:44 +0200 Message-ID: <20260514133446.219612-2-joaomarcos.costa@bootlin.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20260514133446.219612-1-joaomarcos.costa@bootlin.com> References: <20260514133446.219612-1-joaomarcos.costa@bootlin.com> MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 14 May 2026 13:35:36 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/237032 The two append operations call bb.utils.contains, while a single contains_any() does the trick in a cleaner way. Regarding the default value, if tpm is not enabled, PACKAGECONFIG ends up with a couple empty spaces, and this can be avoided by redefining the default value to the result of contains_any(). Even though this replacement comes with a change in behaviour (at least in edge cases), we prefer a consistent PACKAGECONFIG (weak) default assignment across recipes. Signed-off-by: João Marcos Costa --- meta/recipes-core/ovmf/ovmf_git.bb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/meta/recipes-core/ovmf/ovmf_git.bb b/meta/recipes-core/ovmf/ovmf_git.bb index 958f42fc10..cc251bbc00 100644 --- a/meta/recipes-core/ovmf/ovmf_git.bb +++ b/meta/recipes-core/ovmf/ovmf_git.bb @@ -9,9 +9,7 @@ LIC_FILES_CHKSUM = "file://OvmfPkg/License.txt;md5=06357ddc23f46577c2aeaeaf7b776 # Enabling Secure Boot adds a dependency on OpenSSL and implies # compiling OVMF twice, so it is disabled by default. Distros # may change that default. -PACKAGECONFIG ??= "" -PACKAGECONFIG += "${@bb.utils.filter('MACHINE_FEATURES', 'tpm', d)}" -PACKAGECONFIG += "${@bb.utils.contains('MACHINE_FEATURES', 'tpm2', 'tpm', '', d)}" +PACKAGECONFIG ??= "${@bb.utils.contains_any('MACHINE_FEATURES', 'tpm tpm2', 'tpm', '', d)}" PACKAGECONFIG[debug] = ",,," PACKAGECONFIG[secureboot] = ",,," PACKAGECONFIG[tpm] = "-D TPM_ENABLE=TRUE,-D TPM_ENABLE=FALSE,," From patchwork Thu May 14 13:34:45 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jo=C3=A3o_Marcos_Costa?= X-Patchwork-Id: 88102 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9DD28CD4F3C for ; Thu, 14 May 2026 13:35:36 +0000 (UTC) Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.11151.1778765727869714650 for ; Thu, 14 May 2026 06:35:28 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@bootlin.com header.s=dkim header.b=X5yCyT6s; spf=pass (domain: bootlin.com, ip: 185.246.84.56, mailfrom: joaomarcos.costa@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 525E01A35BF; Thu, 14 May 2026 13:35:26 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 1799660495; Thu, 14 May 2026 13:35:26 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 0262811AF8C61; Thu, 14 May 2026 15:35:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1778765725; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=HnZRtVIyLylv7LcCxgQWEU0B05piv+ApWsnaokXhtm8=; b=X5yCyT6szsfpZjA547GaPL4xd5ZusWEm+IDsvlt/WnRUxM9/aRF8vz9OU0m9XQxnVeueOu 9LA2FjTATf31RewrUhl9xrGPiOZ6G+XzrR7BlRct4hwvbRhWAl0JVBnGf9rl0OXOLcBBb/ Sk+uWfciz85L4MztO/bZju0uIJ6jt8jvnthy868Qa2Dg65LJNUjX9jcrao5uqbxqkWCnNH EWb6/fhPT8bFBOAK5zvOV3zD04CihInBrNO2/hF4kkf0fN31zyizo1ZGJlYYpzva6HeBjJ 7U3SwjXnGUQoVDjeaF0+mjxKl/MsCTlNEXU2Q7VbgO7+PlibxWyYFo/6ZezXnQ== From: =?utf-8?q?Jo=C3=A3o_Marcos_Costa?= To: openembedded-core@lists.openembedded.org Cc: thomas.petazzoni@bootlin.com, quentin.schulz@cherry.de, raj.khem@gmail.com, Ross.Burton@arm.com, =?utf-8?q?Jo=C3=A3o_Marcos_Costa?= Subject: [PATCH 2/3] ovmf: drop upstreamed BUILD_CFLAGS setting Date: Thu, 14 May 2026 15:34:45 +0200 Message-ID: <20260514133446.219612-3-joaomarcos.costa@bootlin.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20260514133446.219612-1-joaomarcos.costa@bootlin.com> References: <20260514133446.219612-1-joaomarcos.costa@bootlin.com> MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 14 May 2026 13:35:36 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/237033 This same gcc (v12) warning was handled upstream a while ago: 22130dcd98b4 ("Basetools: turn off gcc12 warning") This change is available in the tag we currently use: edk2-stable202511. In fact, it is available since edk2-stable202205, and the -Wno-error=stringop-overflow flag [1] was added for the same reason we have it in ovmf's recipe. [1] https://github.com/tianocore/edk2/blob/master/BaseTools/Source/C/DevicePath/GNUmakefile#L27 Signed-off-by: João Marcos Costa --- meta/recipes-core/ovmf/ovmf_git.bb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/meta/recipes-core/ovmf/ovmf_git.bb b/meta/recipes-core/ovmf/ovmf_git.bb index cc251bbc00..f91f458006 100644 --- a/meta/recipes-core/ovmf/ovmf_git.bb +++ b/meta/recipes-core/ovmf/ovmf_git.bb @@ -14,10 +14,6 @@ PACKAGECONFIG[debug] = ",,," PACKAGECONFIG[secureboot] = ",,," PACKAGECONFIG[tpm] = "-D TPM_ENABLE=TRUE,-D TPM_ENABLE=FALSE,," -# GCC12 trips on it -#see https://src.fedoraproject.org/rpms/edk2/blob/rawhide/f/0032-Basetools-turn-off-gcc12-warning.patch -BUILD_CFLAGS += "-Wno-error=stringop-overflow" - SRC_URI = "gitsm://github.com/tianocore/edk2.git;branch=master;protocol=https;tag=${PV} \ file://0001-ovmf-update-path-to-native-BaseTools.patch \ file://0002-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch \ From patchwork Thu May 14 13:34:46 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jo=C3=A3o_Marcos_Costa?= X-Patchwork-Id: 88104 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id BCD6FCD4851 for ; Thu, 14 May 2026 13:35:36 +0000 (UTC) Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.11142.1778765729236698969 for ; Thu, 14 May 2026 06:35:29 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@bootlin.com header.s=dkim header.b=biaDjIbB; spf=pass (domain: bootlin.com, ip: 185.246.84.56, mailfrom: joaomarcos.costa@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id A8D0D1A35C0; Thu, 14 May 2026 13:35:27 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 7F14860495; Thu, 14 May 2026 13:35:27 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 8801111AF8FBA; Thu, 14 May 2026 15:35:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1778765727; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=AE4qFF1iQy8Cqz6cWv6akpstWz76dgtBZpuBldxbRlc=; b=biaDjIbBNXk18JFkZHlVuPjA3jpP15uz+Hq38P0JqOkw/PFpQrKgW+nQPfZdGdnLT05Rjh xczIHc06cJPpzN+xvmzZ4a5lM1LDKX7Auv0muQ4lLbLCWpwJ7Pu7gOL1lrtXPXCLWQlRvT SHnAsdNGAFVdVM7UNZXJAxpPt22rbKS895z7boFvBfLk14ibp991OapfrwVcJQ9/1K0dOy NmFq55OCq2gscthGwOHHj8GkZNjJxDFeMCz7QpLjJ2WcPHz84CGjiF/N93VLaOf0zz6zqh xX5WiUmK3dEMA2Kwo6FIZKpWZj7xafQmT81dj5KA65nb4fxvrTCqHUT4fUzcrA== From: =?utf-8?q?Jo=C3=A3o_Marcos_Costa?= To: openembedded-core@lists.openembedded.org Cc: thomas.petazzoni@bootlin.com, quentin.schulz@cherry.de, raj.khem@gmail.com, Ross.Burton@arm.com, =?utf-8?q?Jo=C3=A3o_Marcos_Costa?= Subject: [PATCH 3/3] ovmf: add support for Clang toolchain Date: Thu, 14 May 2026 15:34:46 +0200 Message-ID: <20260514133446.219612-4-joaomarcos.costa@bootlin.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20260514133446.219612-1-joaomarcos.costa@bootlin.com> References: <20260514133446.219612-1-joaomarcos.costa@bootlin.com> MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 14 May 2026 13:35:36 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/237034 ovmf can be built with clang by using "CLANGDWARF" toolchain, so add TARGET_TOOLS variable to represent the switch between "GCC" and "CLANGDWARF". Since the targets represented by FIXED_GCCVER were deprecated upstream, remove them (and FIXED_GCCVER itself) from the recipe and use "GCC" instead. Signed-off-by: João Marcos Costa --- meta/recipes-core/ovmf/ovmf_git.bb | 43 ++++++------------------------ 1 file changed, 8 insertions(+), 35 deletions(-) diff --git a/meta/recipes-core/ovmf/ovmf_git.bb b/meta/recipes-core/ovmf/ovmf_git.bb index f91f458006..25c857bdf9 100644 --- a/meta/recipes-core/ovmf/ovmf_git.bb +++ b/meta/recipes-core/ovmf/ovmf_git.bb @@ -55,6 +55,7 @@ inherit deploy PARALLEL_MAKE = "" DEPENDS = "nasm-native acpica-native ovmf-native util-linux-native" +DEPENDS:append:toolchain-clang = " lld-native" EDK_TOOLS_DIR = "edk2_basetools" @@ -145,39 +146,13 @@ fix_toolchain:append:class-native() { export NASM_PREFIX_MAP = "--debug-prefix-map=${WORKDIR}=${TARGET_DBGSRC_DIR}" export GCC_PREFIX_MAP = "${DEBUG_PREFIX_MAP} -Wno-stringop-overflow -Wno-maybe-uninitialized" -GCC_VER = "$(${CC} -v 2>&1 | tail -n1 | awk '{print $3}')" - -fixup_target_tools() { - case ${1} in - 4.4.*) - FIXED_GCCVER=GCC44 - ;; - 4.5.*) - FIXED_GCCVER=GCC45 - ;; - 4.6.*) - FIXED_GCCVER=GCC46 - ;; - 4.7.*) - FIXED_GCCVER=GCC47 - ;; - 4.8.*) - FIXED_GCCVER=GCC48 - ;; - 4.9.*) - FIXED_GCCVER=GCC49 - ;; - *) - FIXED_GCCVER=GCC5 - ;; - esac - echo ${FIXED_GCCVER} -} - do_compile:class-native() { oe_runmake -C ${S}/BaseTools } +TARGET_TOOLS ?= "GCC" +TARGET_TOOLS:toolchain-clang = "CLANGDWARF" + do_compile:class-target() { export LFLAGS="${LDFLAGS}" PARALLEL_JOBS="${@oe.utils.parallel_make_argument(d, '-n %d')}" @@ -198,13 +173,12 @@ do_compile:class-target() { rm -rf ${WORKDIR}/ovmf mkdir ${WORKDIR}/ovmf OVMF_DIR_SUFFIX="X64" - FIXED_GCCVER=$(fixup_target_tools ${GCC_VER}) - bbnote FIXED_GCCVER is ${FIXED_GCCVER} - build_dir="${S}/Build/Ovmf$OVMF_DIR_SUFFIX/${OVMF_BUILD_TYPE}_${FIXED_GCCVER}" + bbnote TARGET_TOOLS is ${TARGET_TOOLS} + build_dir="${S}/Build/Ovmf$OVMF_DIR_SUFFIX/${OVMF_BUILD_TYPE}_${TARGET_TOOLS}" bbnote "Building without Secure Boot." rm -rf ${S}/Build/Ovmf$OVMF_DIR_SUFFIX - ${S}/OvmfPkg/build.sh $PARALLEL_JOBS -a $OVMF_ARCH -b ${OVMF_BUILD_TYPE} -t ${FIXED_GCCVER} ${PACKAGECONFIG_CONFARGS} + ${S}/OvmfPkg/build.sh $PARALLEL_JOBS -a $OVMF_ARCH -b ${OVMF_BUILD_TYPE} -t ${TARGET_TOOLS} ${PACKAGECONFIG_CONFARGS} ln ${build_dir}/FV/OVMF.fd ${WORKDIR}/ovmf/ovmf.fd ln ${build_dir}/FV/OVMF_CODE.fd ${WORKDIR}/ovmf/ovmf.code.fd ln ${build_dir}/FV/OVMF_VARS.fd ${WORKDIR}/ovmf/ovmf.vars.fd @@ -214,7 +188,7 @@ do_compile:class-target() { # Repeat build with the Secure Boot flags. bbnote "Building with Secure Boot." rm -rf ${S}/Build/Ovmf$OVMF_DIR_SUFFIX - ${S}/OvmfPkg/build.sh $PARALLEL_JOBS -a $OVMF_ARCH -b ${OVMF_BUILD_TYPE} -t ${FIXED_GCCVER} ${PACKAGECONFIG_CONFARGS} ${OVMF_SECURE_BOOT_FLAGS} + ${S}/OvmfPkg/build.sh $PARALLEL_JOBS -a $OVMF_ARCH -b ${OVMF_BUILD_TYPE} -t ${TARGET_TOOLS} ${PACKAGECONFIG_CONFARGS} ${OVMF_SECURE_BOOT_FLAGS} ln ${build_dir}/FV/OVMF.fd ${WORKDIR}/ovmf/ovmf.secboot.fd ln ${build_dir}/FV/OVMF_CODE.fd ${WORKDIR}/ovmf/ovmf.secboot.code.fd ln ${build_dir}/${OVMF_ARCH}/EnrollDefaultKeys.efi ${WORKDIR}/ovmf/ @@ -277,4 +251,3 @@ do_deploy:class-target() { addtask do_deploy after do_compile before do_build BBCLASSEXTEND = "native" -TOOLCHAIN = "gcc"