<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 <<a href="mailto:richard.purdie@linuxfoundation.org">richard.purdie@linuxfoundation.org</a>> 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>
> Some baremetal applications might require support from libstdc++.<br>
> <br>
> On newlib based toolchains, libstdc++ can be built as a static<br>
> library that applications can then link against it.<br>
> <br>
> Pass libsdtc++-(static)dev to LIBC_DEPENDENCIES allowing the<br>
> library to be present for cross compilation as well as on<br>
> sdk builds.<br>
> <br>
> This also requires to modify the gcc-runtime recipe to<br>
> explictly build only libsdtc++ correctly.<br>
> <br>
> Signed-off-by: Alejandro Enedino Hernandez Samaniego <<br>
> <a href="mailto:alejandro@enedino.org" target="_blank">alejandro@enedino.org</a>><br>
> ---<br>
> meta/conf/distro/include/tclibc-newlib.inc | 7 +++----<br>
> meta/recipes-devtools/gcc/gcc-runtime.inc | 6 ++++++<br>
> 2 files changed, 9 insertions(+), 4 deletions(-)<br>
> <br>
> diff --git a/meta/conf/distro/include/tclibc-newlib.inc<br>
> b/meta/conf/distro/include/tclibc-newlib.inc<br>
> index 896c0b1..8338003 100644<br>
> --- a/meta/conf/distro/include/tclibc-newlib.inc<br>
> +++ b/meta/conf/distro/include/tclibc-newlib.inc<br>
> @@ -25,12 +25,11 @@ LIBC_DEPENDENCIES = "\<br>
> libgloss-dbg \<br>
> libgcc-dev \<br>
> libgcc-dbg \<br>
> + libstdc++-dev \<br>
> + libstdc++-staticdev \<br>
> "<br>
> <br>
> -# compilerlibs defaults to gcc-runtime, but we get runtime from<br>
> libgloss<br>
> -# we set ASSUME_PROVIDED because we cant set PREFERRED_PROVIDER<br>
> -# for compilerlibs since its overridden by tcmode-default<br>
> -ASSUME_PROVIDED += "virtual/${TARGET_PREFIX}compilerlibs<br>
> virtual/crypt"<br>
> +ASSUME_PROVIDED += "virtual/crypt"<br>
> <br>
> # Its useful to be able to extend newlib, but we dont provide a<br>
> native variant of libgloss<br>
> NEWLIB_EXTENDED ?= "libgloss libgcc"<br>
> diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc<br>
> b/meta/recipes-devtools/gcc/gcc-runtime.inc<br>
> index d3f8ae8..f035fbd 100644<br>
> --- a/meta/recipes-devtools/gcc/gcc-runtime.inc<br>
> +++ b/meta/recipes-devtools/gcc/gcc-runtime.inc<br>
> @@ -17,6 +17,9 @@ EXTRA_OECONF_PATHS = "\<br>
> EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu"<br>
> EXTRA_OECONF_append = " --cache-file=${B}/config.cache"<br>
> <br>
> +EXTRA_OECONF_remove_libc-newlib = "--enable-symvers=gnu"<br>
> +EXTRA_OECONF_append_libc-newlib = " --with-newlib"<br>
> +<br>
<br>
I really don't like using remove in core. Can we restructure this so<br>
that symvers is set something like:<br>
<br>
SYMVERS_CONF = " --enable-clocale=gnu"<br>
SYMVERS_CONF_libc-newlib = ""<br>
EXTRA_OECONF_append += "${SYMVERS_CONF}"<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>
> # Disable ifuncs for libatomic on arm conflicts -march/-mcpu<br>
> EXTRA_OECONF_append_arm = " libat_cv_have_ifunc=no "<br>
> <br>
> @@ -33,6 +36,9 @@ RUNTIMELIBITM_riscv64 = ""<br>
> RUNTIMELIBSSP ?= ""<br>
> RUNTIMELIBSSP_mingw32 ?= "libssp"<br>
> <br>
> +# Only build libstdc++ for newlib<br>
> +RUNTIMETARGET_libc-newlib = "libstdc++-v3"<br>
> +<br>
> RUNTIMETARGET = "${RUNTIMELIBSSP} libstdc++-v3 libgomp libatomic<br>
> ${RUNTIMELIBITM} \<br>
> ${@bb.utils.contains_any('FORTRAN', [',fortran',',f77'],<br>
> 'libquadmath', '', d)} \<br>
> "<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>