<div dir="ltr">What was the intent of the last hunk in fix_cross_compile.patch?  It essentially undoes the following upstream mklibs change, but it doesn&#39;t seem related to whether or not dpkg is used.<div><br></div><div><a href="http://bazaar.launchpad.net/~ubuntu-installer/mklibs/master/revision/101">http://bazaar.launchpad.net/~ubuntu-installer/mklibs/master/revision/101</a><br></div><div><a href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=256998">https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=256998</a><br></div><div><br></div><div>It also causes breakage in image-mklibs.bbclass in a multilib setup where there are symlinks to the dynamic loader in both /lib and /lib64 (find returns more than one result when trying to cp out of mklibs/dest).</div><div><br></div><div>Should that hunk be reverted?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 3, 2015 at 1:42 AM,  <span dir="ltr">&lt;<a href="mailto:rongqing.li@windriver.com" target="_blank">rongqing.li@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">From: Yuanjie Huang &lt;<a href="mailto:yuanjie.huang@windriver.com">yuanjie.huang@windriver.com</a>&gt;<br>
<br>
1. Show GNU unique symbols as provided symbols<br>
2. Remove dependency on dpkg<br>
Both have been submitted to mklibs maillist:<br>
<a href="https://lists.debian.org/debian-boot/2015/07/msg00018.html" rel="noreferrer" target="_blank">https://lists.debian.org/debian-boot/2015/07/msg00018.html</a><br>
<a href="https://lists.debian.org/debian-boot/2015/07/msg00004.html" rel="noreferrer" target="_blank">https://lists.debian.org/debian-boot/2015/07/msg00004.html</a><br>
<br>
Signed-off-by: Yuanjie Huang &lt;<a href="mailto:yuanjie.huang@windriver.com">yuanjie.huang@windriver.com</a>&gt;<br>
Signed-off-by: Roy Li &lt;<a href="mailto:rongqing.li@windriver.com">rongqing.li@windriver.com</a>&gt;<br>
---<br>
 .../mklibs/files/fix_cross_compile.patch           | 81 ++++++++++++++++++++++<br>
 ...ow-GNU-unique-symbols-as-provided-symbols.patch | 34 +++++++++<br>
 .../mklibs/<a href="http://mklibs-native_0.1.40.bb" rel="noreferrer" target="_blank">mklibs-native_0.1.40.bb</a>                 |  2 +<br>
 3 files changed, 117 insertions(+)<br>
 create mode 100644 meta/recipes-devtools/mklibs/files/fix_cross_compile.patch<br>
 create mode 100644 meta/recipes-devtools/mklibs/files/show-GNU-unique-symbols-as-provided-symbols.patch<br>
<br>
diff --git a/meta/recipes-devtools/mklibs/files/fix_cross_compile.patch b/meta/recipes-devtools/mklibs/files/fix_cross_compile.patch<br>
new file mode 100644<br>
index 0000000..7eb8659<br>
--- /dev/null<br>
+++ b/meta/recipes-devtools/mklibs/files/fix_cross_compile.patch<br>
@@ -0,0 +1,81 @@<br>
+Remove dependency on dpkg<br>
+<br>
+Upstream-Status Submitted<br>
+<br>
+Asking the host OS whether it supports multiarch is not useful<br>
+in a cross-compilation environment, or if the user has specified<br>
+a libdir explicitly. So this patch, based on the work of Mentor<br>
+Graphics, removes mklibs&#39;s dependency on dpkg package.<br>
+<br>
+Signed-off-by: Yuanjie Huang &lt;<a href="mailto:Yuanjie.Huang@windriver.com">Yuanjie.Huang@windriver.com</a>&gt;<br>
+ src/mklibs | 30 +++++++++++++++++++-----------<br>
+ 1 file changed, 19 insertions(+), 11 deletions(-)<br>
+<br>
+diff --git a/src/mklibs b/src/mklibs<br>
+index d9b784b..c5614ea 100755<br>
+--- a/src/mklibs<br>
++++ b/src/mklibs<br>
+@@ -261,6 +261,11 @@ def extract_soname(so_file):<br>
+     return &quot;&quot;<br>
+<br>
+ def multiarch(paths):<br>
++    # Asking the host OS whether it supports multiarch is not useful<br>
++    # in a cross-compilation environment, or if the user has specified<br>
++    # a libdir explicitly.<br>
++    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>
+@@ -340,7 +345,7 @@ lib_path = []<br>
+ dest_path = &quot;DEST&quot;<br>
+ ldlib = &quot;LDLIB&quot;<br>
+ include_default_lib_path = &quot;yes&quot;<br>
+-default_lib_path = multiarch([&quot;/lib/&quot;, &quot;/usr/lib/&quot;, &quot;/usr/X11R6/lib/&quot;])<br>
++default_lib_path = [&quot;/lib/&quot;, &quot;/usr/lib/&quot;, &quot;/usr/X11R6/lib/&quot;]<br>
+ libc_extras_dir = &quot;/usr/lib/libc_pic&quot;<br>
+ libc_extras_dir_default = True<br>
+ libdir = &quot;lib&quot;<br>
+@@ -386,7 +391,7 @@ for opt, arg in optlist:<br>
+     elif opt == &quot;--libdir&quot;:<br>
+         libdir = arg<br>
+     elif opt in (&quot;--help&quot;, &quot;-h&quot;):<br>
+-      usage(0)<br>
++        usage(0)<br>
+         sys.exit(0)<br>
+     elif opt in (&quot;--version&quot;, &quot;-V&quot;):<br>
+         version(vers)<br>
+@@ -395,6 +400,7 @@ for opt, arg in optlist:<br>
+         print &quot;WARNING: unknown option: &quot; + opt + &quot;\targ: &quot; + arg<br>
+<br>
+ if include_default_lib_path == &quot;yes&quot;:<br>
++    default_lib_path = multiarch(default_lib_path)<br>
+     lib_path.extend([a.replace(&quot;/lib/&quot;, &quot;/&quot; + libdir + &quot;/&quot;) for a in default_lib_path])<br>
+<br>
+ if libc_extras_dir_default:<br>
+@@ -661,16 +669,16 @@ ld_path_name = os.path.dirname(ldlib)<br>
+ ld_full_path = &quot;../&quot; + ldlib<br>
+ ld_file = find_lib(ld_file_name)<br>
+<br>
+-if ld_path_name != &quot;/lib&quot;:<br>
+-    if os.access(dest_path + &quot;/&quot; + ld_file_name, os.F_OK):<br>
+-        os.remove(dest_path + &quot;/&quot; + ld_file_name)<br>
++#if ld_path_name != &quot;/lib&quot;:<br>
++#    if os.access(dest_path + &quot;/&quot; + ld_file_name, os.F_OK):<br>
++#        os.remove(dest_path + &quot;/&quot; + ld_file_name)<br>
+<br>
+-if not os.path.exists(dest_path + &quot;/../&quot; + ld_path_name):<br>
+-    os.mkdir(dest_path + &quot;/../&quot; + ld_path_name)<br>
++#if not os.path.exists(dest_path + &quot;/../&quot; + ld_path_name):<br>
++#    os.mkdir(dest_path + &quot;/../&quot; + ld_path_name)<br>
+<br>
+-if not os.access(dest_path + &quot;/&quot; + ld_full_path, os.F_OK):<br>
+-    debug(DEBUG_NORMAL, &quot;I: stripping and copying dynamic linker to &quot; + ld_full_path)<br>
++if not os.access(dest_path + &quot;/&quot; + ld_file_name, os.F_OK):<br>
++    debug(DEBUG_NORMAL, &quot;I: stripping and copying dynamic linker to &quot; + ld_file_name)<br>
+     command(target + &quot;objcopy&quot;, &quot;--strip-unneeded -R .note -R .comment&quot;,<br>
+-            ld_file, dest_path + &quot;/&quot; + ld_full_path)<br>
++            ld_file, dest_path + &quot;/&quot; + ld_file_name)<br>
+<br>
+-os.chmod(dest_path + &quot;/&quot; + ld_full_path, 0755)<br>
++os.chmod(dest_path + &quot;/&quot; + ld_file_name, 0755)<br>
diff --git a/meta/recipes-devtools/mklibs/files/show-GNU-unique-symbols-as-provided-symbols.patch b/meta/recipes-devtools/mklibs/files/show-GNU-unique-symbols-as-provided-symbols.patch<br>
new file mode 100644<br>
index 0000000..3f14ca1<br>
--- /dev/null<br>
+++ b/meta/recipes-devtools/mklibs/files/show-GNU-unique-symbols-as-provided-symbols.patch<br>
@@ -0,0 +1,34 @@<br>
+From eddf04c7f8312e9c29cdb24e431b7e4fb2cc70ed Mon Sep 17 00:00:00 2001<br>
+From: Yuanjie Huang &lt;<a href="mailto:yuanjie.huang@windriver.com">yuanjie.huang@windriver.com</a>&gt;<br>
+Date: Wed, 15 Apr 2015 14:00:06 +0800<br>
+Subject: [PATCH] Show GNU unique symbols as provided symbols<br>
+<br>
+Upstream-Status Submitted<br>
+<br>
+GNU Unique symbol is a GNU extension employed by new version of GCC<br>
+by default. Even Standard C++ library in GCC 4.9 provides some symbols,<br>
+such as _ZNSs4_Rep20_S_empty_rep_storageE in this binding type instead<br>
+of ELF standard weak binding.<br>
+This patch adds support of this new binding type to mklibs-readelf.<br>
+<br>
+Signed-off-by: Yuanjie Huang &lt;<a href="mailto:yuanjie.huang@windriver.com">yuanjie.huang@windriver.com</a>&gt;<br>
+---<br>
+ src/mklibs-readelf/main.cpp | 2 +-<br>
+ 1 file changed, 1 insertion(+), 1 deletion(-)<br>
+<br>
+diff --git a/src/mklibs-readelf/main.cpp b/src/mklibs-readelf/main.cpp<br>
+index 56d93f8..0134530 100644<br>
+--- a/src/mklibs-readelf/main.cpp<br>
++++ b/src/mklibs-readelf/main.cpp<br>
+@@ -88,7 +88,7 @@ static void process_symbols_provided (const Elf::section_type&lt;Elf::section_type_<br>
+     uint8_t type = symbol-&gt;get_type ();<br>
+     const std::string &amp;name = symbol-&gt;get_name_string ();<br>
+<br>
+-    if (bind != STB_GLOBAL &amp;&amp; bind != STB_WEAK)<br>
++    if (bind != STB_GLOBAL &amp;&amp; bind != STB_WEAK &amp;&amp; bind != STB_GNU_UNIQUE)<br>
+       continue;<br>
+     if (shndx == SHN_UNDEF || shndx == SHN_ABS)<br>
+       continue;<br>
+--<br>
+1.8.5.2.233.g932f7e4<br>
+<br>
diff --git a/meta/recipes-devtools/mklibs/<a href="http://mklibs-native_0.1.40.bb" rel="noreferrer" target="_blank">mklibs-native_0.1.40.bb</a> b/meta/recipes-devtools/mklibs/<a href="http://mklibs-native_0.1.40.bb" rel="noreferrer" target="_blank">mklibs-native_0.1.40.bb</a><br>
index 0bb5f21..d6905ac 100644<br>
--- a/meta/recipes-devtools/mklibs/<a href="http://mklibs-native_0.1.40.bb" rel="noreferrer" target="_blank">mklibs-native_0.1.40.bb</a><br>
+++ b/meta/recipes-devtools/mklibs/<a href="http://mklibs-native_0.1.40.bb" rel="noreferrer" target="_blank">mklibs-native_0.1.40.bb</a><br>
@@ -11,6 +11,8 @@ SRC_URI = &quot;<a href="http://ftp.de.debian.org/debian/pool/main/m/mklibs/${BPN}_${PV}.tar.x" rel="noreferrer" target="_blank">http://ftp.de.debian.org/debian/pool/main/m/mklibs/${BPN}_${PV}.tar.x</a><br>
        file://fix_STT_GNU_IFUNC.patch\<br>
        file://sysrooted-ldso.patch \<br>
        file://avoid-failure-on-symbol-provided-by-application.patch \<br>
+       file://show-GNU-unique-symbols-as-provided-symbols.patch \<br>
+       file://fix_cross_compile.patch \<br>
 &quot;<br>
<br>
 SRC_URI[md5sum] = &quot;e1dafe5f962caa9dc5f2651c0723812a&quot;<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.9.1<br>
<br>
--<br>
_______________________________________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org">Openembedded-core@lists.openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/mailman/listinfo/openembedded-core</a><br>
</font></span></blockquote></div><br></div>