]> code.ossystems Code Review - openembedded-core.git/commitdiff
newlib: Enable building libstdc++ for newlib based toolchains
authorAlejandro Enedino Hernandez Samaniego <alejandro@enedino.org>
Sun, 19 Jan 2020 03:01:59 +0000 (19:01 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 19 Jan 2020 23:49:15 +0000 (23:49 +0000)
Some baremetal applications might require support from libstdc++
On newlib based toolchains, libstdc++ can be built as a static
library that applications can then link against it.

Pass libsdtc++-(static)dev to LIBC_DEPENDENCIES allowing the
library to be present for cross compilation as well as on
sdk builds.

Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandro@enedino.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/conf/distro/include/tclibc-newlib.inc
meta/recipes-devtools/gcc/gcc-runtime.inc

index 896c0b16d78aab9bfa3b6378b6ecce3db2ad2e74..8338003e31bbcbd7f9c522fd98df22a16202d544 100644 (file)
@@ -25,12 +25,11 @@ LIBC_DEPENDENCIES = "\
     libgloss-dbg \
     libgcc-dev \
     libgcc-dbg \
+    libstdc++-dev \
+    libstdc++-staticdev \
     "
 
-# compilerlibs defaults to gcc-runtime, but we get runtime from libgloss
-# we set ASSUME_PROVIDED because we cant set PREFERRED_PROVIDER
-# for compilerlibs since its overridden by tcmode-default
-ASSUME_PROVIDED += "virtual/${TARGET_PREFIX}compilerlibs virtual/crypt"
+ASSUME_PROVIDED += "virtual/crypt"
 
 # Its useful to be able to extend newlib, but we dont provide a native variant of libgloss
 NEWLIB_EXTENDED ?=  "libgloss libgcc"
index d3f8ae8b9bb85d1d24a47d3415c917e65ef05131..b2c5d43bd49e4f76bd531b871bc7f8dd4341743b 100644 (file)
@@ -16,10 +16,14 @@ EXTRA_OECONF_PATHS = "\
 
 EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu"
 EXTRA_OECONF_append = " --cache-file=${B}/config.cache"
+EXTRA_OECONF_append_libc-newlib = " --with-newlib"
 
 # Disable ifuncs for libatomic on arm conflicts -march/-mcpu
 EXTRA_OECONF_append_arm = " libat_cv_have_ifunc=no "
 
+# Newlib does not support symbol versioning on libsdtcc++
+SYMVERS_CONF_libc-newlib = ""
+
 # Building with thumb enabled on armv6t fails
 ARM_INSTRUCTION_SET_armv6 = "arm"
 
@@ -36,6 +40,8 @@ RUNTIMELIBSSP_mingw32 ?= "libssp"
 RUNTIMETARGET = "${RUNTIMELIBSSP} libstdc++-v3 libgomp libatomic ${RUNTIMELIBITM} \
     ${@bb.utils.contains_any('FORTRAN', [',fortran',',f77'], 'libquadmath', '', d)} \
 "
+# Only build libstdc++ for newlib
+RUNTIMETARGET_libc-newlib = "libstdc++-v3"
 
 # libiberty
 # libmudflap