<?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>431</bug_id>
          
          <creation_ts>2010-10-11 19:37:16 +0000</creation_ts>
          <short_desc>start x86 unfs qemu fails after source /opt/poky/envrionment-i586-XXX files</short_desc>
          <delta_ts>2010-12-21 06:07:14 +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>Meta-yocto</product>
          <component>meta-yocto</component>
          <version>0.9</version>
          <rep_platform>x86</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>High</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>0.9 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="liping Ke">liping.ke</reporter>
          <assigned_to name="Scott Garman">scott.a.garman</assigned_to>
          <cc>jessica.zhang</cc>
    
    <cc>kevin.tian</cc>
    
    <cc>lianhao.lu</cc>
    
    <cc>liping.ke</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          <cf_verified>Program Management</cf_verified>
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>10341</commentid>
    <comment_count>0</comment_count>
    <who name="liping Ke">liping.ke</who>
    <bug_when>2010-10-11 19:37:16 +0000</bug_when>
    <thetext>1) source /opt/poky/environment-setup-i586XXX
2) start unfs qemu

It will report:

KERNEL: [/home/lke/images/bzImage-qemuX86.bin]
ROOTFS: [/home/lke/unfs]
FSTYPE: [nfs]
Setting up tap interface under sudo
[sudo] password for lke:
tunctl failed:</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>10342</commentid>
    <comment_count>1</comment_count>
    <who name="liping Ke">liping.ke</who>
    <bug_when>2010-10-11 19:40:43 +0000</bug_when>
    <thetext>Arm has the same problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>10343</commentid>
    <comment_count>2</comment_count>
    <who name="liping Ke">liping.ke</who>
    <bug_when>2010-10-11 19:41:50 +0000</bug_when>
    <thetext>change component</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>10344</commentid>
    <comment_count>3</comment_count>
    <who name="Lianhao Lu">lianhao.lu</who>
    <bug_when>2010-10-11 19:42:42 +0000</bug_when>
    <thetext>PPC had the same problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>10345</commentid>
    <comment_count>4</comment_count>
    <who name="liping Ke">liping.ke</who>
    <bug_when>2010-10-11 19:44:10 +0000</bug_when>
    <thetext>I also use the RC1 changeset:
http://git.pokylinux.org/cgit/cgit.cgi/poky-contrib/commit/?h=builds/milestone&amp;id=b9728f63c676e217efcf93c40ded2c3fad19d52c


Thanks!
criping</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>10346</commentid>
    <comment_count>5</comment_count>
    <who name="Lianhao Lu">lianhao.lu</who>
    <bug_when>2010-10-11 19:49:21 +0000</bug_when>
    <thetext>If we source the environment file from poky build tree(meta-ide-support), i.e. tmp/environment-setup-XXX, seems the problem gone.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>10389</commentid>
    <comment_count>6</comment_count>
    <who name="Scott Garman">scott.a.garman</who>
    <bug_when>2010-10-12 13:14:05 +0000</bug_when>
    <thetext>This is happening because tunctl is segfaulting. tunctl is segfaulting because it was compiled with the eglibc that is included in the native sysroot, but the runtime linker is not configured to load the libraries in the native sysroot.

If one sets LD_LIBRARY_PATH to the sysroot&apos;s lib/ directory, the problem goes away. But if LD_LIBRARY_PATH is then exported, system commands such as &apos;ls&apos; will fail. I&apos;m currently looking into possible solutions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>10399</commentid>
    <comment_count>7</comment_count>
    <who name="Kevin Tian">kevin.tian</who>
    <bug_when>2010-10-12 20:03:30 +0000</bug_when>
    <thetext>(In reply to comment #6)
&gt; This is happening because tunctl is segfaulting. tunctl is segfaulting because
&gt; it was compiled with the eglibc that is included in the native sysroot, but the
&gt; runtime linker is not configured to load the libraries in the native sysroot.
&gt; If one sets LD_LIBRARY_PATH to the sysroot&apos;s lib/ directory, the problem goes
&gt; away. But if LD_LIBRARY_PATH is then exported, system commands such as &apos;ls&apos;
&gt; will fail. I&apos;m currently looking into possible solutions.

I&apos;m a bit confusing here. Ideally all -native packages are linked to eglibc in the native sysroot. What makes tunctl special?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>10417</commentid>
    <comment_count>8</comment_count>
    <who name="Kevin Tian">kevin.tian</who>
    <bug_when>2010-10-12 22:52:39 +0000</bug_when>
    <thetext>(In reply to comment #6)
&gt; This is happening because tunctl is segfaulting. tunctl is segfaulting because
&gt; it was compiled with the eglibc that is included in the native sysroot, but the
&gt; runtime linker is not configured to load the libraries in the native sysroot.
&gt; If one sets LD_LIBRARY_PATH to the sysroot&apos;s lib/ directory, the problem goes
&gt; away. But if LD_LIBRARY_PATH is then exported, system commands such as &apos;ls&apos;
&gt; will fail. I&apos;m currently looking into possible solutions.

LD_LIBRARY_PATH has global effects on all commands executed under /opt environment. So it&apos;s not a good thing to play with. Since libc version is incompatible between /opt and build system, you always break one side.

Ideally if rpath is set correctly for nativesdk packages, they should search /opt first before the build system path. There may have some problem on how those nativesdk packages are linked.

Lianhao just did an experiment. Many /opt commands trigger same segmentation fault, such as genent, genconf, etc. But there&apos;re several success with opkg-cl, curl, ncurse, etc. However we didn&apos;t find any direct clues from recipes. It&apos;s possible that they work just because they don&apos;t trigger incompatible interfaces. Perhaps it&apos;s a general issue with how a nativesdk package is generated.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>10427</commentid>
    <comment_count>9</comment_count>
    <who name="Kevin Tian">kevin.tian</who>
    <bug_when>2010-10-13 00:19:16 +0000</bug_when>
    <thetext>Lianhao and I spent some time on this, and now we think we&apos;ve got the reason but may require help to make the patch.

First, there&apos;s an issue that some nativesdk binaries are linked to libc.so.6 without desired rpath, such as tunctl, pseudo, etc. That&apos;s a bug but generally OK. The order of library search is LD_LIBRARY_PATH-&gt;rpath-&gt;ld.so.cache-&gt;default path. binutils-crosssdk has set default path to /opt, and there&apos;s no LD_LIBRARY_PATH and ld.so.cache. So /opt/.../libc.so.6 is found which works

then due to below commit:

commit ad042da70348e9f301a25b855248e8fbce495ab8
Author: Richard Purdie &lt;rpurdie@linux.intel.com&gt;
Date:   Fri Oct 8 15:20:42 2010 +0100

    meta-toolchain: Fix libGL.so not found issues

    Fix libGL.so not found issues by making sure ld.so.cache from the host syste
    is used to locate libraries.

    Also, fix a /usr/ reference that should be /var to keep the installation
    tarball clean.

    [BUGID #228]

    Signed-off-by: Richard Purdie &lt;rpurdie@linux.intel.com&gt;

a ld.so.cache is created which links to host /etc/ld.so.cache to help search libGL.so, which all contains host library paths. This then breaks binaries which don&apos;t have rpath encoded.

There do have some /opt binaries with rpath encoded, such as ncurse, curl, etc.

The temporary workaround for SDK team is to remove /opt/.../etc/ld.so.cache since their build systems don&apos;t have libGL.so issue. The right fix is perhaps to enforce strict rpath for all nativesdk binaries, but we don&apos;t know why it&apos;s not there yet.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>10513</commentid>
    <comment_count>10</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2010-10-14 12:58:41 +0000</bug_when>
    <thetext>Should be fixed in http://git.pokylinux.org/cgit.cgi/poky/commit/?id=462aef73fad5f01afa89fe76da57032fc5abceee but need someone to test.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>10528</commentid>
    <comment_count>11</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2010-10-14 14:37:30 +0000</bug_when>
    <thetext>Checked into 431</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>10532</commentid>
    <comment_count>12</comment_count>
    <who name="Jessica">jessica.zhang</who>
    <bug_when>2010-10-14 16:11:40 +0000</bug_when>
    <thetext>Verified against latest master by trying tunctl, extract-poky-sdk</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>