From patchwork Wed Aug 9 14:49:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 28586 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 95497C04A94 for ; Wed, 9 Aug 2023 14:49:27 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.90113.1691592559840608199 for ; Wed, 09 Aug 2023 07:49:19 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 962B6D75; Wed, 9 Aug 2023 07:50:01 -0700 (PDT) Received: from oss-tx204.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id C002A3F59C; Wed, 9 Aug 2023 07:49:18 -0700 (PDT) From: ross.burton@arm.com To: openembedded-core@lists.openembedded.org Cc: nd@arm.com Subject: [PATCH 1/4] meson.bbclass: add MESON_TARGET Date: Wed, 9 Aug 2023 15:49:14 +0100 Message-Id: <20230809144917.3110384-1-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 09 Aug 2023 14:49:27 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/185705 From: Ross Burton Add a variable to control what target gets built in do_compile. By default this value is unset so meson builds the default target, but by setting MESON_TARGET a specific target can be built. Signed-off-by: Ross Burton --- meta/classes-recipe/meson.bbclass | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/meta/classes-recipe/meson.bbclass b/meta/classes-recipe/meson.bbclass index 7f5e9b19433..582b41a91b1 100644 --- a/meta/classes-recipe/meson.bbclass +++ b/meta/classes-recipe/meson.bbclass @@ -20,6 +20,9 @@ do_configure[cleandirs] = "${B}" # Where the meson.build build configuration is MESON_SOURCEPATH = "${S}" +# The target to build in do_compile. If unset the default targets are built. +MESON_TARGET ?= "" + def noprefix(var, d): return d.getVar(var).replace(d.getVar('prefix') + '/', '', 1) @@ -170,7 +173,7 @@ do_configure[postfuncs] += "meson_do_qa_configure" do_compile[progress] = "outof:^\[(\d+)/(\d+)\]\s+" meson_do_compile() { - meson compile -v ${PARALLEL_MAKE} + meson compile -v ${PARALLEL_MAKE} ${MESON_TARGET} } meson_do_install() { From patchwork Wed Aug 9 14:49:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 28588 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 A1644C04A6A for ; Wed, 9 Aug 2023 14:49:27 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.90114.1691592560400499831 for ; Wed, 09 Aug 2023 07:49:20 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5E79C11FB; Wed, 9 Aug 2023 07:50:02 -0700 (PDT) Received: from oss-tx204.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 891F03F59C; Wed, 9 Aug 2023 07:49:19 -0700 (PDT) From: ross.burton@arm.com To: openembedded-core@lists.openembedded.org Cc: nd@arm.com Subject: [PATCH 2/4] meson.bbclass:: update do_write_config vardeps Date: Wed, 9 Aug 2023 15:49:15 +0100 Message-Id: <20230809144917.3110384-2-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230809144917.3110384-1-ross.burton@arm.com> References: <20230809144917.3110384-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 09 Aug 2023 14:49:27 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/185706 From: Ross Burton Add OBJCOPY and EXEWRAPPER_ENABLED, remove LD as it isn't used anymore. Signed-off-by: Ross Burton --- meta/classes-recipe/meson.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/classes-recipe/meson.bbclass b/meta/classes-recipe/meson.bbclass index 582b41a91b1..d08a83d555f 100644 --- a/meta/classes-recipe/meson.bbclass +++ b/meta/classes-recipe/meson.bbclass @@ -61,7 +61,7 @@ def rust_tool(d, target_var): return "rust = %s" % repr(cmd) addtask write_config before do_configure -do_write_config[vardeps] += "CC CXX LD AR NM STRIP READELF CFLAGS CXXFLAGS LDFLAGS RUSTC RUSTFLAGS" +do_write_config[vardeps] += "CC CXX AR NM STRIP READELF OBJCOPY CFLAGS CXXFLAGS LDFLAGS RUSTC RUSTFLAGS EXEWRAPPER_ENABLED" do_write_config() { # This needs to be Py to split the args into single-element lists cat >${WORKDIR}/meson.cross < X-Patchwork-Id: 28585 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 93D69C41513 for ; Wed, 9 Aug 2023 14:49:27 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.90115.1691592561218228182 for ; Wed, 09 Aug 2023 07:49:21 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 27A64D75; Wed, 9 Aug 2023 07:50:03 -0700 (PDT) Received: from oss-tx204.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5247A3F59C; Wed, 9 Aug 2023 07:49:20 -0700 (PDT) From: ross.burton@arm.com To: openembedded-core@lists.openembedded.org Cc: nd@arm.com Subject: [PATCH 3/4] systemd-boot: use MESON_TARGET Date: Wed, 9 Aug 2023 15:49:16 +0100 Message-Id: <20230809144917.3110384-3-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230809144917.3110384-1-ross.burton@arm.com> References: <20230809144917.3110384-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 09 Aug 2023 14:49:27 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/185707 From: Ross Burton Instead of re-implementing do_compile, use MESON_TARGET. Signed-off-by: Ross Burton --- meta/recipes-core/systemd/systemd-boot_254.bb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/meta/recipes-core/systemd/systemd-boot_254.bb b/meta/recipes-core/systemd/systemd-boot_254.bb index e887e636e86..a490c0328e6 100644 --- a/meta/recipes-core/systemd/systemd-boot_254.bb +++ b/meta/recipes-core/systemd/systemd-boot_254.bb @@ -22,6 +22,8 @@ c_ld = ${@meson_array('EFI_LD', d)} EOF } +MESON_TARGET = "systemd-boot" + EXTRA_OEMESON += "-Defi=true \ -Dbootloader=true \ -Dman=false \ @@ -51,10 +53,6 @@ TUNE_CCARGS:remove = "-mfpmath=sse" COMPATIBLE_HOST = "(aarch64.*|arm.*|x86_64.*|i.86.*)-linux" COMPATIBLE_HOST:x86-x32 = "null" -do_compile() { - ninja systemd-boot -} - do_install() { install -d ${D}${EFI_FILES_PATH} install ${B}/src/boot/efi/systemd-boot*.efi ${D}${EFI_FILES_PATH}/${SYSTEMD_BOOT_IMAGE} From patchwork Wed Aug 9 14:49:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 28587 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 93D3AC001B0 for ; Wed, 9 Aug 2023 14:49:27 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.90076.1691592562166493690 for ; Wed, 09 Aug 2023 07:49:22 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DC00F11FB; Wed, 9 Aug 2023 07:50:03 -0700 (PDT) Received: from oss-tx204.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 1B8DE3F59C; Wed, 9 Aug 2023 07:49:20 -0700 (PDT) From: ross.burton@arm.com To: openembedded-core@lists.openembedded.org Cc: nd@arm.com Subject: [PATCH 4/4] systemd-boot: improve cross file generation Date: Wed, 9 Aug 2023 15:49:17 +0100 Message-Id: <20230809144917.3110384-4-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230809144917.3110384-1-ross.burton@arm.com> References: <20230809144917.3110384-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 09 Aug 2023 14:49:27 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/185708 From: Ross Burton The meson.cross generated by the class already has c and objcopy entries, so these can be removed. Pass the --cross-file option in MESON_CROSS_FILE to ensure the ordering is always correct. Signed-off-by: Ross Burton --- meta/recipes-core/systemd/systemd-boot_254.bb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/meta/recipes-core/systemd/systemd-boot_254.bb b/meta/recipes-core/systemd/systemd-boot_254.bb index a490c0328e6..c32aa0ae125 100644 --- a/meta/recipes-core/systemd/systemd-boot_254.bb +++ b/meta/recipes-core/systemd/systemd-boot_254.bb @@ -12,22 +12,21 @@ LDFLAGS:prepend = "${@ " ".join(d.getVar('LD').split()[1:])} " EFI_LD = "bfd" -do_write_config[vardeps] += "CC OBJCOPY EFI_LD" +do_write_config[vardeps] += "EFI_LD" do_write_config:append() { cat >${WORKDIR}/meson-${PN}.cross <