From 92207bc03f2358b28e0fd2cc3a41e40504b5d3d4 Mon Sep 17 00:00:00 2001 From: Jonah Petri Date: Thu, 26 Aug 2021 15:34:24 -0400 Subject: [PATCH] toolchain: handle toolchains with multiple ld*.so.* files Some 3rd party vendor toolchains have multiple files which match these glob patterns. In this case, the shell script failed. Switching to use find and xargs solves the issue. Signed-off-by: Jonah Petri Signed-off-by: Arnout Vandecappelle (Essensium/Mind) --- toolchain/helpers.mk | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk index dfb2581ed5..1dfb52ac38 100644 --- a/toolchain/helpers.mk +++ b/toolchain/helpers.mk @@ -135,10 +135,8 @@ copy_toolchain_sysroot = \ $(call simplify_symlink,$$i,$(STAGING_DIR)) ; \ done ; \ fi ; \ - if [ ! -e $(STAGING_DIR)/lib/ld*.so.* ]; then \ - if [ -e $${ARCH_SYSROOT_DIR}/lib/ld*.so.* ]; then \ - cp -a $${ARCH_SYSROOT_DIR}/lib/ld*.so.* $(STAGING_DIR)/lib/ ; \ - fi ; \ + if [[ ! $$(find $(STAGING_DIR)/lib -name 'ld*.so.*' -print -quit) ]]; then \ + find $${ARCH_SYSROOT_DIR}/lib -name 'ld*.so.*' -print0 | xargs -0 -I % cp % $(STAGING_DIR)/lib/; \ fi ; \ if [ `readlink -f $${SYSROOT_DIR}` != `readlink -f $${ARCH_SYSROOT_DIR}` ] ; then \ if [ ! -d $${ARCH_SYSROOT_DIR}/usr/include ] ; then \ -- 2.30.2