From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 7284D1382C5 for ; Sun, 27 Dec 2020 09:50:56 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BFAADE0BE0; Sun, 27 Dec 2020 09:50:55 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 952C9E0B54 for ; Sun, 27 Dec 2020 09:50:55 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1DEE6340FBE for ; Sun, 27 Dec 2020 09:50:54 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 87525B8 for ; Sun, 27 Dec 2020 09:50:52 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1609062572.74c82761ee2b2145fc03019edb187869f6856a38.grobian@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcxx/, profiles/prefix/darwin/macos/ X-VCS-Repository: repo/gentoo X-VCS-Files: profiles/prefix/darwin/macos/package.use.force sys-libs/libcxx/libcxx-11.0.0.ebuild sys-libs/libcxx/libcxx-11.0.1.9999.ebuild sys-libs/libcxx/libcxx-11.0.1_rc1.ebuild sys-libs/libcxx/libcxx-11.0.1_rc2.ebuild sys-libs/libcxx/libcxx-12.0.0.9999.ebuild X-VCS-Directories: profiles/prefix/darwin/macos/ sys-libs/libcxx/ X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 74c82761ee2b2145fc03019edb187869f6856a38 X-VCS-Branch: master Date: Sun, 27 Dec 2020 09:50:52 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 7fe0ed01-ec24-4f1f-a1ec-8b5c4f3b9662 X-Archives-Hash: fd3473b1513255e21872fd281424653c commit: 74c82761ee2b2145fc03019edb187869f6856a38 Author: Jacob Floyd gmail com> AuthorDate: Sun Dec 20 21:46:30 2020 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Sun Dec 27 09:49:32 2020 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=74c82761 sys-libs/libcxx: fix prefix bootstrap When bootstrapping prefix on darwin, libcxx must be installed before llvm is built during stage2 (in EPREFIX/tmp) and during stage3 (in EPREFIX). llvm_pkg_setup, however, identifies the *installed* llvm to set environment variables with the correct path to llvm. Since llvm is not installed, we have to skip that step. But during bootstrap, we don't need those environment vars to be modified anyway because bootstrap-prefix.sh already sets them with the paths to the correct llvm (which is the host's llm during stage2 and the EPREFIX/tmp llvm during stage3). Once stage3 is complete, llvm is installed in EPREFIX, so the system rebuild (with `emerge -e system`) will successfully use llvm_pkg_setup. bootstrap-prefix.sh is no longer controlling the vars at that point, so it is important to allow llvm_pkg_setup to correctly modify the vars. Other required fixes include: - eprefrixify some dylib paths in CMakeLists.txt (dylib is only used on darwin, so this is not an issue when compiling on other platforms). - ensure want_gcc_s is OFF even if use=-libunwind on darwin - keyword with ~x64-macos Bug: https://bugs.gentoo.org/758167 Signed-off-by: Jacob Floyd gmail.com> Signed-off-by: Fabian Groffen gentoo.org> profiles/prefix/darwin/macos/package.use.force | 4 ++++ sys-libs/libcxx/libcxx-11.0.0.ebuild | 27 ++++++++++++++++++++++---- sys-libs/libcxx/libcxx-11.0.1.9999.ebuild | 25 +++++++++++++++++++++--- sys-libs/libcxx/libcxx-11.0.1_rc1.ebuild | 25 +++++++++++++++++++++--- sys-libs/libcxx/libcxx-11.0.1_rc2.ebuild | 25 +++++++++++++++++++++--- sys-libs/libcxx/libcxx-12.0.0.9999.ebuild | 25 +++++++++++++++++++++--- 6 files changed, 115 insertions(+), 16 deletions(-) diff --git a/profiles/prefix/darwin/macos/package.use.force b/profiles/prefix/darwin/macos/package.use.force index 4b4798eb7ee..c1677ba9252 100644 --- a/profiles/prefix/darwin/macos/package.use.force +++ b/profiles/prefix/darwin/macos/package.use.force @@ -21,3 +21,7 @@ media-gfx/tachyon threads opengl # Elias Pipping (2007-11-29) # won't compile without media-libs/libsdl opengl + +# Jacob Floyd (2020-12-20) +# Make sure we always use libcxxabi on macos prefix +sys-libs/libcxx libcxxabi diff --git a/sys-libs/libcxx/libcxx-11.0.0.ebuild b/sys-libs/libcxx/libcxx-11.0.0.ebuild index d4ba5210700..cb077d76d64 100644 --- a/sys-libs/libcxx/libcxx-11.0.0.ebuild +++ b/sys-libs/libcxx/libcxx-11.0.0.ebuild @@ -14,7 +14,7 @@ llvm.org_set_globals LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" SLOT="0" -KEYWORDS="amd64 arm arm64 ~riscv x86" +KEYWORDS="amd64 arm arm64 ~riscv x86 ~x64-macos" IUSE="elibc_glibc elibc_musl +libcxxabi +libunwind +static-libs test" REQUIRED_USE="libunwind? ( libcxxabi )" RESTRICT="!test? ( test )" @@ -41,7 +41,11 @@ python_check_deps() { } pkg_setup() { - llvm_pkg_setup + # darwin prefix builds do not have llvm installed yet, so rely on bootstrap-prefix + # to set the appropriate path vars to LLVM instead of using llvm_pkg_setup. + if [[ ${CHOST} != *-darwin* ]] || has_version dev-lang/llvm; then + llvm_pkg_setup + fi use test && python-any-r1_pkg_setup if ! use libcxxabi && ! tc-is-gcc ; then @@ -58,6 +62,10 @@ src_prepare() { eapply "${FILESDIR}/${PN}-3.9-cmake-link-flags.patch" llvm.org_src_prepare + + # eprefixify static path references to libc++abi for symbol re-export to + # avoid linking against it twice in both /usr/lib and ${EPREFIX}/usr/lib + sed -i -e "s^/usr/lib/libc++abi.dylib^${EPREFIX}&^g" lib/CMakeLists.txt || die } test_compiler() { @@ -99,6 +107,15 @@ multilib_src_configure() { extra_libs+=( "${compiler_rt}" ) fi fi + elif [[ ${CHOST} == *-darwin* ]] && tc-is-clang; then + # clang-based darwin prefix disables libunwind useflag during + # bootstrap, because libunwind is not in the prefix yet. + # override the default, though, because clang based libcxx + # should never use gcc_s on Darwin. + want_gcc_s=OFF + # compiler_rt is not available in EPREFIX during bootstrap, + # so we cannot link to it yet anyway, so keep the defaults + # of want_compiler_rt=OFF and extra_libs=() fi # bootstrap: cmake is unhappy if compiler can't link to stdlib @@ -188,8 +205,10 @@ gen_shared_ldscript() { multilib_src_install() { cmake_src_install - gen_shared_ldscript - use static-libs && gen_static_ldscript + if [[ ${CHOST} != *-darwin* ]] ; then + gen_shared_ldscript + use static-libs && gen_static_ldscript + fi } pkg_postinst() { diff --git a/sys-libs/libcxx/libcxx-11.0.1.9999.ebuild b/sys-libs/libcxx/libcxx-11.0.1.9999.ebuild index dd1a1a1f3a2..8d2f6ea8621 100644 --- a/sys-libs/libcxx/libcxx-11.0.1.9999.ebuild +++ b/sys-libs/libcxx/libcxx-11.0.1.9999.ebuild @@ -42,7 +42,11 @@ python_check_deps() { } pkg_setup() { - llvm_pkg_setup + # darwin prefix builds do not have llvm installed yet, so rely on bootstrap-prefix + # to set the appropriate path vars to LLVM instead of using llvm_pkg_setup. + if [[ ${CHOST} != *-darwin* ]] || has_version dev-lang/llvm; then + llvm_pkg_setup + fi use test && python-any-r1_pkg_setup if ! use libcxxabi && ! tc-is-gcc ; then @@ -59,6 +63,10 @@ src_prepare() { eapply "${FILESDIR}/${PN}-3.9-cmake-link-flags.patch" llvm.org_src_prepare + + # eprefixify static path references to libc++abi for symbol re-export to + # avoid linking against it twice in both /usr/lib and ${EPREFIX}/usr/lib + sed -i -e "s^/usr/lib/libc++abi.dylib^${EPREFIX}&^g" lib/CMakeLists.txt || die } test_compiler() { @@ -100,6 +108,15 @@ multilib_src_configure() { extra_libs+=( "${compiler_rt}" ) fi fi + elif [[ ${CHOST} == *-darwin* ]] && tc-is-clang; then + # clang-based darwin prefix disables libunwind useflag during + # bootstrap, because libunwind is not in the prefix yet. + # override the default, though, because clang based libcxx + # should never use gcc_s on Darwin. + want_gcc_s=OFF + # compiler_rt is not available in EPREFIX during bootstrap, + # so we cannot link to it yet anyway, so keep the defaults + # of want_compiler_rt=OFF and extra_libs=() fi # bootstrap: cmake is unhappy if compiler can't link to stdlib @@ -189,8 +206,10 @@ gen_shared_ldscript() { multilib_src_install() { cmake_src_install - gen_shared_ldscript - use static-libs && gen_static_ldscript + if [[ ${CHOST} != *-darwin* ]] ; then + gen_shared_ldscript + use static-libs && gen_static_ldscript + fi } pkg_postinst() { diff --git a/sys-libs/libcxx/libcxx-11.0.1_rc1.ebuild b/sys-libs/libcxx/libcxx-11.0.1_rc1.ebuild index dd1a1a1f3a2..8d2f6ea8621 100644 --- a/sys-libs/libcxx/libcxx-11.0.1_rc1.ebuild +++ b/sys-libs/libcxx/libcxx-11.0.1_rc1.ebuild @@ -42,7 +42,11 @@ python_check_deps() { } pkg_setup() { - llvm_pkg_setup + # darwin prefix builds do not have llvm installed yet, so rely on bootstrap-prefix + # to set the appropriate path vars to LLVM instead of using llvm_pkg_setup. + if [[ ${CHOST} != *-darwin* ]] || has_version dev-lang/llvm; then + llvm_pkg_setup + fi use test && python-any-r1_pkg_setup if ! use libcxxabi && ! tc-is-gcc ; then @@ -59,6 +63,10 @@ src_prepare() { eapply "${FILESDIR}/${PN}-3.9-cmake-link-flags.patch" llvm.org_src_prepare + + # eprefixify static path references to libc++abi for symbol re-export to + # avoid linking against it twice in both /usr/lib and ${EPREFIX}/usr/lib + sed -i -e "s^/usr/lib/libc++abi.dylib^${EPREFIX}&^g" lib/CMakeLists.txt || die } test_compiler() { @@ -100,6 +108,15 @@ multilib_src_configure() { extra_libs+=( "${compiler_rt}" ) fi fi + elif [[ ${CHOST} == *-darwin* ]] && tc-is-clang; then + # clang-based darwin prefix disables libunwind useflag during + # bootstrap, because libunwind is not in the prefix yet. + # override the default, though, because clang based libcxx + # should never use gcc_s on Darwin. + want_gcc_s=OFF + # compiler_rt is not available in EPREFIX during bootstrap, + # so we cannot link to it yet anyway, so keep the defaults + # of want_compiler_rt=OFF and extra_libs=() fi # bootstrap: cmake is unhappy if compiler can't link to stdlib @@ -189,8 +206,10 @@ gen_shared_ldscript() { multilib_src_install() { cmake_src_install - gen_shared_ldscript - use static-libs && gen_static_ldscript + if [[ ${CHOST} != *-darwin* ]] ; then + gen_shared_ldscript + use static-libs && gen_static_ldscript + fi } pkg_postinst() { diff --git a/sys-libs/libcxx/libcxx-11.0.1_rc2.ebuild b/sys-libs/libcxx/libcxx-11.0.1_rc2.ebuild index dd1a1a1f3a2..8d2f6ea8621 100644 --- a/sys-libs/libcxx/libcxx-11.0.1_rc2.ebuild +++ b/sys-libs/libcxx/libcxx-11.0.1_rc2.ebuild @@ -42,7 +42,11 @@ python_check_deps() { } pkg_setup() { - llvm_pkg_setup + # darwin prefix builds do not have llvm installed yet, so rely on bootstrap-prefix + # to set the appropriate path vars to LLVM instead of using llvm_pkg_setup. + if [[ ${CHOST} != *-darwin* ]] || has_version dev-lang/llvm; then + llvm_pkg_setup + fi use test && python-any-r1_pkg_setup if ! use libcxxabi && ! tc-is-gcc ; then @@ -59,6 +63,10 @@ src_prepare() { eapply "${FILESDIR}/${PN}-3.9-cmake-link-flags.patch" llvm.org_src_prepare + + # eprefixify static path references to libc++abi for symbol re-export to + # avoid linking against it twice in both /usr/lib and ${EPREFIX}/usr/lib + sed -i -e "s^/usr/lib/libc++abi.dylib^${EPREFIX}&^g" lib/CMakeLists.txt || die } test_compiler() { @@ -100,6 +108,15 @@ multilib_src_configure() { extra_libs+=( "${compiler_rt}" ) fi fi + elif [[ ${CHOST} == *-darwin* ]] && tc-is-clang; then + # clang-based darwin prefix disables libunwind useflag during + # bootstrap, because libunwind is not in the prefix yet. + # override the default, though, because clang based libcxx + # should never use gcc_s on Darwin. + want_gcc_s=OFF + # compiler_rt is not available in EPREFIX during bootstrap, + # so we cannot link to it yet anyway, so keep the defaults + # of want_compiler_rt=OFF and extra_libs=() fi # bootstrap: cmake is unhappy if compiler can't link to stdlib @@ -189,8 +206,10 @@ gen_shared_ldscript() { multilib_src_install() { cmake_src_install - gen_shared_ldscript - use static-libs && gen_static_ldscript + if [[ ${CHOST} != *-darwin* ]] ; then + gen_shared_ldscript + use static-libs && gen_static_ldscript + fi } pkg_postinst() { diff --git a/sys-libs/libcxx/libcxx-12.0.0.9999.ebuild b/sys-libs/libcxx/libcxx-12.0.0.9999.ebuild index dd1a1a1f3a2..8d2f6ea8621 100644 --- a/sys-libs/libcxx/libcxx-12.0.0.9999.ebuild +++ b/sys-libs/libcxx/libcxx-12.0.0.9999.ebuild @@ -42,7 +42,11 @@ python_check_deps() { } pkg_setup() { - llvm_pkg_setup + # darwin prefix builds do not have llvm installed yet, so rely on bootstrap-prefix + # to set the appropriate path vars to LLVM instead of using llvm_pkg_setup. + if [[ ${CHOST} != *-darwin* ]] || has_version dev-lang/llvm; then + llvm_pkg_setup + fi use test && python-any-r1_pkg_setup if ! use libcxxabi && ! tc-is-gcc ; then @@ -59,6 +63,10 @@ src_prepare() { eapply "${FILESDIR}/${PN}-3.9-cmake-link-flags.patch" llvm.org_src_prepare + + # eprefixify static path references to libc++abi for symbol re-export to + # avoid linking against it twice in both /usr/lib and ${EPREFIX}/usr/lib + sed -i -e "s^/usr/lib/libc++abi.dylib^${EPREFIX}&^g" lib/CMakeLists.txt || die } test_compiler() { @@ -100,6 +108,15 @@ multilib_src_configure() { extra_libs+=( "${compiler_rt}" ) fi fi + elif [[ ${CHOST} == *-darwin* ]] && tc-is-clang; then + # clang-based darwin prefix disables libunwind useflag during + # bootstrap, because libunwind is not in the prefix yet. + # override the default, though, because clang based libcxx + # should never use gcc_s on Darwin. + want_gcc_s=OFF + # compiler_rt is not available in EPREFIX during bootstrap, + # so we cannot link to it yet anyway, so keep the defaults + # of want_compiler_rt=OFF and extra_libs=() fi # bootstrap: cmake is unhappy if compiler can't link to stdlib @@ -189,8 +206,10 @@ gen_shared_ldscript() { multilib_src_install() { cmake_src_install - gen_shared_ldscript - use static-libs && gen_static_ldscript + if [[ ${CHOST} != *-darwin* ]] ; then + gen_shared_ldscript + use static-libs && gen_static_ldscript + fi } pkg_postinst() {