From patchwork Mon May 11 09:29:35 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joao Marcos Costa X-Patchwork-Id: 87826 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 21C2CCD37AC for ; Mon, 11 May 2026 09:29:58 +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.46152.1778491794405190885 for ; Mon, 11 May 2026 02:29:54 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@bootlin.com header.s=dkim header.b=yqY+qRUu; 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 C85BD1A350A; Mon, 11 May 2026 09:29:52 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 9699960646; Mon, 11 May 2026 09:29:52 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 84E4011AE8433; Mon, 11 May 2026 11:29:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1778491792; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=czyHg0LbcI0Sl2b8I79NQ/1uapgWk4bBfGm6NxKs8cQ=; b=yqY+qRUui3TfB9MOdcAF9x0Defvrg/wSQqbMJOppGueAALmVN20TgOj3wsIMnvVntpePfo yZE1Vyi74QGbeqVvsbjkxD/g9/dEoa9Ms0jRzqq4OSCFhGcA1tjjLDyeWNMoKZH4g3J2It u+tVnvD4VkGFKFNvNJWq0NSDmoZ6VMFUTmf1wPbY6fsQGa6MfZEfS8wdoS42/ARkgyehGR L7igggw9wxtt6QcCHL6befVb/gQnUQJcX84mzUfsWeofPeQEr3720LAv5eGQEsU+yVfFFC 7kLcITbNQeuvxxkfkYpPUNG403YbJ6mY4eDOgnMJtSj9s5vwJEBbd0C1xutQ3A== From: =?utf-8?q?Jo=C3=A3o_Marcos_Costa?= To: openembedded-core@lists.openembedded.org Cc: thomas.petazzoni@bootlin.com, quentin.schulz@cherry.de, khem.raj@gmail.com, =?utf-8?q?Jo=C3=A3o_Marcos_Costa?= Subject: [PATCH 3/3] ovmf: add support for Clang toolchain Date: Mon, 11 May 2026 11:29:35 +0200 Message-ID: <20260511092935.2631121-4-joaomarcos.costa@bootlin.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20260511092935.2631121-1-joaomarcos.costa@bootlin.com> References: <20260511092935.2631121-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 ; Mon, 11 May 2026 09:29:58 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/236793 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 8e2d172f66..93380b2ba9 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"