From 52359956e4cba6e2863e7562e43652162673c115 Mon Sep 17 00:00:00 2001 From: Robert Yang Date: Mon, 23 Oct 2017 16:05:23 +0800 Subject: staging.bbclass: staging_populate_sysroot_dir(): fix for multilib Fixed: MACHINE = "qemux86-64" require conf/multilib.conf MULTILIBS = "multilib:lib32" DEFAULTTUNE_virtclass-multilib-lib32 = "x86" $ bitbake core-image-sato lib32-core-image-sato $ bitbake build-sysroots All lib32 manifests which had been built should be installed, but only a few such as qemux86_64-lib32-base-files were installed (it was installed because MACHINE_ARCH was still qemux86-64 when multilib), but others such as x86-lib32-zlib were not installed, this was incorrect. For multilib builds, fix-up overrides to prepend :virtclass-multilib- and then again append additional multilib arches from the PACKAGE_EXTRA_ARCHS list if needed can fix the problem. Signed-off-by: Robert Yang --- meta/classes/staging.bbclass | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/meta/classes/staging.bbclass b/meta/classes/staging.bbclass index 412e269bd2..455eb056f0 100644 --- a/meta/classes/staging.bbclass +++ b/meta/classes/staging.bbclass @@ -190,8 +190,23 @@ def staging_populate_sysroot_dir(targetsysroot, nativesysroot, native, d): pkgarchs = ['${MACHINE_ARCH}'] pkgarchs = pkgarchs + list(reversed(d.getVar("PACKAGE_EXTRA_ARCHS").split())) pkgarchs.append('allarch') + + # Handle multilib archs + variants = d.getVar("MULTILIB_VARIANTS", True) or "" + for variant in variants.split(): + localdata = bb.data.createCopy(d) + overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + variant + localdata.setVar("OVERRIDES", overrides) + bb.data.update_data(localdata) + pkgarchs_ml = localdata.getVar('PACKAGE_EXTRA_ARCHS').split() + for arch in pkgarchs_ml: + if arch not in pkgarchs: + pkgarchs.append(arch) + targetdir = targetsysroot + bb.debug(1, 'pkgarchs: %s' % pkgarchs) + bb.utils.mkdirhier(targetdir) for pkgarch in pkgarchs: for manifest in glob.glob(d.expand("${SSTATE_MANIFESTS}/manifest-%s-*.populate_sysroot" % pkgarch)): -- cgit 1.2.3-korg