summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Enedino Hernandez Samaniego <alejandro@enedino.org>2020-01-18 19:01:59 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-01-19 23:49:39 +0000
commite261883a0fa673b6c11bd4f81669843c3f0f8af6 (patch)
treeaf1af642e1930e0c58d530b719f9db185825167c
parent0b088f99e64d3a1cb9bf1793a9371220e40f6516 (diff)
downloadpoky-e261883a0fa673b6c11bd4f81669843c3f0f8af6.tar.gz
newlib: Enable building libstdc++ for newlib based toolchains
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. (From OE-Core rev: 18af9ecef6e247519d8a1573e32208bb69cf81fe) Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandro@enedino.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/conf/distro/include/tclibc-newlib.inc7
-rw-r--r--meta/recipes-devtools/gcc/gcc-runtime.inc6
2 files changed, 9 insertions, 4 deletions
diff --git a/meta/conf/distro/include/tclibc-newlib.inc b/meta/conf/distro/include/tclibc-newlib.inc
index 896c0b16d7..8338003e31 100644
--- a/meta/conf/distro/include/tclibc-newlib.inc
+++ b/meta/conf/distro/include/tclibc-newlib.inc
@@ -25,12 +25,11 @@ LIBC_DEPENDENCIES = "\
25 libgloss-dbg \ 25 libgloss-dbg \
26 libgcc-dev \ 26 libgcc-dev \
27 libgcc-dbg \ 27 libgcc-dbg \
28 libstdc++-dev \
29 libstdc++-staticdev \
28 " 30 "
29 31
30# compilerlibs defaults to gcc-runtime, but we get runtime from libgloss 32ASSUME_PROVIDED += "virtual/crypt"
31# we set ASSUME_PROVIDED because we cant set PREFERRED_PROVIDER
32# for compilerlibs since its overridden by tcmode-default
33ASSUME_PROVIDED += "virtual/${TARGET_PREFIX}compilerlibs virtual/crypt"
34 33
35# Its useful to be able to extend newlib, but we dont provide a native variant of libgloss 34# Its useful to be able to extend newlib, but we dont provide a native variant of libgloss
36NEWLIB_EXTENDED ?= "libgloss libgcc" 35NEWLIB_EXTENDED ?= "libgloss libgcc"
diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc b/meta/recipes-devtools/gcc/gcc-runtime.inc
index d3f8ae8b9b..b2c5d43bd4 100644
--- a/meta/recipes-devtools/gcc/gcc-runtime.inc
+++ b/meta/recipes-devtools/gcc/gcc-runtime.inc
@@ -16,10 +16,14 @@ EXTRA_OECONF_PATHS = "\
16 16
17EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu" 17EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu"
18EXTRA_OECONF_append = " --cache-file=${B}/config.cache" 18EXTRA_OECONF_append = " --cache-file=${B}/config.cache"
19EXTRA_OECONF_append_libc-newlib = " --with-newlib"
19 20
20# Disable ifuncs for libatomic on arm conflicts -march/-mcpu 21# Disable ifuncs for libatomic on arm conflicts -march/-mcpu
21EXTRA_OECONF_append_arm = " libat_cv_have_ifunc=no " 22EXTRA_OECONF_append_arm = " libat_cv_have_ifunc=no "
22 23
24# Newlib does not support symbol versioning on libsdtcc++
25SYMVERS_CONF_libc-newlib = ""
26
23# Building with thumb enabled on armv6t fails 27# Building with thumb enabled on armv6t fails
24ARM_INSTRUCTION_SET_armv6 = "arm" 28ARM_INSTRUCTION_SET_armv6 = "arm"
25 29
@@ -36,6 +40,8 @@ RUNTIMELIBSSP_mingw32 ?= "libssp"
36RUNTIMETARGET = "${RUNTIMELIBSSP} libstdc++-v3 libgomp libatomic ${RUNTIMELIBITM} \ 40RUNTIMETARGET = "${RUNTIMELIBSSP} libstdc++-v3 libgomp libatomic ${RUNTIMELIBITM} \
37 ${@bb.utils.contains_any('FORTRAN', [',fortran',',f77'], 'libquadmath', '', d)} \ 41 ${@bb.utils.contains_any('FORTRAN', [',fortran',',f77'], 'libquadmath', '', d)} \
38" 42"
43# Only build libstdc++ for newlib
44RUNTIMETARGET_libc-newlib = "libstdc++-v3"
39 45
40# libiberty 46# libiberty
41# libmudflap 47# libmudflap