Place ld in exact physical location as on host, not being confused by links. Use realpath, that was already on the list of default PROGS. Signed-off-by: Lukasz Gut <lgut(a)lgut.eu> --- mbuto | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mbuto b/mbuto index 1c3b347..1f92bd9 100755 --- a/mbuto +++ b/mbuto @@ -644,12 +644,13 @@ libs_path_add() { # libs_copy_ld_so() - Copy run-time linker program, mimic location from host # $1: Path to run-time linker libs_copy_ld_so() { - [ -f "${wd}/${1}" ] && return + __srcfile="$("${REALPATH}" "${1}")" + __destfile="${wd}""${__srcfile}" + [ -f "${__destfile}" ] && return - __destdir="$("${DIRNAME}" "${wd}/${1}")" + __destdir="$("${DIRNAME}" "${__destfile}")" "${MKDIR}" -p "${__destdir}" - - "${CP}" --parents --preserve=all "${1}" "${wd}" + "${CP}" --parents --preserve=all "${__srcfile}" "${wd}" } # libs_dlopen_copy() - Recursively copy matching libraries from LIBS_DLOPEN -- 2.46.1