[Buildroot] [PATCH 2/4] package/Makefile.in: add detection for the lack of C library

Thomas Petazzoni thomas.petazzoni at bootlin.com
Tue Jul 26 16:30:59 UTC 2022


We recently had several cases of architecture configurations for which
no C library was available, leading to a build failure during the gcc
build. In order to more easily detect those bogus configurations,
let's bail out very early by detecting the lack of C library
selection.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
---
 package/Makefile.in | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/package/Makefile.in b/package/Makefile.in
index 508ea7c366..f8920c87a4 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -47,6 +47,12 @@ else
 TARGET_OS = linux
 endif
 
+# This happens if there is a bug in Buildroot that allows an
+# architecture configuration that isn't supported by any library.
+ifeq ($(BR2_TOOLCHAIN_USES_GLIBC)$(BR2_TOOLCHAIN_USES_UCLIBC)$(BR2_TOOLCHAIN_USES_MUSL),)
+$(error No C library enabled, this is not possible.)
+endif
+
 ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
 LIBC = uclibc
 else ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
-- 
2.37.1




More information about the buildroot mailing list