Skip to contentSkip to conversation

toolchain: glibc: improve library checking

PATCH New Mike Frysinger 2 participants 2 messages Dec 12, 2010 – Dec 13, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 toolchain: glibc: improve library checking

If the source sysroot has symlinks to the ldso, the globs might match more than one file, and test fails due to too many arguments. So move the glob into a for loop and test each result that way.

---
 toolchain/helpers.mk |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
toolchain/helpers.mk +7 -4
index 674e7b4..166f290 100644
@@ -150,10 +150,13 @@ check_glibc_feature = \
 #
 check_glibc = \
 	SYSROOT_DIR="$(strip $1)"; \
-	if ! test -f $${SYSROOT_DIR}/lib/ld-linux*.so.* -o -f $${SYSROOT_DIR}/lib/ld.so.* ; then \
-		echo "Incorrect selection of the C library"; \
-		exit -1; \
-	fi; \
+	for l in $${SYSROOT_DIR}/lib/ld-linux*.so.* $${SYSROOT_DIR}/lib/ld.so.* ""; do \
+		if test -z "$$l"; then \
+			echo "Incorrect selection of the C library"; \
+			exit 1; \
+		fi; \
+		test -f $$l && break; \
+	done; \
 	$(call check_glibc_feature,BR2_LARGEFILE,Large file support) ;\
 	$(call check_glibc_feature,BR2_INET_IPV6,IPv6 support) ;\
 	$(call check_glibc_feature,BR2_INET_RPC,RPC support) ;\
Signature · 1 line
1.7.3.3
#1 lore raw

PATCH 1/1 toolchain: glibc: improve library checking

Hello Mike,

Quoted 3 lines · On Sun, 12 Dec 2010 11:56:25 -0500 Mike Frysinger <[email protected]> wrote:

If the source sysroot has symlinks to the ldso, the globs might match more than one file, and test fails due to too many arguments. So move the glob into a for loop and test each result that way.

Here as well, could you give a specific example of a toolchain that exhibits the problem ?

Thanks!

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com