<?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>8784</bug_id>
          
          <creation_ts>2015-12-10 10:07:11 +0000</creation_ts>
          <short_desc>IMAGE_LINGUAS did not support multilib correctly</short_desc>
          <delta_ts>2016-07-29 02:20:17 +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>OE-Core</product>
          <component>core</component>
          <version>2.2</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.2 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Hongxu Jia">hongxu.jia</reporter>
          <assigned_to name="Hongxu Jia">hongxu.jia</assigned_to>
          <cc>liezhi.yang</cc>
    
    <cc>mark.hatle</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
          
          
          <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>57154</commentid>
    <comment_count>0</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2015-12-10 10:07:11 +0000</bug_when>
    <thetext>IMAGE_LINGUAS did not support multilib correctly

1. Make use of service in meta-skeleton to test the issue.
   The app invoke setlocale(LC_CTYPE, &quot;en_US.UTF-8&quot;) in C.

--- a/meta-skeleton/recipes-skeleton/service/service/skeleton_test.c
+++ b/meta-skeleton/recipes-skeleton/service/service/skeleton_test.c
@@ -1,12 +1,13 @@
-#include &lt;unistd.h&gt;
-
-/* This demo does nothing except for testing /etc/init.d/skeleton */
+#include &lt;locale.h&gt;
+#include &lt;stdio.h&gt;
+#include &lt;errno.h&gt;
+#include &lt;string.h&gt;
 
 int main(int argc, char *argv[])
 {
-       daemon(0, 0);
-       while (1) {
-               sleep(1);
-       }
-       return 0;
+    char *p = setlocale (LC_CTYPE, &quot;en_US.UTF-8&quot;);
+    if (p == NULL)
+        printf(&quot;setlocale failed: %s\n&quot;, strerror(errno));
+    else
+        printf(&quot;p %s\n&quot;, p);
 }

--- a/meta-skeleton/recipes-skeleton/service/service_0.1.bb
+++ b/meta-skeleton/recipes-skeleton/service/service_0.1.bb
@@ -1,4 +1,4 @@
-SUMMARY = &quot;The canonical example of init scripts&quot;
+SUMMARY = &quot;The example to test multilib of setlocale&quot;
 SECTION = &quot;base&quot;
 LICENSE = &quot;GPLv2&quot;
 LIC_FILES_CHKSUM = &quot;file://${WORKDIR}/COPYRIGHT;md5=349c872e0066155e1818b786938876a4&quot;
@@ -8,24 +8,14 @@ SRC_URI = &quot;file://skeleton \
           file://COPYRIGHT \
           &quot;
 
+FILES_${PN} += &quot;${libdir}/setlocale&quot;
+
 do_compile () {
-       ${CC} ${WORKDIR}/skeleton_test.c -o ${WORKDIR}/skeleton-test
+       ${CC} ${WORKDIR}/skeleton_test.c -o ${WORKDIR}/setlocale
 }
 
 do_install () {
-       install -d ${D}${sysconfdir}/init.d
-       cat ${WORKDIR}/skeleton | \
-         sed -e &apos;s,/etc,${sysconfdir},g&apos; \
-             -e &apos;s,/usr/sbin,${sbindir},g&apos; \
-             -e &apos;s,/var,${localstatedir},g&apos; \
-             -e &apos;s,/usr/bin,${bindir},g&apos; \
-             -e &apos;s,/usr,${prefix},g&apos; &gt; ${D}${sysconfdir}/init.d/skeleton
-       chmod a+x ${D}${sysconfdir}/init.d/skeleton
-
-       install -d ${D}${sbindir}
-       install -m 0755 ${WORKDIR}/skeleton-test ${D}${sbindir}/
+       install -d ${D}${libdir}
+       install -m 0755 ${WORKDIR}/setlocale ${D}${libdir}/
 }
 
-RDEPENDS_${PN} = &quot;initscripts&quot;
-
-CONFFILES_${PN} += &quot;${sysconfdir}/init.d/skeleton&quot;


2. On qemux86-64, enable multilib, add non-multilib and
   multilib service to image, assign &apos;en-us&apos; to IMAGE_LINGUAS
vim local.conf
...
MACHINE ?= &quot;qemux86-64&quot;

require conf/multilib.conf
MULTILIBS = &quot;multilib:lib32&quot;
DEFAULTTUNE_virtclass-multilib-lib32 = &quot;core2-32&quot;

IMAGE_INSTALL_append = &quot; file service lib32-service&quot;
IMAGE_LINGUAS_append = &quot; en-us&quot;
...

vim bblayers.conf
...
BBLAYERS ?= &quot; \ 
  /buildarea/raid0/hjia/poky/meta \
  /buildarea/raid0/hjia/poky/meta-yocto \
  /buildarea/raid0/hjia/poky/meta-skeleton \
  &quot;
...

2. Build non-multilib image
$ bitbake core-image-minimal

3. Run qemu
$ runqemu qemux86-64 core-image-minimal slirp nographic

4. In qemu, invoke multilib /usr/lib/setlocale failed and
   invoke non-multilib /usr/lib64/setlocale success

root@qemux86-64:~# file /usr/lib/setlocale 
/usr/lib/setlocale: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=0caa404112fe8963dd1418757fc4bdee0cab272d, stripped
root@qemux86-64:~# /usr/lib/setlocale 
setlocale failed: No such file or directory

root@qemux86-64:~# file /usr/lib64/setlocale  
/usr/lib64/setlocale: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=b8c88222213ffbd4603b34337b3db71aba43c968, stripped
root@qemux86-64:~# 
root@qemux86-64:~# /usr/lib64/setlocale
p en_US.UTF-8

5. The locale-base-en-us installed, but lib32-locale-base-en-us not installed.
root@qemux86-64:~# ls /usr/lib64/locale/en_US/
LC_ADDRESS         LC_CTYPE           LC_MEASUREMENT     LC_MONETARY        LC_NUMERIC         LC_TELEPHONE
LC_COLLATE         LC_IDENTIFICATION  LC_MESSAGES

root@qemux86-64:~# ls /usr/lib/locale/en_US/
ls: /usr/lib/locale/en_US/: No such file or directory</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64631</commentid>
    <comment_count>1</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2016-07-29 02:20:17 +0000</bug_when>
    <thetext>Rarely use IMAGE_LINGUAS for multilib, and the fix introduced more issue
than fixed.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>