Skip to contentSkip to conversation

toolchain: speed up sysroot lib copying

PATCH New Mike Frysinger 3 participants 6 messages Dec 12, 2010 – Dec 14, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 toolchain: speed up sysroot lib copying

The copy_toolchain_lib_root helper searches the entire sysroot, but is only interested in files in certain subdirs. So rather than waste time in walking the entire tree, walk the few subdirs at the depth level we are actually going to be poaching files from.

---
 toolchain/helpers.mk |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
toolchain/helpers.mk +4 -1
index 05d43e7..674e7b4 100644
@@ -24,7 +24,10 @@ copy_toolchain_lib_root = \
 	STRIP="$(strip $4)"; \
  \
 	LIBS=`(cd $${ARCH_SYSROOT_DIR}; \
-		find -L . -path "./lib/$${LIB}.*"     -o \
+		find -L \
+			  ./lib/ ./usr/lib/ ./usr/$(TOOLCHAIN_EXTERNAL_PREFIX)/lib*/ \
+			  -maxdepth 1 \
+			  -path "./lib/$${LIB}.*"     -o \
 			  -path "./usr/lib/$${LIB}.*" -o \
 			  -path "./usr/$(TOOLCHAIN_EXTERNAL_PREFIX)/lib*/$${LIB}.*" \
 		)` ; \
Signature · 1 line
1.7.3.3
#1 lore raw

PATCH 1/1 toolchain: speed up sysroot lib copying

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

The copy_toolchain_lib_root helper searches the entire sysroot, but is only interested in files in certain subdirs. So rather than waste time in walking the entire tree, walk the few subdirs at the depth level we are actually going to be poaching files from.

---
 toolchain/helpers.mk |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
toolchain/helpers.mk +0 -0
index 05d43e7..674e7b4 100644
@@ -24,7 +24,10 @@ copy_toolchain_lib_root = \
 	STRIP="$(strip $4)"; \

toolchain/helpers.mk copy_toolchain_lib_root = \ · line 33

Quoted 10 lines
toolchain/helpers.mk +4 -1
  \
 	LIBS=`(cd $${ARCH_SYSROOT_DIR}; \
-		find -L . -path "./lib/$${LIB}.*"     -o \
+		find -L \
+			  ./lib/ ./usr/lib/ ./usr/$(TOOLCHAIN_EXTERNAL_PREFIX)/lib*/ \
+			  -maxdepth 1 \
+			  -path "./lib/$${LIB}.*"     -o \
 			  -path "./usr/lib/$${LIB}.*" -o \
 			  -path "./usr/$(TOOLCHAIN_EXTERNAL_PREFIX)/lib*/$${LIB}.*" \
 		)` ; \

Can't we replace the 3 -path conditions with a single -name "$${LIB}.*" condition ?

Thomas

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

PATCH 1/1 toolchain: speed up sysroot lib copying

Quoted 12 lines · On Monday, December 13, 2010 16:26:39 Thomas Petazzoni wrote:
Quoted 11 lines · On Sun, 12 Dec 2010 11:25:20 -0500 Mike Frysinger wrote:

The copy_toolchain_lib_root helper searches the entire sysroot, but is only interested in files in certain subdirs. So rather than waste time in walking the entire tree, walk the few subdirs at the depth level we are actually going to be poaching files from.

toolchain/helpers.mk +0 -0
index 05d43e7..674e7b4 100644
@@ -24,7 +24,10 @@ copy_toolchain_lib_root = \
 
Quoted 4 lines

toolchain/helpers.mk copy_toolchain_lib_root = \

Quoted 4 lines
toolchain/helpers.mk +2 -1
 	LIBS=`(cd $${ARCH_SYSROOT_DIR}; \
-		find -L . -path "./lib/$${LIB}.*"     -o \
+		find -L \
+			  ./lib/ ./usr/lib/ 

./usr/$(TOOLCHAIN_EXTERNAL_PREFIX)/lib*/ \

Quoted 5 lines

toolchain/helpers.mk copy_toolchain_lib_root = \

Quoted 5 lines
toolchain/helpers.mk +2 -0
+			  -maxdepth 1 \
+			  -path "./lib/$${LIB}.*"     -o \
 
 			  -path "./usr/lib/$${LIB}.*" -o \
 			  -path 

"./usr/$(TOOLCHAIN_EXTERNAL_PREFIX)/lib*/$${LIB}.*" \

Quoted 4 lines

toolchain/helpers.mk copy_toolchain_lib_root = \ · line 33

Quoted 1 line
toolchain/helpers.mk +0 -0
 		)` ; \

Can't we replace the 3 -path conditions with a single -name "$${LIB}.*" condition ?

sure, i can send an updated patch that does that
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20101213/082589b2/attachment-0001.pgp>

#3 lore raw

PATCH 1/1 toolchain: speed up sysroot lib copying

In reply to Mike Frysinger

Le dimanche 12 d?cembre 2010 ? 11:25 -0500, Mike Frysinger a ?crit :

toolchain/helpers.mk copy_toolchain_lib_root = \ · line 33

Quoted 9 lines
toolchain/helpers.mk +4 -1
 	LIBS=`(cd $${ARCH_SYSROOT_DIR}; \
-		find -L . -path "./lib/$${LIB}.*"     -o \
+		find -L \
+			  ./lib/ ./usr/lib/ ./usr/$(TOOLCHAIN_EXTERNAL_PREFIX)/lib*/ \
+			  -maxdepth 1 \
+			  -path "./lib/$${LIB}.*"     -o \
 			  -path "./usr/lib/$${LIB}.*" -o \
 			  -path "./usr/$(TOOLCHAIN_EXTERNAL_PREFIX)/lib*/$${LIB}.*" \
 		)` ; \

Aren't we missing the locales files here ?

Like this one :

/usr/share/locale/fr/LC_MESSAGES/libc.mo

(I might be wrong...)

Regards,

--
Lionel Landwerlin

#4 lore raw

PATCH 1/1 toolchain: speed up sysroot lib copying

Quoted 6 lines · On Monday, December 13, 2010 17:23:05 Lionel Landwerlin wrote:

Le dimanche 12 d?cembre 2010 ? 11:25 -0500, Mike Frysinger a ?crit :

toolchain/helpers.mk copy_toolchain_lib_root = \

Quoted 5 lines
toolchain/helpers.mk +2 -1
 	LIBS=`(cd $${ARCH_SYSROOT_DIR}; \
 
-		find -L . -path "./lib/$${LIB}.*"     -o \
+		find -L \
+			  ./lib/ ./usr/lib/ 

./usr/$(TOOLCHAIN_EXTERNAL_PREFIX)/lib*/ \

Quoted 5 lines

toolchain/helpers.mk copy_toolchain_lib_root = \

Quoted 5 lines
toolchain/helpers.mk +2 -0
+			  -maxdepth 1 \
+			  -path "./lib/$${LIB}.*"     -o \
 
 			  -path "./usr/lib/$${LIB}.*" -o \
 			  -path 

"./usr/$(TOOLCHAIN_EXTERNAL_PREFIX)/lib*/$${LIB}.*" \

Quoted 8 lines
Quoted 2 lines

)` ; \

Aren't we missing the locales files here ?

Like this one :

/usr/share/locale/fr/LC_MESSAGES/libc.mo

the point of this is to copy just library files. the full sysroot copy
happens elsewhere.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20101213/01d4f89a/attachment-0001.pgp>

#5 lore raw

PATCH v2 1/1 toolchain: speed up sysroot lib copying

In reply to Mike Frysinger

The copy_toolchain_lib_root helper searches the entire sysroot, but is only interested in files in certain subdirs. So rather than waste time in walking the entire tree, walk the few subdirs at the depth level we are actually going to be poaching files from.

---
v2
- unify -path's too

 toolchain/helpers.mk |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
toolchain/helpers.mk +3 -3
index d4caf48..3ea9075 100644
@@ -22,9 +22,9 @@ copy_toolchain_lib_root = \
 	DESTDIR="$(strip $3)" ; \
  \
 	LIBS=`(cd $${ARCH_SYSROOT_DIR}; \
-		find -L . -path "./lib/$${LIB}.*"     -o \
-			  -path "./usr/lib/$${LIB}.*" -o \
-			  -path "./usr/$(TOOLCHAIN_EXTERNAL_PREFIX)/lib*/$${LIB}.*" \
+		find -L \
+			$(for d in lib* usr/lib* usr/$(TOOLCHAIN_EXTERNAL_PREFIX)/lib*; do test -e "$d" && echo $d) \
+			-maxdepth 1 -name "$${LIB}.*" \
 		)` ; \
 	for FILE in $${LIBS} ; do \
 		LIB=`basename $${FILE}`; \
Signature · 1 line
1.7.3.3