<div dir="ltr">If we're going to silently change the linker to bfd under musl if ld-is-gold is selected, wouldn't it be better just to throw an exception if both musl and ld-is-gold are selected? Better to tell the user so they can not do that than silently ignore what they asked.<div><br></div><div>Ross</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 22 July 2017 at 14:30, <span dir="ltr"><<a href="mailto:liu.ming50@gmail.com" target="_blank">liu.ming50@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Ming Liu <<a href="mailto:peter.x.liu@external.atlascopco.com">peter.x.liu@external.<wbr>atlascopco.com</a>><br>
<br>
Quite a few such compiling issues were found when I was building with<br>
following configs:<br>
...<br>
MACHINE = "beaglebone"<br>
TCLIBC = "musl"<br>
DISTRO_FEATURES_append = " ld-is-gold"<br>
...<br>
<br>
fixed by adding bfd binding now ldflags.<br>
<br>
Signed-off-by: Ming Liu <<a href="mailto:peter.x.liu@external.atlascopco.com">peter.x.liu@external.<wbr>atlascopco.com</a>><br>
---<br>
meta/conf/distro/include/<wbr>tclibc-musl.inc | 4 ++++<br>
1 file changed, 4 insertions(+)<br>
<br>
diff --git a/meta/conf/distro/include/<wbr>tclibc-musl.inc b/meta/conf/distro/include/<wbr>tclibc-musl.inc<br>
index 3d3f6ac..99d52a1 100644<br>
--- a/meta/conf/distro/include/<wbr>tclibc-musl.inc<br>
+++ b/meta/conf/distro/include/<wbr>tclibc-musl.inc<br>
@@ -18,6 +18,10 @@ PREFERRED_PROVIDER_virtual/<wbr>nativesdk-libiconv ?= "nativesdk-glibc"<br>
<br>
CXXFLAGS += "-fvisibility-inlines-hidden"<br>
<br>
+# Workaround for musl libc does not support bfd lazy binding well<br>
+# 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>
+LDFLAGS += "${@bb.utils.contains('DISTRO_<wbr>FEATURES', 'ld-is-gold', '-Wl,-z,relro,-z,now -fuse-ld=bfd', '', d)}"<br>
+<br>
IMAGE_LINGUAS = ""<br>
<br>
LIBC_DEPENDENCIES = "\<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.7.4<br>
<br>
</font></span></blockquote></div><br></div>