--- gentoolkit/src/revdep-rebuild/revdep-rebuild +++ gentoolkit/src/revdep-rebuild/revdep-rebuild @@ -641,7 +641,12 @@ if [[ $target_file != *.la ]]; then # Note: double checking seems to be faster than single with complete path # (special add ons are rare). - ldd_output=$(ldd "$target_file" 2>> "$LIST.3_ldd_errors" | sort -u) + case $target_file in + *.so|*.so.*) + ldd_output=$(ldd "$target_file" 2>> "$LIST.3_ldd_errors" | sort -u);; + *) + ldd_output=$(ldd -d -r "$target_file" 2>> "$LIST.3_ldd_errors" | sort -u);; + esac ldd_status=$? # TODO: Check this for problems with sort # HACK: if LD_LIBRARY_MASK is null or undefined grep -vF doesn't work if grep -vF "${LD_LIBRARY_MASK:=$'\a'}" <<< "$ldd_output" | @@ -708,17 +713,19 @@ done if [[ $SEARCH_BROKEN ]]; then # Look for missing version - while read target_file; do + while read target_file && read message; do echo "obj $target_file" >> "$LIST.3_rebuild" - echo_v " broken $target_file (no version information available)" + echo_v " broken $target_file ($message)" done < <( # Regexify LD_LIBRARY_MASK. Exclude it from the search. LD_LIBRARY_MASK="${LD_LIBRARY_MASK//$'\n'/|}" awk -v ldmask="(${LD_LIBRARY_MASK//./\\\.})" ' - /no version information available/ && $0 !~ ldmask { + /no version information available|undefined symbol/ && $0 !~ ldmask { gsub(/[()]/, "", $NF) if (seen[$NF]++) next print $NF + NF-- + print $0 }' "$LIST.3_ldd_errors" ) fi