toolchain: speed up sysroot lib copying
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
@@ -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
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_roothelper 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.Signed-off-by Mike Frysinger <[email protected]>--- toolchain/helpers.mk | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)toolchain/helpers.mk +0
-0@@ -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
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_roothelper 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@@ -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
-1LIBS=`(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>
PATCH 1/1 toolchain: speed up sysroot lib copying
In reply to Mike FrysingerLe 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
-1LIBS=`(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
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
-1LIBS=`(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>
PATCH v2 1/1 toolchain: speed up sysroot lib copying
In reply to Mike FrysingerThe 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
@@ -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