From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Petazzoni Date: Thu, 30 Oct 2008 10:02:47 +0100 Subject: [Buildroot] [PATCH] More external toolchain fixes Message-ID: <20081030100247.423cf5c1@surf> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: buildroot@busybox.net Fix issues with binary external toolchains Fix two problems encountered while using an external binary toolchain generated by crosstool-ng: - Don't remove the ending / in LIB_DIR, otherwise find $LIB_DIR -maxdepth 1 doesn't find any file in the case LIB_DIR is a symbolic link and not a directory. For some reason, find -maxdepth 1 doesn't have the same behaviour on directories and symbolic links. Demonstration: $ mkdir foobar $ touch foobar/t1 $ touch foobar/t2 $ ln -s foobar barfoo $ find foobar -maxdepth 1 -name 't*' foobar/t1 foobar/t2 $ find barfoo -maxdepth 1 -name 't*' $ find barfoo/ -maxdepth 1 -name 't*' barfoo/t1 barfoo/t2 * Make sure the libraries are writable, otherwise the strip operation might fail. The library files may not be writable if the toolchain is not writable (which may happen if one wants to prevent anyone from overwriting the toolchain, which is done by crosstool-ng, for example). Signed-off-by: Thomas Petazzoni --- toolchain/external-toolchain/ext-tool.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Index: buildroot/toolchain/external-toolchain/ext-tool.mk =================================================================== --- buildroot.orig/toolchain/external-toolchain/ext-tool.mk +++ buildroot/toolchain/external-toolchain/ext-tool.mk @@ -10,7 +10,7 @@ DST="$(strip $2)"; \ STRIP="$(strip $3)"; \ \ - LIB_DIR=`$(TARGET_CC) -print-file-name=$${LIB} | sed -e "s,/$${LIB}\$$,,"`; \ + LIB_DIR=`$(TARGET_CC) -print-file-name=$${LIB} | sed -e "s,$${LIB}\$$,,"`; \ \ if test -z "$${LIB_DIR}"; then \ echo "copy_toolchain_lib_root: lib=$${LIB} not found"; \ @@ -28,6 +28,7 @@ cp -d $${LIB_DIR}/$${LIB} $(TARGET_DIR)$${DST}/; \ elif test -f $${LIB_DIR}/$${LIB}; then \ cp $${LIB_DIR}/$${LIB} $(TARGET_DIR)$${DST}/$${LIB}; \ + chmod u+w $(TARGET_DIR)$${DST}/$${LIB}; \ case "$${STRIP}" in \ (0 | n | no) \ ;; \ -- Thomas Petazzoni, Free Electrons Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com