commit:     84f34557e19b9cce392e412b6957628083c0f241
Author:     Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Sat May 28 10:12:07 2016 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Fri Jun 10 01:47:29 2016 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=84f34557

scripts/bootstrap-prefix.sh: stage3 ld should link to stage2 zlib.

  zlib should not get rpath encoded

 scripts/bootstrap-prefix.sh | 77 ++++++++++++++++++++++++++++++++-------------
 1 file changed, 55 insertions(+), 22 deletions(-)

diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index 0d209b2..108723c 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -1353,38 +1353,71 @@ bootstrap_stage3() {
                fi
        fi
 
-       configure_toolchain || return 1
-       export CONFIG_SHELL="${ROOT}"/tmp/bin/bash
-       export CPPFLAGS="-I${ROOT}/usr/include"
-       export LDFLAGS="-L${ROOT}/usr/$(get_libdir)"
-       unset CC CXX
-
        emerge_pkgs() {
                EPREFIX="${ROOT}" \
                do_emerge_pkgs "$@"
        }
 
-       # GCC sometimes decides that it needs to run makeinfo to update some
-       # info pages from .texi files.  Obviously we don't care at this
-       # stage and rather have it continue instead of abort the build
-       export MAKEINFO="echo makeinfo GNU texinfo 4.13"
-       
-       # Build a native compiler.
+       configure_toolchain || return 1
+       export CONFIG_SHELL="${ROOT}"/tmp/bin/bash
+
+       # binutils cannot link against zlib in EPREFIX because
+       # later ld's host DL cannot load refreshed zlib with
+       # new glibc symbols.  It cannot link against host zlib
+       # either because it might be too old.  Therefore it
+       # can only be linked against stage2 zlib.
+       configure_cflags
        pkgs=(
-               $([[ ${CHOST} == *-aix* ]] && echo dev-libs/libiconv ) # bash 
dependency
-               sys-libs/ncurses
-               sys-libs/readline
-               app-shells/bash
-               sys-apps/sed
-               app-arch/xz-utils
+               sys-apps/baselayout
                sys-apps/gentoo-functions
-               sys-apps/baselayout-prefix
-               sys-devel/m4
-               sys-devel/flex
                sys-devel/binutils-config
-               sys-libs/zlib
                ${linker}
        )
+       is-rap && emerge_pkgs --nodeps "${pkgs[@]}" || return 1
+
+       export CPPFLAGS="-I${ROOT}/usr/include"
+       export LDFLAGS="-L${ROOT}/usr/$(get_libdir)"
+       unset CC CXX
+
+       # GCC sometimes decides that it needs to run makeinfo to update some
+       # info pages from .texi files.  Obviously we don't care at this
+       # stage and rather have it continue instead of abort the build
+       [[ -x "${ROOT}"/usr/bin/makeinfo ]] || cat > "${ROOT}"/usr/bin/makeinfo 
<<EOF
+#!${ROOT}/bin/bash
+echo "makeinfo GNU texinfo 4.13"
+for a in \$@; do
+case \$a in
+--*) f=\$(echo "\$a" | sed -r 's,--.*=(.*),\1,') ;;
+-*) ;;
+*) f=\$a ;;
+esac
+[[ -e \$f ]] || touch \$f
+done
+EOF
+       chmod +x "${ROOT}"/usr/bin/makeinfo
+       export INSTALL_INFO="${ROOT}"/usr/bin/makeinfo
+
+       if is-rap ; then
+               # zlib is needed by cc1 of gcc and has to be installed
+               # before glibc
+               pkgs=( sys-libs/zlib )
+       else
+               pkgs=(
+                       $([[ ${CHOST} == *-aix* ]] && echo dev-libs/libiconv ) 
# bash dependency
+                       sys-libs/ncurses
+                       sys-libs/readline
+                       app-shells/bash
+                       sys-apps/sed
+                       app-arch/xz-utils
+                       sys-apps/gentoo-functions
+                       sys-apps/baselayout-prefix
+                       sys-devel/m4
+                       sys-devel/flex
+                       sys-devel/binutils-config
+                       sys-libs/zlib
+                       ${linker}
+               )
+       fi
        emerge_pkgs --nodeps "${pkgs[@]}" || return 1
 
        if is-rap ; then

Reply via email to