From: Jan Kiszka <jan.kiszka@siemens.com>
To: isar-users <isar-users@googlegroups.com>
Cc: Adriaan Schmidt <adriaan.schmidt@siemens.com>,
Felix Moessbauer <felix.moessbauer@siemens.com>,
Uladzimir Bely <ubely@ilbers.de>,
Cedric Hombourger <cedric.hombourger@siemens.com>
Subject: [PATCH v3 3/9] crossvars: Adjust logic to account for -native package builds in non-cross setups
Date: Thu, 12 Oct 2023 07:16:39 +0200 [thread overview]
Message-ID: <0e19bab2ebab1fdd4676d9d88e3d3770d19ca018.1697087805.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1697087805.git.jan.kiszka@siemens.com>
From: Jan Kiszka <jan.kiszka@siemens.com>
When selecting a -native version of a package while cross-building is
disabled for it, we will use the target build env instead. That may
work, just slowly, or even fail miserably.
Extend the build env selection logic to take PACKAGE_ARCH into account
as well. It defaults to DISTRO_ARCH for non-package recipe, thus should
works fine for those as well.
Reported-by: Cedric Hombourger <cedric.hombourger@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
meta/classes/crossvars.bbclass | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/meta/classes/crossvars.bbclass b/meta/classes/crossvars.bbclass
index 22bc4714..a7834b99 100644
--- a/meta/classes/crossvars.bbclass
+++ b/meta/classes/crossvars.bbclass
@@ -16,16 +16,22 @@ python __anonymous() {
flavor_suffix = ('-' + flavor) if flavor else ''
distro_arch = d.getVar('DISTRO_ARCH')
- if mode == "0" or d.getVar('HOST_ARCH') == distro_arch or distro_arch == None:
+ compat_arch = d.getVar('COMPAT_DISTRO_ARCH')
+ host_arch = d.getVar('HOST_ARCH')
+ package_arch = d.getVar('PACKAGE_ARCH')
+
+ if distro_arch != host_arch and \
+ (package_arch == host_arch or \
+ (package_arch in [distro_arch, compat_arch] and mode == "1")):
+ d.setVar('BUILD_ARCH', host_arch)
+ schroot_dir = d.getVar('SCHROOT_HOST_DIR', False)
+ sbuild_dep = "sbuild-chroot-host" + flavor_suffix + ":do_build"
+ sdk_toolchain = "crossbuild-essential-" + distro_arch
+ else:
d.setVar('BUILD_ARCH', distro_arch)
schroot_dir = d.getVar('SCHROOT_TARGET_DIR', False)
sbuild_dep = "sbuild-chroot-target" + flavor_suffix + ":do_build"
sdk_toolchain = "build-essential"
- else:
- d.setVar('BUILD_ARCH', d.getVar('HOST_ARCH'))
- schroot_dir = d.getVar('SCHROOT_HOST_DIR', False)
- sbuild_dep = "sbuild-chroot-host" + flavor_suffix + ":do_build"
- sdk_toolchain = "crossbuild-essential-" + distro_arch
d.setVar('SCHROOT_DIR', schroot_dir + flavor_suffix)
d.setVar('SCHROOT_DEP', sbuild_dep)
if isar_can_build_compat(d):
--
2.35.3
next prev parent reply other threads:[~2023-10-12 5:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-12 5:16 [PATCH v3 0/9] HOST_ARCH, -native, riscv64, and all the rest Jan Kiszka
2023-10-12 5:16 ` [PATCH v3 1/9] Rename BUILD_HOST_ARCH to BUILD_ARCH Jan Kiszka
2023-10-12 5:16 ` [PATCH v3 2/9] dpkg: Drop redundant PACKAGE_ARCH initialization Jan Kiszka
2023-10-12 5:16 ` Jan Kiszka [this message]
2023-10-12 5:16 ` [PATCH v3 4/9] multiarch: Downgrade native dependencies when building in emulated environment Jan Kiszka
2023-10-12 5:16 ` [PATCH v3 5/9] meta-isar: jh7110-u-boot-spl-tool: Rely on native annotation Jan Kiszka
2023-10-12 5:16 ` [PATCH v3 6/9] meta-isar: jh7110-u-boot-spl-image: Fix native build Jan Kiszka
2023-10-12 5:16 ` [PATCH v3 7/9] meta-isar: u-boot-starfive-visionfive2: Simplify build dependencies Jan Kiszka
2023-10-12 5:16 ` [PATCH v3 8/9] linux-custom: Drop unused template variable Jan Kiszka
2023-10-12 5:16 ` [PATCH v3 9/9] Move riscv64 from sid-ports to regular sid Jan Kiszka
2023-10-13 7:59 ` [PATCH v3 0/9] HOST_ARCH, -native, riscv64, and all the rest Uladzimir Bely
2023-10-13 8:36 ` Jan Kiszka
2023-10-16 7:15 ` Uladzimir Bely
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=0e19bab2ebab1fdd4676d9d88e3d3770d19ca018.1697087805.git.jan.kiszka@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=adriaan.schmidt@siemens.com \
--cc=cedric.hombourger@siemens.com \
--cc=felix.moessbauer@siemens.com \
--cc=isar-users@googlegroups.com \
--cc=ubely@ilbers.de \
/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