toolchain: copy_toolchain_lib_root: clarify input parameter
authorThomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Tue, 7 Feb 2017 21:56:48 +0000 (22:56 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Wed, 5 Apr 2017 19:33:29 +0000 (21:33 +0200)
The input to copy_toolchain_lib_root is not one library, not a list of
libraries, but a library name pattern with glob wildcards.
This pattern is then passed to 'find' to get the actual list of libraries
matching the pattern. Reflect this using an appropriate variable name.

Note: if the root of the buildroot tree contains a file matching one of
these library patterns, the copying of libraries from staging to target will
not be correct. It is not impossible to fix that, e.g. using 'set -f', but
maybe it's not worth it.

Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/glibc/glibc.mk
toolchain/helpers.mk
toolchain/toolchain-external/pkg-toolchain-external.mk

index 58cb3d46c5ebec8979a3fe5cc20bec7a89b53e8e..ccaa4c2a981bea43078b0e1960356854484c8e28 100644 (file)
@@ -110,8 +110,8 @@ GLIBC_LIBS_LIB += libthread_db.so.*
 endif
 
 define GLIBC_INSTALL_TARGET_CMDS
-       for libs in $(GLIBC_LIBS_LIB); do \
-               $(call copy_toolchain_lib_root,$$libs) ; \
+       for libpattern in $(GLIBC_LIBS_LIB); do \
+               $(call copy_toolchain_lib_root,$$libpattern) ; \
        done
 endef
 
index 0ec9da42f2732952a80a61a5e5f4e360ed309b20..e83bf272e764545b638ce2f57e9e8b988eb653b5 100644 (file)
@@ -6,12 +6,12 @@
 # toolchain logic, and the glibc package, so care must be taken when
 # changing this function.
 #
-# $1: library name
+# $1: library name pattern (can include glob wildcards)
 #
 copy_toolchain_lib_root = \
-       LIB="$(strip $1)"; \
+       LIBPATTERN="$(strip $1)"; \
 \
-       LIBPATHS=`find $(STAGING_DIR)/ -name "$${LIB}" 2>/dev/null` ; \
+       LIBPATHS=`find $(STAGING_DIR)/ -name "$${LIBPATTERN}" 2>/dev/null` ; \
        for LIBPATH in $${LIBPATHS} ; do \
                DESTDIR=`echo $${LIBPATH} | sed "s,^$(STAGING_DIR)/,," | xargs dirname` ; \
                mkdir -p $(TARGET_DIR)/$${DESTDIR}; \
index a4d010a93c93574e51aaa04fcd4b6a08f07b009f..9670350dc048bc98f103230c0d7161fd7501ed4e 100644 (file)
@@ -387,8 +387,8 @@ endef
 ifeq ($(BR2_STATIC_LIBS),)
 define TOOLCHAIN_EXTERNAL_INSTALL_TARGET_LIBS
        $(Q)$(call MESSAGE,"Copying external toolchain libraries to target...")
-       $(Q)for libs in $(TOOLCHAIN_EXTERNAL_LIBS); do \
-               $(call copy_toolchain_lib_root,$$libs); \
+       $(Q)for libpattern in $(TOOLCHAIN_EXTERNAL_LIBS); do \
+               $(call copy_toolchain_lib_root,$$libpattern); \
        done
 endef
 endif