Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] libgcc: fix build for baremetal
@ 2026-10-07  5:57 Joerg Vehlow
  2026-10-07 20:33 ` [OE-core] " Ryan Eatmon
  0 siblings, 1 reply; 3+ messages in thread
From: Joerg Vehlow @ 2026-10-07  5:57 UTC (permalink / raw)
  To: openembedded-core; +Cc: denis, richard.purdie, Joerg Vehlow

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(+)

diff --git a/meta/recipes-devtools/gcc/libgcc.inc b/meta/recipes-devtools/gcc/libgcc.inc
index e92dadf021..93e217f567 100644
--- a/meta/recipes-devtools/gcc/libgcc.inc
+++ b/meta/recipes-devtools/gcc/libgcc.inc
@@ -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)} \


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-10-08  1:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-07  5:57 [PATCH] libgcc: fix build for baremetal Joerg Vehlow
2026-10-07 20:33 ` [OE-core] " Ryan Eatmon
2026-10-08  1:17   ` Denys Dmytriyenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox