[Buildroot] [git commit branch/2022.05.x] package/Makefile.in: add detection for the lack of C library

Peter Korsgaard peter at korsgaard.com
Mon Aug 29 20:14:58 UTC 2022


commit: https://git.buildroot.net/buildroot/commit/?id=131cb373bc28af8175df5bec8435afea1271b290
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/2022.05.x

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>
[yann.morin.1998 at free.fr:
  - move as final else clause in existing conditional block
]
Signed-off-by: Yann E. MORIN <yann.morin.1998 at free.fr>
(cherry picked from commit fda53f0791f5657d41735a40a29df3c8d0e8ae79)
Signed-off-by: Peter Korsgaard <peter at korsgaard.com>
---
 package/Makefile.in | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/package/Makefile.in b/package/Makefile.in
index 508ea7c366..580e9d14ca 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -51,8 +51,12 @@ ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
 LIBC = uclibc
 else ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
 LIBC = musl
-else
+else ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y)
 LIBC = gnu
+else
+# This happens if there is a bug in Buildroot that allows an
+# architecture configuration that isn't supported by any library.
+$(error No C library enabled, this is not possible.)
 endif
 
 # The ABI suffix is a bit special on ARM, as it needs to be



More information about the buildroot mailing list