From patchwork Thu May 14 14:15:15 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: 88109 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 F191ACD4851 for ; Thu, 14 May 2026 14:15: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.12135.1778768131298313094 for ; Thu, 14 May 2026 07:15:31 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@bootlin.com header.s=dkim header.b=csVLfhci; 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 A33571A35BC; Thu, 14 May 2026 14:15:29 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 65C9C60495; Thu, 14 May 2026 14:15:29 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 25BC911AF8FBE; Thu, 14 May 2026 16:15:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1778768128; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=jS6u0Te3Y5iIrTg5Ou8Op/M1zaU7J0lYN1YEJKPo6T0=; b=csVLfhciIkjkCEHRVMAMSCYO6vGv1oO/XHRO3b/5bju8QFUuI8yaZnc+bLIDjWCIL911hl Bx52uZn65S5Mz38kUChthuwr9XitAgzrUzTL6/xv3xarElKuhePrdkKDNSsbatUX7F3jJa El0kK/94/vmLkukhVrxne+H953gTHTFI7kHD19S4LCm9MdMNzjyZjlX/qfxDEUT6SzIDGZ 7k08P0NQPpHujl7o7pjsFmDeAe7EYwLK2oMrYjzwEJrFkEcBpMAnCDAbJmu4K0mjxR0QbP H1QBGFksS2UDuhFXWnYKX9aVV8s4Cp6VfcCfRqcmciWbByqq7r1aQn6IHYaB5Q== 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 v2 1/3] ovmf: simplify PACKAGECONFIG's default value Date: Thu, 14 May 2026 16:15:15 +0200 Message-ID: <20260514141517.226933-2-joaomarcos.costa@bootlin.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20260514141517.226933-1-joaomarcos.costa@bootlin.com> References: <20260514141517.226933-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 14:15:36 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/237041 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 14:15:16 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: 88108 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 0572ACD4F39 for ; Thu, 14 May 2026 14:15:37 +0000 (UTC) Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.12140.1778768135496994184 for ; Thu, 14 May 2026 07:15:35 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@bootlin.com header.s=dkim header.b=0Aa9fx/0; spf=pass (domain: bootlin.com, ip: 185.171.202.116, mailfrom: joaomarcos.costa@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 50376C5DC78; Thu, 14 May 2026 14:16:24 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 6000160495; Thu, 14 May 2026 14:15:33 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 3FBE911AF8FBE; Thu, 14 May 2026 16:15:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1778768132; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=HnZRtVIyLylv7LcCxgQWEU0B05piv+ApWsnaokXhtm8=; b=0Aa9fx/06y965LfeQp3AGbijKU0DqsvQgQx1vHNZwZ+r/VKM7l85H0IfRq+AK9gi9q4Lnu OJhF93iYnsE4+qu3evDWYHsaZke5CuLE/rdEa8gvc+fRXYDiqUwD7SsCJdHeoOc6csB+K2 tVTV8EDjd7bn4xFyOrbZkOZPNUqjkBnbONti3mhAFpfY1jdZ+mEwIG0OU/HFQ1UtqKaHHc clXSYJjUjkRvnFWoupbE08QUyzZD9PipIMHSwlHb4TgB8f2UuPMpBxPFm0phMPiNoxKUQC RtBihTKFXBA+a2/lFYo5VFSDvqA55nxDD3FYCtjDI8/x5vN2YbNTm6Kv/ZDFkQ== 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 v2 2/3] ovmf: drop upstreamed BUILD_CFLAGS setting Date: Thu, 14 May 2026 16:15:16 +0200 Message-ID: <20260514141517.226933-3-joaomarcos.costa@bootlin.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20260514141517.226933-1-joaomarcos.costa@bootlin.com> References: <20260514141517.226933-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 14:15:37 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/237042 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 14:15:17 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: 88110 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 0F936CD4851 for ; Thu, 14 May 2026 14:15:47 +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.12138.1778768137812292507 for ; Thu, 14 May 2026 07:15:38 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@bootlin.com header.s=dkim header.b=Ze5X2cNy; 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 43D231A35BC for ; Thu, 14 May 2026 14:15:36 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 1A9BF60495; Thu, 14 May 2026 14:15:36 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id EDCB511AF8C61; Thu, 14 May 2026 16:15:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1778768135; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=AE4qFF1iQy8Cqz6cWv6akpstWz76dgtBZpuBldxbRlc=; b=Ze5X2cNyMpVSzMBtSUOE8jbH74S1ny6dsqvzAhXTKxNpevtQhlpwNSt/+jy/bjtjgeGPP8 jxuM6eRPHFMuZFs9S9oNJVQXGPQQBMcr0+Z+gmfG/2lbld18lIHLWZglkO4PQ2IIZf6rSw EZbQ8w8i3e8ox4T1VqWVCcUqbDPdSYIaV1ekqTUsz82gKchSdpgVFfyC3NOsEqU+/wAqgz grgmyfx3eYUeCyKzK/TaYPL1IHLYqzdWlCXKc3EmabGDrStrLoW4l21AwSYo4l83agabnE C4nfwsJ8wjhh20awg7RpqRmdgDKBVwbLuxLMwVT6JJA3VDn2vsEFJMPQ2W/Ufw== 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 v2 3/3] ovmf: add support for Clang toolchain Date: Thu, 14 May 2026 16:15:17 +0200 Message-ID: <20260514141517.226933-4-joaomarcos.costa@bootlin.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20260514141517.226933-1-joaomarcos.costa@bootlin.com> References: <20260514141517.226933-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 14:15:47 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/237043 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"