commit:     f7735b2d87b2e510098235c1cadc00a62818ddf5
Author:     Jacob Floyd <cognifloyd <AT> gmail <DOT> com>
AuthorDate: Thu Dec 31 17:49:04 2020 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Thu Dec 31 17:49:04 2020 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=f7735b2d

scripts/bootstrap-prefix: properly deal with libcxx with clang

- libunwind is not available yet, and has more deps than we care to deal
  with, so just compile libcxx without libunwind in stage2 & stage3
- llvm and clang need to be built with the same libc++. If you don't
  build with the same libc++ then you get weird errors where comparing
  std::error_code's fails because llvm has one errc enum, and clang has
  a different one.

Bug: https://bugs.gentoo.org/758167
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 scripts/bootstrap-prefix.sh | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index fd8a343dae..8dae1b5944 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -234,10 +234,11 @@ configure_toolchain() {
                                        mycc=clang
                                        compiler_stage1+="
                                                ${llvm_deps}
+                                               sys-libs/libcxxabi
+                                               sys-libs/libcxx
                                                sys-devel/llvm
                                                sys-devel/clang
-                                               sys-libs/libcxxabi
-                                               sys-libs/libcxx"
+                                       "
                                        CC=clang
                                        CXX=clang++
                                        # avoid going through hoops and deps for
@@ -262,10 +263,11 @@ configure_toolchain() {
                                                        mycc=clang
                                                        compiler_stage1+="
                                                                ${llvm_deps}
+                                                               
sys-libs/libcxxabi
+                                                               sys-libs/libcxx
                                                                sys-devel/llvm
                                                                sys-devel/clang
-                                                               
sys-libs/libcxxabi
-                                                               sys-libs/libcxx"
+                                                       "
                                                        ;;
                                        esac
                                        CC=clang
@@ -289,10 +291,10 @@ configure_toolchain() {
                                local cdep="3.5.9999"
                                compiler_stage1+="
                                        dev-libs/libffi
-                                       <sys-devel/llvm-${cdep}
                                        <sys-libs/libcxx-headers-${cdep}
                                        <sys-libs/libcxxabi-${cdep}
                                        <sys-libs/libcxx-${cdep}
+                                       <sys-devel/llvm-${cdep}
                                        <sys-devel/clang-${cdep}"
                        fi
 
@@ -541,6 +543,9 @@ bootstrap_setup() {
        # Use package.use to disable in the portage tree to be shared between
        # stage2 and stage3. The hack will be undone during tree sync in stage3.
        cat >> "${ROOT}"/etc/portage/make.profile/package.use <<-EOF
+       # disable bootstrapping libcxx* with libunwind
+       sys-libs/libcxxabi -libunwind
+       sys-libs/libcxx -libunwind
        # Most binary Linux distributions seem to fancy toolchains that
        # do not do c++ support (need to install a separate package).
        sys-libs/ncurses -cxx

Reply via email to