<div dir="ltr">Thanks, Yuanjie.  I see how your patch changes multiarch() to return quickly and thus avoid dpkg if the user provides a sysroot or libdir, but it also comments out some checking to verify that the dynamic linker is in the correct location and executable.  (I&#39;m referring to the following hunk from your patch.)  It looks like your changes disable this verification by commenting some of it out.<div><br></div><div><span style="font-size:12.8px">+@@ -661,16 +669,16 @@ ld_path_name = os.path.dirname(ldlib)</span><br style="font-size:12.8px"><span style="font-size:12.8px">+ ld_full_path = &quot;../&quot; + ldlib</span><br style="font-size:12.8px"><span style="font-size:12.8px">+ ld_file = find_lib(ld_file_name)</span><br style="font-size:12.8px"><span style="font-size:12.8px">+</span><br style="font-size:12.8px"><span style="font-size:12.8px">+-if ld_path_name != &quot;/lib&quot;:</span><br style="font-size:12.8px"><span style="font-size:12.8px">+-    if os.access(dest_path + &quot;/&quot; + ld_file_name, os.F_OK):</span><br style="font-size:12.8px"><span style="font-size:12.8px">+-        os.remove(dest_path + &quot;/&quot; + ld_file_name)</span><br style="font-size:12.8px"><span style="font-size:12.8px">++#if ld_path_name != &quot;/lib&quot;:</span><br style="font-size:12.8px"><span style="font-size:12.8px">++#    if os.access(dest_path + &quot;/&quot; + ld_file_name, os.F_OK):</span><br style="font-size:12.8px"><span style="font-size:12.8px">++#        os.remove(dest_path + &quot;/&quot; + ld_file_name)</span><br style="font-size:12.8px"><span style="font-size:12.8px">+</span><br style="font-size:12.8px"><span style="font-size:12.8px">+-if not os.path.exists(dest_path + &quot;/../&quot; + ld_path_name):</span><br style="font-size:12.8px"><span style="font-size:12.8px">+-    os.mkdir(dest_path + &quot;/../&quot; + ld_path_name)</span><br style="font-size:12.8px"><span style="font-size:12.8px">++#if not os.path.exists(dest_path + &quot;/../&quot; + ld_path_name):</span><br style="font-size:12.8px"><span style="font-size:12.8px">++#    os.mkdir(dest_path + &quot;/../&quot; + ld_path_name)</span><br style="font-size:12.8px"><span style="font-size:12.8px">+</span><br style="font-size:12.8px"><span style="font-size:12.8px">+-if not os.access(dest_path + &quot;/&quot; + ld_full_path, os.F_OK):</span><br style="font-size:12.8px"><span style="font-size:12.8px">+-    debug(DEBUG_NORMAL, &quot;I: stripping and copying dynamic linker to &quot; + ld_full_path)</span><br style="font-size:12.8px"><span style="font-size:12.8px">++if not os.access(dest_path + &quot;/&quot; + ld_file_name, os.F_OK):</span><br style="font-size:12.8px"><span style="font-size:12.8px">++    debug(DEBUG_NORMAL, &quot;I: stripping and copying dynamic linker to &quot; + ld_file_name)</span><br style="font-size:12.8px"><span style="font-size:12.8px">+     command(target + &quot;objcopy&quot;, &quot;--strip-unneeded -R .note -R .comment&quot;,</span><br style="font-size:12.8px"><span style="font-size:12.8px">+-            ld_file, dest_path + &quot;/&quot; + ld_full_path)</span><br style="font-size:12.8px"><span style="font-size:12.8px">++            ld_file, dest_path + &quot;/&quot; + ld_file_name)</span><br style="font-size:12.8px"><span style="font-size:12.8px">+</span><br style="font-size:12.8px"><span style="font-size:12.8px">+-os.chmod(dest_path + &quot;/&quot; + ld_full_path, 0755)</span><br style="font-size:12.8px"><span style="font-size:12.8px">++os.chmod(dest_path + &quot;/&quot; + ld_file_name, 0755)</span><br></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Looking at the change you submitted upstream (<a href="https://lists.debian.org/debian-boot/2015/07/msg00018.html">https://lists.debian.org/debian-boot/2015/07/msg00018.html</a>), it looks like there was an additional hunk that got missed in the poky commit.  Is the above hunk dependent on the missing one below?</span></div><div><pre style="color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif">@@ -441,6 +447,8 @@ if not ldlib:
 if not ldlib:
     sys.exit(&quot;E: Dynamic linker not found, aborting.&quot;)
 
+ldlib = sysroot + ldlib
+
 debug(DEBUG_NORMAL, &quot;I: Using&quot;, ldlib, &quot;as dynamic linker.&quot;)
 
 # Check for rpaths</font></pre>Reverting the last hunk in your poky commit fixes the mklibs error we encounter in our multilib setup containing /lib and /lib64 symlinks to the linker.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, May 15, 2016 at 11:02 PM, Yuanjie Huang <span dir="ltr">&lt;<a href="mailto:yuanjie.huang@windriver.com" target="_blank">yuanjie.huang@windriver.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Kyle,<br>
<br>
The fix_cross_compile.patch is related when we pass the sysroot or libdir to mklibs, in such case it is wrong to call dpkg-architecture as info on build machine instead of target will be returned.<br>
<br>
Thanks,<br>
Yuanjie<div class="HOEnZb"><div class="h5"><br>
<br>
On 05/12/2016 04:00 AM, Kyle Russell wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
++    if sysroot != &quot;&quot; or libdir != &quot;&quot;:<br>
++        return paths<br>
+     devnull = open(&#39;/dev/null&#39;, &#39;w&#39;)<br>
+     dpkg_architecture = subprocess.Popen(<br>
+         [&#39;dpkg-architecture&#39;, &#39;-qDEB_HOST_MULTIARCH&#39;],<br>
</blockquote>
<br>
</div></div></blockquote></div><br></div>