Add support to compile source for multilib in the eSDK
cover Add support to compile source for multilib in the eSDK
* Install multilib toolchain in the eSDK if multilib configuration is enabled during the eSDK build.
* Search multilib manifest files to populate multilib packages such as lib32-gcc-runtime during the eSDK installation.
Jagadeesh K (2):
meta-extsdk-toolchain: Install multilib toolchain files in the eSDK if
multilib is enabled
staging: parse multilib sstate manifest files to install multilib
packages in the eSDK
meta/classes-global/staging.bbclass | 6 ++++++ meta/recipes-core/meta/meta-extsdk-toolchain.bb | 17 ++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-)
Signature · 1 line
2.39.5
PATCH 1/2 meta-extsdk-toolchain: Install multilib toolchain files in the eSDK if multilib is enabled
1. Ship multilib virtual/cross-cc, virtual/compilerlibs, and virtual/libc packages in the eSDK if it is created with multilib configuration. These packages are required to compile source for multilib using the eSDK.
2. Include multilib tune configuration directory in SPDX_MULTILIB_SSTATE_ARCHS to search SPDX document as meta-extsdk-toolchain is dependent on multilib recipes.
[YOCTO #14020]
--- meta/recipes-core/meta/meta-extsdk-toolchain.bb | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-)
meta/recipes-core/meta/meta-extsdk-toolchain.bb +16 -1
@@ -2,7 +2,22 @@ SUMMARY = "Extensible SDK toolchain meta-recipe" DESCRIPTION = "Meta-recipe for ensuring the build directory contains all appropriate toolchain packages for using an IDE" LICENSE = "MIT" -DEPENDS = "virtual/libc ${MLPREFIX}gdb-cross-${TARGET_ARCH} qemu-native qemu-helper-native unfs3-native" +DEPENDS = "virtual/libc ${MLPREFIX}gdb-cross-${TARGET_ARCH} qemu-native qemu-helper-native unfs3-native ${@add_multilib_depends(d)}" + +def add_multilib_depends(d): + mlpkgs = "" + for v in d.getVar('MULTILIB_VARIANTS').split(): + localdata = bb.data.createCopy(d) + override = ":virtclass-multilib-" + v + localdata.setVar("OVERRIDES", localdata.getVar("OVERRIDES", False) + override) + for p in localdata.getVar('BASEDEPENDS').split(): + pkg = localdata.getVar("PREFERRED_PROVIDER_%s" % p) + if pkg: + mlpkgs = mlpkgs + ' ' + v + '-' + pkg + return mlpkgs + +# Search the SPDX document of multilib recipe in multilib tune configuration directory. +SPDX_MULTILIB_SSTATE_ARCHS = "${@all_multilib_tune_values(d, 'SSTATE_ARCHS')}" do_populate_sysroot[deptask] = "do_populate_sysroot"
Signature · 1 line
2.39.5
Re: [OE-core][PATCH 1/2] meta-extsdk-toolchain: Install multilib toolchain files in the eSDK if multilib is enabled
Quoted 11 lines · Jagadeesh Krishnanjanappa via lists.openembedded.org
1. Ship multilib virtual/cross-cc, virtual/compilerlibs, and virtual/libc packages in the eSDK if it is created with multilib configuration. These packages are required to compile source for multilib using the eSDK.
2. Include multilib tune configuration directory in
SPDX_MULTILIB_SSTATE_ARCHSto search SPDX document as meta-extsdk-toolchain is dependent on multilib recipes.[YOCTO #14020]
Signed-off-by Jagadeesh K <[email protected]>---
Hi Jagadeesh,
Thanks for your patch.
It looks like this is failing to build with "world" target:
ERROR: meta-extsdk-toolchain-1.0-r0 do_create_recipe_spdx: Failure expanding variable SPDX_MULTILIB_SSTATE_ARCHS, expression was ${@all_multilib_tune_values(d, 'SSTATE_ARCHS')} which triggered exception NameError: name 'all_multilib_tune_values' is not defined
...
ERROR: lib32-meta-extsdk-toolchain-1.0-r0 do_create_spdx: Failure expanding variable SPDX_MULTILIB_SSTATE_ARCHS, expression was ${@all_multilib_tune_values(d, 'SSTATE_ARCHS')} which triggered exception NameError: name 'all_multilib_tune_values' is not defined
https://autobuilder.yoctoproject.org/valkyrie/#/builders/59/builds/4790
https://autobuilder.yoctoproject.org/valkyrie/#/builders/17/builds/4615
Can you have a look at the issue?
Thanks,
Mathieu
Signature · 3 lines
Mathieu Dubois-Briand, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Re: [PATCH 1/2] meta-extsdk-toolchain: Install multilib toolchain files in the eSDK if multilib is enabled
Yes, I will look into the build failure.
Regards,
Jagadeesh
Re: [PATCH 1/2] meta-extsdk-toolchain: Install multilib toolchain files in the eSDK if multilib is enabled
I have submitted updated patches (v2) to fix the above errors.
The functions from utils.bbclass have been moved to utils.py, hence
reference of multilib_tune_values() should be replaced with oe.utils.all_multilib_tune_values().
Sorry, I could not catch this error as I was at a older code base.
Regards,
Jagadeesh
PATCH 2/2 staging: parse multilib sstate manifest files to install multilib packages in the eSDK
In reply to Jagadeesh KSince the multilib-DEFAULTTUNE is not part of <pkgarch> of staging_populate_sysroot_dir function, the SSTATE_MANFILEPREFIX files of multilib packages are not parsed and due to this multilib package files are not populated in the <eSDK_install_dir>/tmp/sysroots during the installation of the eSDK. Hence, the eSDK sysroots lacks header files required to compile source for multilib.
For example:
The header file bits/c++config.h given by lib32-gcc-runtime recipe, is not populated in the <eSDK_install_directory>/tmp/sysroots by the staging_populate_sysroot_dir function as <pkgarch> list does not contains multilib-DEFAULTTUNE (i.e 'x86' in case of qemux86-64).
This change adds multilib-DEFAULTTUNE to <pkgarch> list and thereby parsing multilib SSTATE_MANFILEPREFIX files and populating multilib package files during the eSDK installation.
--- meta/classes-global/staging.bbclass | 6 ++++++ 1 file changed, 6 insertions(+)
meta/classes-global/staging.bbclass +6 -0
@@ -204,6 +204,12 @@ 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') + multilibs = d.getVar('MULTILIB_VARIANTS').split() + if multilibs: + for ml in multilibs: + mltunes = d.getVar('DEFAULTTUNE:virtclass-multilib-%s' % ml) + if mltunes: + pkgarchs.append(mltunes) targetdir = targetsysroot bb.utils.mkdirhier(targetdir)
Signature · 1 line
2.39.5