From: Felix Moessbauer <felix.moessbauer@siemens.com>
To: isar-users@googlegroups.com
Cc: henning.schild@siemens.com, adriaan.schmidt@siemens.com,
jan.kiszka@siemens.com, ibr@ilbers.de, amikan@ilbers.de,
Felix Moessbauer <felix.moessbauer@siemens.com>
Subject: [PATCH v5 1/5] do not crossbuild SDK for host-arch eq dist-arch
Date: Mon, 19 Sep 2022 13:20:31 +0200 [thread overview]
Message-ID: <20220919112035.830233-2-felix.moessbauer@siemens.com> (raw)
In-Reply-To: <20220919112035.830233-1-felix.moessbauer@siemens.com>
This patch adds logic to detect when ISAR_CROSS_COMPILE
is set, but host-arch equals dist-arch.
In this case, we do not add the crossbuild-essential package,
but instead add the build-essential one.
To implement this, we transfer the existing logic into a
anonymous python function to make it better readable.
Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
meta/classes/sdk.bbclass | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/meta/classes/sdk.bbclass b/meta/classes/sdk.bbclass
index 32ee2de7..f42a2ba1 100644
--- a/meta/classes/sdk.bbclass
+++ b/meta/classes/sdk.bbclass
@@ -41,8 +41,18 @@ SDK_PREINSTALL += " \
devscripts \
equivs"
-TOOLCHAIN = "${@'crossbuild-essential-${DISTRO_ARCH}' if d.getVar('ISAR_CROSS_COMPILE', True) == '1' else 'build-essential'}"
-TOOLCHAIN_append_compat-arch = " crossbuild-essential-${COMPAT_DISTRO_ARCH}"
+# Choose the correct toolchain: cross or native
+python __anonymous() {
+ mode = d.getVar('ISAR_CROSS_COMPILE', True)
+ distro_arch = d.getVar('DISTRO_ARCH')
+ if mode == "0" or d.getVar('HOST_ARCH') == distro_arch:
+ toolchain = "build-essential"
+ else:
+ toolchain = "crossbuild-essential-" + distro_arch
+ if d.getVar('ISAR_ENABLE_COMPAT_ARCH', True) == "1":
+ toolchain += " crossbuild-essential-" + d.getVar('COMPAT_DISTRO_ARCH')
+ d.setVar('TOOLCHAIN', toolchain)
+}
# rootfs/image overrides for the SDK
ROOTFS_ARCH_class-sdk = "${HOST_ARCH}"
--
2.30.2
next prev parent reply other threads:[~2022-09-19 11:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-19 11:20 [PATCH v5 0/5] use xz and gzip on host (outside chroot) Felix Moessbauer
2022-09-19 11:20 ` Felix Moessbauer [this message]
2022-09-19 11:20 ` [PATCH v5 2/5] run imager in buildchroot-host on cross Felix Moessbauer
2022-09-19 11:20 ` [PATCH v5 3/5] add option to control deploy of raw wic partitions Felix Moessbauer
2022-09-19 12:03 ` Henning Schild
2022-09-19 12:22 ` Moessbauer, Felix
2022-09-20 7:55 ` Henning Schild
2022-09-20 8:39 ` Jan Kiszka
2022-09-20 12:23 ` Henning Schild
2022-09-20 10:49 ` Henning Schild
2022-09-19 11:20 ` [PATCH v5 4/5] add test for wic partition deploy logic Felix Moessbauer
2022-09-19 11:20 ` [PATCH v5 5/5] add wic.xz image to qemuarm64-bookworm Felix Moessbauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220919112035.830233-2-felix.moessbauer@siemens.com \
--to=felix.moessbauer@siemens.com \
--cc=adriaan.schmidt@siemens.com \
--cc=amikan@ilbers.de \
--cc=henning.schild@siemens.com \
--cc=ibr@ilbers.de \
--cc=isar-users@googlegroups.com \
--cc=jan.kiszka@siemens.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox