<div dir="ltr">Hi, Khem:<div><br></div><div><pre class="gmail-bz_comment_text" id="gmail-comment_text_5" style="white-space:pre-wrap;width:50em;color:rgb(0,0,0)">Just tried, but the error still could be observed with the patch applied, for instance:

| /home/peter-liu/opensource/poky-upstream/build/tmp/work/cortexa8hf-neon-poky-linux-musleabi/m4/1.4.18-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-musleabi/../../libexec/arm-poky-linux-musleabi/gcc/arm-poky-linux-musleabi/7.1.0/ld: error: ../lib/libm4.a(progname.o): cannot make copy relocation for protected symbol &#39;program_invocation_name&#39;, defined in /home/peter-liu/opensource/poky-upstream/build/tmp/work/cortexa8hf-neon-poky-linux-musleabi/m4/1.4.18-r0/recipe-sysroot/usr/lib/libc.so
| collect2: error: ld returned 1 exit status
| Makefile:1554: recipe for target &#39;m4&#39; failed</pre><pre class="gmail-bz_comment_text" id="gmail-comment_text_5" style="white-space:pre-wrap;width:50em;color:rgb(0,0,0)">//Ming Liu</pre></div><div class="gmail_extra"><br><div class="gmail_quote">2017-07-31 23:56 GMT+02:00 Khem Raj <span dir="ltr">&lt;<a href="mailto:raj.khem@gmail.com" target="_blank">raj.khem@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, Jul 25, 2017 at 1:07 AM, Ming Liu &lt;<a href="mailto:liu.ming50@gmail.com">liu.ming50@gmail.com</a>&gt; wrote:<br>
&gt; Hi, Burton:<br>
&gt;<br>
&gt; I also agree with you, your suggestion is better.<br>
&gt;<br>
&gt; Hi, Khem:<br>
&gt;<br>
&gt; But is this a bug of binutils? Or musl libc? Since I had only observed this<br>
&gt; error with musl libc only, it did not occur with glibc.<br>
&gt;<br>
<br>
</span>Please try out a tentative patch here<br>
<a href="https://bugzilla.yoctoproject.org/show_bug.cgi?id=11679#c4" rel="noreferrer" target="_blank">https://bugzilla.yoctoproject.<wbr>org/show_bug.cgi?id=11679#c4</a><br>
<div class="HOEnZb"><div class="h5"><br>
&gt; //Ming Liu<br>
&gt;<br>
&gt; 2017-07-24 15:39 GMT+02:00 Khem Raj &lt;<a href="mailto:raj.khem@gmail.com">raj.khem@gmail.com</a>&gt;:<br>
&gt;&gt;<br>
&gt;&gt; On Mon, Jul 24, 2017 at 6:18 AM, Burton, Ross &lt;<a href="mailto:ross.burton@intel.com">ross.burton@intel.com</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt; &gt; If we&#39;re going to silently change the linker to bfd under musl if<br>
&gt;&gt; &gt; ld-is-gold<br>
&gt;&gt; &gt; is selected, wouldn&#39;t it be better just to throw an exception if both<br>
&gt;&gt; &gt; musl<br>
&gt;&gt; &gt; and ld-is-gold are selected?  Better to tell the user so they can not do<br>
&gt;&gt; &gt; that than silently ignore what they asked.<br>
&gt;&gt;<br>
&gt;&gt; yes, that would be better but I am skeptical of disabling it<br>
&gt;&gt; completely, we should<br>
&gt;&gt; create testcase and report it to binutils bugzilla<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Ross<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; On 22 July 2017 at 14:30, &lt;<a href="mailto:liu.ming50@gmail.com">liu.ming50@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; From: Ming Liu &lt;<a href="mailto:peter.x.liu@external.atlascopco.com">peter.x.liu@external.<wbr>atlascopco.com</a>&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Quite a few such compiling issues were found when I was building with<br>
&gt;&gt; &gt;&gt; following configs:<br>
&gt;&gt; &gt;&gt; ...<br>
&gt;&gt; &gt;&gt; MACHINE = &quot;beaglebone&quot;<br>
&gt;&gt; &gt;&gt; TCLIBC = &quot;musl&quot;<br>
&gt;&gt; &gt;&gt; DISTRO_FEATURES_append = &quot; ld-is-gold&quot;<br>
&gt;&gt; &gt;&gt; ...<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; fixed by adding bfd binding now ldflags.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Signed-off-by: Ming Liu &lt;<a href="mailto:peter.x.liu@external.atlascopco.com">peter.x.liu@external.<wbr>atlascopco.com</a>&gt;<br>
&gt;&gt; &gt;&gt; ---<br>
&gt;&gt; &gt;&gt;  meta/conf/distro/include/<wbr>tclibc-musl.inc | 4 ++++<br>
&gt;&gt; &gt;&gt;  1 file changed, 4 insertions(+)<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; diff --git a/meta/conf/distro/include/<wbr>tclibc-musl.inc<br>
&gt;&gt; &gt;&gt; b/meta/conf/distro/include/<wbr>tclibc-musl.inc<br>
&gt;&gt; &gt;&gt; index 3d3f6ac..99d52a1 100644<br>
&gt;&gt; &gt;&gt; --- a/meta/conf/distro/include/<wbr>tclibc-musl.inc<br>
&gt;&gt; &gt;&gt; +++ b/meta/conf/distro/include/<wbr>tclibc-musl.inc<br>
&gt;&gt; &gt;&gt; @@ -18,6 +18,10 @@ PREFERRED_PROVIDER_virtual/<wbr>nativesdk-libiconv ?=<br>
&gt;&gt; &gt;&gt; &quot;nativesdk-glibc&quot;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;  CXXFLAGS += &quot;-fvisibility-inlines-hidden&quot;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; +# Workaround for musl libc does not support bfd lazy binding well<br>
&gt;&gt; &gt;&gt; +# Refer to: <a href="https://bugzilla.yoctoproject.org/show_bug.cgi?id=11679" rel="noreferrer" target="_blank">https://bugzilla.yoctoproject.<wbr>org/show_bug.cgi?id=11679</a><br>
&gt;&gt; &gt;&gt; +LDFLAGS += &quot;${@bb.utils.contains(&#39;DISTRO_<wbr>FEATURES&#39;, &#39;ld-is-gold&#39;,<br>
&gt;&gt; &gt;&gt; &#39;-Wl,-z,relro,-z,now -fuse-ld=bfd&#39;, &#39;&#39;, d)}&quot;<br>
&gt;&gt; &gt;&gt; +<br>
&gt;&gt; &gt;&gt;  IMAGE_LINGUAS = &quot;&quot;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;  LIBC_DEPENDENCIES = &quot;\<br>
&gt;&gt; &gt;&gt; --<br>
&gt;&gt; &gt;&gt; 2.7.4<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; --<br>
&gt;&gt; &gt; ______________________________<wbr>_________________<br>
&gt;&gt; &gt; Openembedded-core mailing list<br>
&gt;&gt; &gt; <a href="mailto:Openembedded-core@lists.openembedded.org">Openembedded-core@lists.<wbr>openembedded.org</a><br>
&gt;&gt; &gt; <a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/<wbr>mailman/listinfo/openembedded-<wbr>core</a><br>
&gt;&gt; &gt;<br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br></div></div>