@@ -37,6 +37,16 @@ LICENSE:${PN}-dev = "GPL-3.0-or-later WITH GCC-exception-3.1"
LICENSE:${PN}-dbg = "GPL-3.0-or-later WITH GCC-exception-3.1"
LICENSE:${PN}-src = "GPL-3.0-or-later WITH GCC-exception-3.1"
+# On baremetal there is no libc:
+# configure need limits.h for its sanity check
+# libc dependencies have to be patched out just like in libgcc-initial
+do_configure:prepend:libc-baremetal () {
+ install -d ${STAGING_INCDIR}
+ touch ${STAGING_INCDIR}/limits.h
+ sed -i -e 's#INHIBIT_LIBC_CFLAGS =.*#INHIBIT_LIBC_CFLAGS = -Dinhibit_libc#' ${B}/gcc/libgcc.mvars
+ sed -i -e 's#inhibit_libc = false#inhibit_libc = true#' ${B}/gcc/Makefile
+}
+
FILES:${PN}-dev = "\
${base_libdir}/libgcc*.so \
${@oe.utils.conditional('BASETARGET_SYS', '${TARGET_SYS}', '', '${libdir}/${BASETARGET_SYS}', d)} \
By removing the erroneous EXTRA_OECONF override in 020d5f0, gcc-cross is now configured with correct sysroot flags, which removes the hosts include directory from the internal paths. This in turn leads to libgcc not finding libc headers (as it should) and breaks libgcc build. In order to fix this, libgcc must be built almost like libgcc-initial. Signed-off-by: Joerg Vehlow <joerg.vehlow@emlix.com> --- meta/recipes-devtools/gcc/libgcc.inc | 10 ++++++++++ 1 file changed, 10 insertions(+)