[OE-core] [PATCH 2/3] populate_sdk_base.bbclass: help rpm to pull in multilib toolchain

Richard Purdie richard.purdie at linuxfoundation.org
Sat Aug 15 08:55:50 UTC 2015


On Thu, 2015-08-13 at 00:37 -0700, Robert Yang wrote:
> When configure multilib, "bitbake <image_bb> -c populate_sdk" should
> install all arch toolchains (for example, 32 and 64bit), but rpm not
> handle the multilib requires correctly, for example:
> lib32-packagegroup-core-standalone-sdk-target requires lib32-libc6, rpm
> may pull in libc6 rather than lib32-libc6, if we directly use something
> like IMAGE_INSTALL_append = " lib32-libc6", then it works well, so
> update TOOLCHAIN_TARGET_TASK to include the RDEPENDS packages will fix
> the issue.

Whilst I understand why you're doing this, its rather sad that as the
rpm multilib code is broken, we have to hack the core sdk code like this
to work around it.

Could/should we not put this into the rpm sdk backend instead?

I also can't help this is just a bandaid and that we'll likely find
other ways this breaks in the future, its not a complete solution to the
issue :/.

Cheers,

Richard

> [YOCTO #8089]
> 
> Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
> ---
>  meta/classes/populate_sdk_base.bbclass |   32 ++++++++++++++++++++++++++++++++
>  1 file changed, 32 insertions(+)
> 
> diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
> index a9e9bd7..c2491ea 100644
> --- a/meta/classes/populate_sdk_base.bbclass
> +++ b/meta/classes/populate_sdk_base.bbclass
> @@ -83,8 +83,40 @@ POPULATE_SDK_POST_HOST_COMMAND_append = " write_host_sdk_manifest; "
>  fakeroot python do_populate_sdk() {
>      from oe.sdk import populate_sdk
>      from oe.manifest import create_manifest, Manifest
> +    import oe.packagedata
>  
>      pn = d.getVar('PN', True)
> +    # Help rpm to pull in multilib requires since it may not pull in
> +    # them correctly, for example,
> +    # lib32-packagegroup-core-standalone-sdk-target requires
> +    # lib32-libc6, rpm may pull in libc6 rather than lib32-libc6, but
> +    # directly use
> +    # TOOLCHAIN_TARGET_TASK_append = " lib32-libc6" works well.
> +    for pkg in (d.getVar('TOOLCHAIN_TARGET_TASK', True) or "").split():
> +        sub_data = oe.packagedata.read_subpkgdata(pkg, d)
> +        sub_rdep = sub_data.get("RDEPENDS_" + pkg)
> +        if not sub_rdep:
> +            continue
> +        done = sub_rdep.split()
> +        next = done
> +        # Find all the rdepends on the dependency chain
> +        while next:
> +            new = []
> +            for sub_pkg in next:
> +                sub_data = oe.packagedata.read_subpkgdata(sub_pkg, d)
> +                sub_pkg_rdep = sub_data.get("RDEPENDS_" + sub_pkg)
> +                if not sub_pkg_rdep:
> +                    continue
> +                for p in sub_pkg_rdep.split():
> +                    if p in done:
> +                        continue
> +                    if not p.startswith('(') and \
> +                            oe.packagedata.has_subpkgdata(p, d):
> +                        # It's a new rdep
> +                        done.append(p)
> +                        new.append(p)
> +            next = new
> +        d.appendVar('TOOLCHAIN_TARGET_TASK', ' ' + " ".join(done))
>      runtime_mapping_rename("TOOLCHAIN_TARGET_TASK", pn, d)
>      runtime_mapping_rename("TOOLCHAIN_TARGET_TASK_ATTEMPTONLY", pn, d)
>  
> -- 
> 1.7.9.5
> 





More information about the Openembedded-core mailing list