commit: c3a69ee41aa0dd40342e05c7e275f82f31744ae1 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> AuthorDate: Sat Nov 28 19:36:08 2020 +0000 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> CommitDate: Sat Nov 28 19:36:08 2020 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=c3a69ee4
bin/misc-functions: resolve libraries from macOS SDK if configured Bug: https://bugs.gentoo.org/757240 Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> bin/misc-functions.sh | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh index d01a8edb1..8f62cb7f1 100755 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@ -360,9 +360,27 @@ install_qa_check_macho() { elif [[ ${lib} == ${S}* ]] ; then eqawarn "QA Notice: install_name references \${S}: ${lib} in ${obj}" [[ -z ${ignore} ]] && touch "${T}"/.install_name_check_failed - elif ! install_name_is_relative ${lib} && [[ ! -e ${lib} && ! -e ${D}${lib} ]] ; then - eqawarn "QA Notice: invalid reference to ${lib} in ${obj}" - [[ -z ${ignore} ]] && touch "${T}"/.install_name_check_failed + elif ! install_name_is_relative ${lib} ; then + local isok=no + if [[ -e ${lib} || -e ${D}${lib} ]] ; then + isok=yes # yay, we're ok + elif [[ -e "${EROOT}"/MacOSX.sdk ]] ; then + # trigger SDK mode, at least since Big Sur (11.0) + # there are no libraries in /usr/lib any more, but + # there are references too it (some library cache is + # in place), yet we can validate it sort of is sane + # by looking at the SDK metacaches, TAPI-files, .tbd + # text versions of libraries, so just look there + local tbd=${lib%.*}.tbd + if [[ -e ${EROOT}/MacOSX.sdk/${tbd} ]] ; then + isok=yes # it's in the SDK, so ok + fi + fi + if [[ ${isok} == no ]] ; then + eqawarn "QA Notice: invalid reference to ${lib} in ${obj}" + [[ -z ${ignore} ]] && \ + touch "${T}"/.install_name_check_failed + fi fi done
