From 43b2dd23453b324af7176d9a66f6718393cd0d68 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Thu, 3 Dec 2020 20:37:47 -0600 Subject: [PATCH 3/4] Darwin Clang Bootstra: Fixes for stage3 - Patch stage1 bootstrapped python to disable _scproxy module (which is what the ebuild does. - Adjust the PATH to include newer llvm (11 and 12) paths - Drop llvm-nm darwin hack for newer llvm (not needed any more) Bug: https://bugs.gentoo.org/758167 Signed-off-by: Jacob Floyd --- scripts/bootstrap-prefix.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh index 6378eed5a5..3fcfa3bced 100755 --- a/scripts/bootstrap-prefix.sh +++ b/scripts/bootstrap-prefix.sh @@ -1149,6 +1149,12 @@ bootstrap_python() { export PYTHON_DISABLE_SSL=1 export OPT="${CFLAGS}" + if [[ ${CHOST} == *-darwin* ]]; then + PYTHON_DISABLE_MODULES+=" _scproxy" + sed -i -e '/sys.platform/s/darwin/disabled-darwin/' \ + Lib/urllib/request.py || return 1 + fi + einfo "Compiling ${A%-*}" # some ancient versions of hg fail with "hg id -i", so help @@ -1927,7 +1933,7 @@ bootstrap_stage3() { # (CBUILD, BDEPEND) and with the system being built # (CHOST, RDEPEND). To correctly bootstrap stage3, # PORTAGE_OVERRIDE_EPREFIX as BROOT is needed. - PREROOTPATH="${ROOT}"$(echo /{,tmp/}{usr/,}{,lib/llvm/{10,9,8,7,6,5}/}{s,}bin | sed "s, ,:${ROOT},g") \ + PREROOTPATH="${ROOT}"$(echo /{,tmp/}{usr/,}{,lib/llvm/{12,11,10,9,8,7,6,5}/}{s,}bin | sed "s, ,:${ROOT},g") \ EPREFIX="${ROOT}" PORTAGE_TMPDIR="${PORTAGE_TMPDIR}" \ FEATURES="${FEATURES} force-prefix" \ EMERGE_LOG_DIR="${ROOT}"/var/log \ @@ -2093,11 +2099,11 @@ bootstrap_stage3() { # now we have the compiler right there unset CXX CPPFLAGS LDFLAGS - # On Darwin we have llvm-3.5 at this point, which provides nm. + # On old Darwin we have llvm-3.5 at this point, which provides nm. # However for some reason this nm doesn't quite get it on newer # platforms at least, resulting in bugs like #598336. To cater for # that, get rid of this nm and rely on the host one at this stage - [[ ${CHOST} == *-darwin* ]] && \ + [[ ${CHOST} == *-darwin* && ! -d "${ROOT}/MacOSX.sdk" ]] && \ rm -f "${ROOT}"{,/tmp}/usr/bin/{,${CHOST}-}nm rm -f "${ROOT}"/etc/ld.so.conf.d/stage2.conf -- 2.28.0