From 463a4a8a95d8a3380fb58c570d9fd119e19b1baa Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Fri, 1 Feb 2008 19:25:49 +0000 Subject: [PATCH] First shot at storing NEEDED info for Darwin hosts. We simulate the scanelf output to the max, by stripping of (valuable) path information and storing the filenames of the dynamic libs only. svn path=/main/branches/prefix/; revision=9267 --- bin/misc-functions.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh index 080367570..e027095e0 100644 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@ -335,9 +335,13 @@ install_qa_check() { [[ ${abort} == "yes" ]] && die "soiled libtool library files found" # Check that we don't get kernel traps at runtime because of broken - # install_names on Darwin + # install_names on Darwin, at the same time generate the NEEDED + # entries. As long as we don't have a "scanelf" tool for this, we + # use otool to do the magic. Since this is expensive, we do it + # together with the scan for broken installs. rm -f "${T}"/.install_name_check_failed [[ ${CHOST} == *-darwin* ]] && find "${ED}" -type f | while read f ; do + needed="" otool -LX "${f}" \ | grep -v "Archive : " \ | sed -e 's/^\t//' -e 's/ (compa.*$//' \ @@ -351,6 +355,7 @@ install_qa_check() { ewarn "correcting install_name from ${r} to ${s} in ${f#${D}}" install_name_tool -change \ "${r}" "${s}" "${f}" + r=${s} # for the NEEDED entries else eqawarn "QA Notice: invalid reference to ${r} in ${f}" # remember we are in an implicit subshell, that's @@ -359,7 +364,12 @@ install_qa_check() { touch "${T}"/.install_name_check_failed fi fi + # scanelf only knows the libname, so we'll do the same even + # though we have the full path :( + needed="${needed}${needed:+,}${r##*/}" done + [[ -n ${needed} ]] && \ + echo "/${f#${ED}} ${needed}" > "${PORTAGE_BUILDDIR}"/build-info/NEEDED done if [[ -f ${T}/.install_name_check_failed ]] ; then # secret switch "allow_broken_install_names" to get -- 2.26.2