summaryrefslogtreecommitdiffstats
path: root/toolchain/external-toolchain/ext-tool.mk
diff options
context:
space:
mode:
authorPeter Korsgaard2008-11-03 11:32:59 +0100
committerPeter Korsgaard2008-11-03 11:32:59 +0100
commitdf1df36fcbdb14d96e94198714ef0e8c990f8d17 (patch)
tree7924d0bc0de0473e8fff555fb684a64aec53a5b6 /toolchain/external-toolchain/ext-tool.mk
parentExternal toolchain support improvements (diff)
downloadbuildroot-df1df36fcbdb14d96e94198714ef0e8c990f8d17.tar.gz
buildroot-df1df36fcbdb14d96e94198714ef0e8c990f8d17.tar.xz
buildroot-df1df36fcbdb14d96e94198714ef0e8c990f8d17.zip
More external toolchain fixes
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 <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'toolchain/external-toolchain/ext-tool.mk')
-rw-r--r--toolchain/external-toolchain/ext-tool.mk4
1 files changed, 2 insertions, 2 deletions
diff --git a/toolchain/external-toolchain/ext-tool.mk b/toolchain/external-toolchain/ext-tool.mk
index bbf430cbb..a9ca1f4a9 100644
--- a/toolchain/external-toolchain/ext-tool.mk
+++ b/toolchain/external-toolchain/ext-tool.mk
@@ -10,7 +10,7 @@ copy_toolchain_lib_root = \
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"; \
@@ -27,7 +27,7 @@ copy_toolchain_lib_root = \
if test -h $${LIB_DIR}/$${LIB}; then \
cp -d $${LIB_DIR}/$${LIB} $(TARGET_DIR)$${DST}/; \
elif test -f $${LIB_DIR}/$${LIB}; then \
- cp $${LIB_DIR}/$${LIB} $(TARGET_DIR)$${DST}/$${LIB}; \
+ $(INSTALL) -D -m0755 $${LIB_DIR}/$${LIB} $(TARGET_DIR)$${DST}/$${LIB}; \
case "$${STRIP}" in \
(0 | n | no) \
;; \