<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:monospace;font-size:large"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 18 Jan 2020 at 15:25, Richard Purdie &lt;<a href="mailto:richard.purdie@linuxfoundation.org">richard.purdie@linuxfoundation.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Sat, 2020-01-18 at 13:22 -0800, Alejandro Enedino Hernandez<br>
Samaniego wrote:<br>
&gt; Some baremetal applications might require support from libstdc++.<br>
&gt; <br>
&gt; On newlib based toolchains, libstdc++ can be built as a static<br>
&gt; library that applications can then link against it.<br>
&gt; <br>
&gt; Pass libsdtc++-(static)dev to LIBC_DEPENDENCIES allowing the<br>
&gt; library to be present for cross compilation as well as on<br>
&gt; sdk builds.<br>
&gt; <br>
&gt; This also requires to modify the gcc-runtime recipe to<br>
&gt; explictly build only libsdtc++ correctly.<br>
&gt; <br>
&gt; Signed-off-by: Alejandro Enedino Hernandez Samaniego &lt;<br>
&gt; <a href="mailto:alejandro@enedino.org" target="_blank">alejandro@enedino.org</a>&gt;<br>
&gt; ---<br>
&gt;  meta/conf/distro/include/tclibc-newlib.inc | 7 +++----<br>
&gt;  meta/recipes-devtools/gcc/gcc-runtime.inc  | 6 ++++++<br>
&gt;  2 files changed, 9 insertions(+), 4 deletions(-)<br>
&gt; <br>
&gt; diff --git a/meta/conf/distro/include/tclibc-newlib.inc<br>
&gt; b/meta/conf/distro/include/tclibc-newlib.inc<br>
&gt; index 896c0b1..8338003 100644<br>
&gt; --- a/meta/conf/distro/include/tclibc-newlib.inc<br>
&gt; +++ b/meta/conf/distro/include/tclibc-newlib.inc<br>
&gt; @@ -25,12 +25,11 @@ LIBC_DEPENDENCIES = &quot;\<br>
&gt;      libgloss-dbg \<br>
&gt;      libgcc-dev \<br>
&gt;      libgcc-dbg \<br>
&gt; +    libstdc++-dev \<br>
&gt; +    libstdc++-staticdev \<br>
&gt;      &quot;<br>
&gt;  <br>
&gt; -# compilerlibs defaults to gcc-runtime, but we get runtime from<br>
&gt; libgloss<br>
&gt; -# we set ASSUME_PROVIDED because we cant set PREFERRED_PROVIDER<br>
&gt; -# for compilerlibs since its overridden by tcmode-default<br>
&gt; -ASSUME_PROVIDED += &quot;virtual/${TARGET_PREFIX}compilerlibs<br>
&gt; virtual/crypt&quot;<br>
&gt; +ASSUME_PROVIDED += &quot;virtual/crypt&quot;<br>
&gt;  <br>
&gt;  # Its useful to be able to extend newlib, but we dont provide a<br>
&gt; native variant of libgloss<br>
&gt;  NEWLIB_EXTENDED ?=  &quot;libgloss libgcc&quot;<br>
&gt; diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc<br>
&gt; b/meta/recipes-devtools/gcc/gcc-runtime.inc<br>
&gt; index d3f8ae8..f035fbd 100644<br>
&gt; --- a/meta/recipes-devtools/gcc/gcc-runtime.inc<br>
&gt; +++ b/meta/recipes-devtools/gcc/gcc-runtime.inc<br>
&gt; @@ -17,6 +17,9 @@ EXTRA_OECONF_PATHS = &quot;\<br>
&gt;  EXTRA_OECONF_append_linuxstdbase = &quot; --enable-clocale=gnu&quot;<br>
&gt;  EXTRA_OECONF_append = &quot; --cache-file=${B}/config.cache&quot;<br>
&gt;  <br>
&gt; +EXTRA_OECONF_remove_libc-newlib = &quot;--enable-symvers=gnu&quot;<br>
&gt; +EXTRA_OECONF_append_libc-newlib = &quot; --with-newlib&quot;<br>
&gt; +<br>
<br>
I really don&#39;t like using remove in core. Can we restructure this so<br>
that symvers is set something like:<br>
<br>
SYMVERS_CONF = &quot; --enable-clocale=gnu&quot;<br>
SYMVERS_CONF_libc-newlib = &quot;&quot;<br>
EXTRA_OECONF_append += &quot;${SYMVERS_CONF}&quot;<br>
<br>
?<br></blockquote><div><br></div><div><div class="gmail_default" style="font-family:monospace;font-size:large">Hey Richard,</div><br></div><div class="gmail_default" style="font-family:monospace;font-size:large">Absolutely agree, I will send a v2 with these changes.</div><div class="gmail_default" style="font-family:monospace;font-size:large"><br></div><div class="gmail_default" style="font-family:monospace;font-size:large">Alejandro</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
&gt;  # Disable ifuncs for libatomic on arm conflicts -march/-mcpu<br>
&gt;  EXTRA_OECONF_append_arm = &quot; libat_cv_have_ifunc=no &quot;<br>
&gt;  <br>
&gt; @@ -33,6 +36,9 @@ RUNTIMELIBITM_riscv64 = &quot;&quot;<br>
&gt;  RUNTIMELIBSSP ?= &quot;&quot;<br>
&gt;  RUNTIMELIBSSP_mingw32 ?= &quot;libssp&quot;<br>
&gt;  <br>
&gt; +# Only build libstdc++ for newlib<br>
&gt; +RUNTIMETARGET_libc-newlib = &quot;libstdc++-v3&quot;<br>
&gt; +<br>
&gt;  RUNTIMETARGET = &quot;${RUNTIMELIBSSP} libstdc++-v3 libgomp libatomic<br>
&gt; ${RUNTIMELIBITM} \<br>
&gt;      ${@bb.utils.contains_any(&#39;FORTRAN&#39;, [&#39;,fortran&#39;,&#39;,f77&#39;],<br>
&gt; &#39;libquadmath&#39;, &#39;&#39;, d)} \<br>
&gt;  &quot;<br>
<br>
Convention is top put the overridden version under the original.<br></blockquote><div> </div><div><div class="gmail_default" style="font-family:monospace;font-size:large">Will change this as well</div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Cheers,<br>
<br>
Richard<br>
<br>
</blockquote></div></div>