[Buildroot] [PATCH v2 1/1] toolchain: handle toolchains with multiple ld*.so.* files

Baruch Siach baruch at tkos.co.il
Thu Aug 26 11:24:25 UTC 2021


Hi Arnout, Jonah,

On Wed, Aug 25 2021, Arnout Vandecappelle wrote:
> On 24/08/2021 22:38, Jonah Petri wrote:
>> 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 <jonah at petri.us>
>
>  Applied to master, thanks.

It looks like this breaks the ARM aarch64 external toolchain. Both ld.so
existence test and ld.so listing command are broken. See this libnl
failure:

  http://autobuild.buildroot.net/results/afe/afe44f4b6a3c53e5864cfb10b04529011e72cf5c/

I have no idea why we don't see much wider breakage in the autobuilder.

The patch below fixes the build here, but I'm not entirely sure it is
the correct fix.

Since this is a risky change and we are close to release, I'd suggest to
revert this change in master, and consider it again for next.

diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
index 5ed149d57d31..3aefd1d0096e 100644
--- a/toolchain/helpers.mk
+++ b/toolchain/helpers.mk
@@ -135,8 +135,8 @@ copy_toolchain_sysroot = \
 			$(call simplify_symlink,$$i,$(STAGING_DIR)) ; \
 		done ; \
 	fi ; \
-       if ! find -wholename $(STAGING_DIR)'/lib/ld*.so.*' > /dev/null; then \
-               find -wholename $${ARCH_SYSROOT_DIR}'/lib/ld*.so.*' -print0 | xargs -0 -I % cp % $(STAGING_DIR)/lib/; \
+       if [ ! -e $(STAGING_DIR)/lib/ld*.so.* ]; then \
+               find $${ARCH_SYSROOT_DIR} -wholename '*/lib/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 \

baruch

>> ---
>> Changes v1->v2:
>> 	Add SOB
>> 
>>  toolchain/helpers.mk | 6 ++----
>>  1 file changed, 2 insertions(+), 4 deletions(-)
>> 
>> diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
>> index dfb2581ed5..5ed149d57d 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 -wholename $(STAGING_DIR)'/lib/ld*.so.*' > /dev/null; then \
>> +               find -wholename $${ARCH_SYSROOT_DIR}'/lib/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 \
>> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot


-- 
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -


More information about the buildroot mailing list