diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk index eec46d44c6..1cd7494fdb 100644 --- a/toolchain/helpers.mk +++ b/toolchain/helpers.mk @@ -19,7 +19,12 @@ copy_toolchain_lib_root = \ rm -fr $(TARGET_DIR)/$${DESTDIR}/$${LIBNAME}; \ if test -h $${LIBPATH} ; then \ cp -d $${LIBPATH} $(TARGET_DIR)/$${DESTDIR}/$${LIBNAME}; \ + OLD_LIBPATH="$${LIBPATH}"; \ LIBPATH="`readlink -f $${LIBPATH}`"; \ + if [ "$${LIBPATH}" = "" ]; then \ + echo "LIBPATH empty after trying to resolve symlink $${OLD_LIBPATH}" 1>&2; \ + exit 1; \ + fi; \ elif test -f $${LIBPATH}; then \ $(INSTALL) -D -m0755 $${LIBPATH} $(TARGET_DIR)/$${DESTDIR}/$${LIBNAME}; \ break ; \