<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>7607</bug_id>
          
          <creation_ts>2015-04-14 14:26:16 +0000</creation_ts>
          <short_desc>uclibc as alternative libc for a multilib no longer works</short_desc>
          <delta_ts>2015-09-03 14:32:58 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>BitBake</product>
          <component>bitbake</component>
          <version>1.7</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.9 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Paul Eggleton">bluelightning</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>bogdanx.a.voiculescu</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
          
          <qa_contact name="Bogdan Alexandru Voiculescu">bogdanx.a.voiculescu</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>50296</commentid>
    <comment_count>0</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-04-14 14:26:16 +0000</bug_when>
    <thetext>If I add the following to local.conf to enable a multilib that uses uclibc instead of glibc:

---------- snip -----------
require conf/multilib.conf
MULTILIBS = &quot;multilib:lib32&quot;
DEFAULTTUNE_virtclass-multilib-lib32 = &quot;x86&quot;
baselib_virtclass-multilib-lib32 = &quot;lib32&quot;
LIBCEXTENSION_virtclass-multilib-lib32 = &quot;-uclibc&quot;
LIBCOVERRIDE_virtclass-multilib-lib32 = &quot;:libc-uclibc&quot;
PREFERRED_PROVIDER_virtual/lib32-libc = &quot;uclibc&quot;
PREFERRED_PROVIDER_virtual/lib32-libiconv = &quot;libiconv&quot;
PREFERRED_PROVIDER_virtual/lib32-libintl = &quot;gettext&quot;
USE_NLS_virtclass-multilib-lib32 = &quot;no&quot;
CXXFLAGS_append_virtclass-multilib-lib32 = &quot; -fvisibility-inlines-hidden&quot;
IMAGE_LINGUAS_virtclass-multilib-lib32 = &quot;&quot;
LIBC_DEPENDENCIES_virtclass-multilib-lib32 = &quot;uclibc uclibc-dbg uclibc-dev uclibc-thread-db&quot;
PTEST_ENABLED_virtclass-multilib-lib32 = &quot;&quot;
---------- snip -----------

With dizzy/fido you get the following error building any image:

---------- snip -----------
NOTE: Resolving any missing task queue dependencies
ERROR: Nothing PROVIDES &apos;lib32-glibc&apos;
ERROR: lib32-glibc was skipped: incompatible with target linux-uclibc
ERROR: Required build target &apos;core-image-sato&apos; has no buildable providers.
Missing or unbuildable dependency chain was: [&apos;core-image-sato&apos;, &apos;lib32-glibc&apos;]
---------- snip -----------

If I disable the SkipPackage raising within the glibc recipe and use bitbake -g -DDD it appears that the PREFERRED_PROVIDER_virtual/lib32-libc is being completely ignored - it suggests setting it even though it&apos;s already set:

---------- snip -----------
DEBUG: providers for virtual/lib32-libc are: [&apos;lib32-glibc&apos;, &apos;lib32-uclibc&apos;]
DEBUG: selecting virtual:multilib:lib32:/home/paul/poky/poky/meta/recipes-core/glibc/glibc_2.21.bb as PREFERRED_VERSION 2.21 of package lib32-glibc (for item virtual/lib32-libc)
DEBUG: selecting virtual:multilib:lib32:/home/paul/poky/poky/meta/recipes-core/uclibc/uclibc_git.bb as PREFERRED_VERSION 0.9.33+git% of package lib32-uclibc (for item virtual/lib32-libc)
DEBUG: sorted providers for virtual/lib32-libc are: [&apos;virtual:multilib:lib32:/home/paul/poky/poky/meta/recipes-core/glibc/glibc_2.21.bb&apos;, &apos;virtual:multilib:lib32:/home/paul/poky/poky/meta/recipes-core/uclibc/uclibc_git.bb&apos;]
NOTE: multiple providers are available for virtual/lib32-libc (lib32-glibc, lib32-uclibc)
NOTE: consider defining a PREFERRED_PROVIDER entry to match virtual/lib32-libc
DEBUG: adding virtual:multilib:lib32:/home/paul/poky/poky/meta/recipes-core/glibc/glibc_2.21.bb to satisfy virtual/lib32-libc
DEBUG: adding virtual:multilib:lib32:/home/paul/poky/poky/meta/recipes-core/uclibc/uclibc_git.bb to satisfy virtual/lib32-libc
---------- snip -----------</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50307</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2015-04-15 07:59:47 +0000</bug_when>
    <thetext>First observation is that if you comment out the &quot;raise bb.parse.SkipPackage&quot; anonymous python functions in the glibc recipe, the build at least doesn&apos;t abort. There are then PREFERRED_PROVIDER warnings. I think there is something odd going on with the multilib selection and BBCLASSEXTEND.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50308</commentid>
    <comment_count>2</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2015-04-15 08:33:22 +0000</bug_when>
    <thetext>I&apos;ve debugged this. I thought some background on how may be useful. Commenting out the SkipParse messages meant &quot;bitbake core-image-minimal -g&quot; could run. If you then grep task-depends.dot, you find:

&quot;core-image-minimal.do_configure&quot; -&gt; &quot;lib32-ncurses.do_populate_sysroot&quot;
&quot;core-image-minimal.do_configure&quot; -&gt; &quot;lib32-glibc.do_populate_sysroot&quot;

which is a smoking gun. The question then becomes why is an image do_configure depending on those two things. This comes from TOOLCHAIN_NEED_CONFIGSITE_CACHE in toolchain-scripts. Unfortunately the value is hard to override however if you patch the class:

diff --git a/meta/classes/toolchain-scripts.bbclass b/meta/classes/toolchain-scripts.bbclass
index 0e849e4..8809ec2 100644
--- a/meta/classes/toolchain-scripts.bbclass
+++ b/meta/classes/toolchain-scripts.bbclass
@@ -98,7 +98,7 @@ EOF
 #we get the cached site config in the runtime
 TOOLCHAIN_CONFIGSITE_NOCACHE = &quot;${@siteinfo_get_files(d, True)}&quot;
 TOOLCHAIN_CONFIGSITE_SYSROOTCACHE = &quot;${STAGING_DIR}/${MLPREFIX}${MACHINE}/${target_datadir}/${TARGET_SYS}_config_site.d&quot;
-TOOLCHAIN_NEED_CONFIGSITE_CACHE = &quot;${TCLIBC} ncurses&quot;
+TOOLCHAIN_NEED_CONFIGSITE_CACHE ??= &quot;${TCLIBC} ncurses&quot;
 
 #This function create a site config file
 toolchain_create_sdk_siteconfig () {

then set TOOLCHAIN_NEED_CONFIGSITE_CACHE = &quot;&quot; in local.conf, the build will proceed correctly (even once the SkipParse is reinstated, that isn&apos;t the issue, just helps with debugging).

How we fix TOOLCHAIN_NEED_CONFIGSITE_CACHE properly needs more thought. The issue is the TCLIBC is not being used correctly in the multilib context.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50388</commentid>
    <comment_count>3</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-04-17 16:17:08 +0000</bug_when>
    <thetext>To give a status update, the aforementioned workaround has been merged:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=59c09e3755f3ceabc7fc31af9346da3524e365e2

Ideally though what we really still need is a better way of handling this so you don&apos;t need to set TOOLCHAIN_NEED_CONFIGSITE_CACHE.

I&apos;ve also filed bug #7623 to avoid having to disable the SkipPackage/SkipRecipe when debugging situations like this in future.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51934</commentid>
    <comment_count>4</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2015-06-25 15:12:58 +0000</bug_when>
    <thetext>http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=6cfed59323ce51909bbf2c8efbceb50e67835eb7</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53688</commentid>
    <comment_count>5</comment_count>
    <who name="Bogdan Alexandru Voiculescu">bogdanx.a.voiculescu</who>
    <bug_when>2015-09-03 14:32:58 +0000</bug_when>
    <thetext>verified on commit: 71b0568fa43285f0946fae93fb43cea5f3bbecec
no build errors found on &quot;bitbake core-image-minimal&quot;, after enabling multilib that uses uclibc</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>