diff --git a/tests/replace-add-needed.sh b/tests/replace-add-needed.sh index 701cb953..1282f4f8 100755 --- a/tests/replace-add-needed.sh +++ b/tests/replace-add-needed.sh @@ -11,7 +11,15 @@ cp libbar.so "${SCRATCH}"/ cd "${SCRATCH}" -libcldd=$(ldd ./simple | awk '/ => / { print $3 }' | grep -E "(libc(-[0-9.]*)*.so|ld-musl)") +# QEMU & ldd are not playing well together in certain cases +if ldd ./simple >/dev/null 2>&1; then + libcldd=$(ldd ./simple | awk '/ => / { print $3 }' | grep -E "(libc(-[0-9.]*)*.so|ld-musl)") +elif [ -f /lib64/libc.so.6 ]; then + libcldd=/lib64/libc.so.6 +else + echo "ldd ./simple failed" + exit 1 +fi # We have to set the soname on these libraries ${PATCHELF} --set-soname libbar.so ./libbar.so diff --git a/tests/set-interpreter-long.sh b/tests/set-interpreter-long.sh index f1e0d2f9..bb692aeb 100755 --- a/tests/set-interpreter-long.sh +++ b/tests/set-interpreter-long.sh @@ -6,7 +6,8 @@ SCRATCH=scratch/$(basename "$0" .sh) oldInterpreter=$(../src/patchelf --print-interpreter ./simple) echo "current interpreter is $oldInterpreter" -if test "$(uname)" = Linux; then +# QEMU & ldd/ld.so are not playing well together in certain cases +if test "$(uname)" = Linux && ldd ./simple >/dev/null 2>&1; then echo "running with explicit interpreter..." "$oldInterpreter" ./simple fi @@ -28,7 +29,7 @@ echo "running with new interpreter..." ln -s "$oldInterpreter" "$newInterpreter" "${SCRATCH}"/simple -if test "$(uname)" = Linux; then +if test "$(uname)" = Linux && ldd ./simple >/dev/null 2>&1; then echo "running with explicit interpreter..." "$oldInterpreter" "${SCRATCH}/simple" fi