<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'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 = "../" + 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 != "/lib":</span><br style="font-size:12.8px"><span style="font-size:12.8px">+- if os.access(dest_path + "/" + ld_file_name, os.F_OK):</span><br style="font-size:12.8px"><span style="font-size:12.8px">+- os.remove(dest_path + "/" + ld_file_name)</span><br style="font-size:12.8px"><span style="font-size:12.8px">++#if ld_path_name != "/lib":</span><br style="font-size:12.8px"><span style="font-size:12.8px">++# if os.access(dest_path + "/" + ld_file_name, os.F_OK):</span><br style="font-size:12.8px"><span style="font-size:12.8px">++# os.remove(dest_path + "/" + 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 + "/../" + ld_path_name):</span><br style="font-size:12.8px"><span style="font-size:12.8px">+- os.mkdir(dest_path + "/../" + ld_path_name)</span><br style="font-size:12.8px"><span style="font-size:12.8px">++#if not os.path.exists(dest_path + "/../" + ld_path_name):</span><br style="font-size:12.8px"><span style="font-size:12.8px">++# os.mkdir(dest_path + "/../" + 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 + "/" + ld_full_path, os.F_OK):</span><br style="font-size:12.8px"><span style="font-size:12.8px">+- debug(DEBUG_NORMAL, "I: stripping and copying dynamic linker to " + ld_full_path)</span><br style="font-size:12.8px"><span style="font-size:12.8px">++if not os.access(dest_path + "/" + ld_file_name, os.F_OK):</span><br style="font-size:12.8px"><span style="font-size:12.8px">++ debug(DEBUG_NORMAL, "I: stripping and copying dynamic linker to " + ld_file_name)</span><br style="font-size:12.8px"><span style="font-size:12.8px">+ command(target + "objcopy", "--strip-unneeded -R .note -R .comment",</span><br style="font-size:12.8px"><span style="font-size:12.8px">+- ld_file, dest_path + "/" + ld_full_path)</span><br style="font-size:12.8px"><span style="font-size:12.8px">++ ld_file, dest_path + "/" + 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 + "/" + ld_full_path, 0755)</span><br style="font-size:12.8px"><span style="font-size:12.8px">++os.chmod(dest_path + "/" + 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("E: Dynamic linker not found, aborting.")
+ldlib = sysroot + ldlib
+
debug(DEBUG_NORMAL, "I: Using", ldlib, "as dynamic linker.")
# 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"><<a href="mailto:yuanjie.huang@windriver.com" target="_blank">yuanjie.huang@windriver.com</a>></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 != "" or libdir != "":<br>
++ return paths<br>
+ devnull = open('/dev/null', 'w')<br>
+ dpkg_architecture = subprocess.Popen(<br>
+ ['dpkg-architecture', '-qDEB_HOST_MULTIARCH'],<br>
</blockquote>
<br>
</div></div></blockquote></div><br></div>