public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/proj/prefix:script-rap commit in: scripts/
@ 2016-05-27 10:53 Benda XU
  0 siblings, 0 replies; 11+ messages in thread
From: Benda XU @ 2016-05-27 10:53 UTC (permalink / raw
  To: gentoo-commits

commit:     eb97b1ce2322d18a749aaf958f227a2c3f8cdf20
Author:     Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Mon May 23 10:14:33 2016 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Thu May 26 13:55:41 2016 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=eb97b1ce

scripts/bootstrap-prefix.sh: setup android overlay as staged RAP repo.

  setup name databases.

 scripts/bootstrap-prefix.sh | 35 ++++++++++++++++++++++++++++++++++-
 1 file changed, 34 insertions(+), 1 deletion(-)

diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index 4c2c892..86056e6 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -234,6 +234,33 @@ bootstrap_setup() {
 		} > "${ROOT}"/etc/portage/make.conf
 	fi
 
+	if is-rap && [[ ! -f ${ROOT}/etc/portage/repos.conf ]] ; then
+		cat <<EOF >"${ROOT}"/etc/portage/repos.conf
+[DEFAULT]
+main-repo = gentoo
+eclass-overrides = rap
+
+[gentoo]
+location = ${ROOT}/usr/portage
+sync-type = rsync
+sync-uri = rsync://rsync.gentoo.org/gentoo-portage
+
+[rap]
+location = ${ROOT}/usr/portage-stage
+sync-type = webrsync
+sync-uri = https://gitweb.gentoo.org/proj/android.git/snapshot/android-master.tar.bz2
+EOF
+	fi
+
+	if is-rap ; then
+		[[ -f ${ROOT}/etc/passwd ]] || getent passwd > "${ROOT}"/etc/passwd || \
+			ln -sf {,"${ROOT}"}/etc/passwd
+		[[ -f ${ROOT}/etc/group ]] || getent group > "${ROOT}"/etc/group || \
+			ln -sf {,"${ROOT}"}/etc/group
+		[[ -f ${ROOT}/etc/resolv.conf ]] || ln -s {,"${ROOT}"}/etc/resolv.conf
+		[[ -f ${ROOT}/etc/hosts ]] || ln -s {,"${ROOT}"}/etc/hosts
+	fi
+
 	local linux=$(rapx linux-standalone linux)
 	
 	case ${CHOST} in
@@ -415,6 +442,10 @@ bootstrap_tree() {
 	else
 		do_tree http://dev.gentoo.org/~grobian/distfiles prefix-overlay-${PV}.tar.bz2
 	fi
+	if is-rap; then
+		PORTDIR="${ROOT}/usr/portage-stage" \
+		       do_tree https://gitweb.gentoo.org/proj/android.git/snapshot android-master.tar.bz2
+	fi
 }
 
 bootstrap_startscript() {
@@ -524,7 +555,9 @@ bootstrap_portage() {
 
 	[[ -e "${ROOT}"/tmp/usr/portage ]] || ln -s "${PORTDIR}" "${ROOT}"/tmp/usr/portage
 
-	if [[ -s ${PORTDIR}/profiles/repo_name ]]; then
+	if is-rap; then
+		cp -f "${ROOT}"/etc/portage/repos.conf "${ROOT}"/tmp/usr/share/portage/config/repos.conf
+	elif [[ -s ${PORTDIR}/profiles/repo_name ]]; then
 		# sync portage's repos.conf with the tree being used
 		sed -i -e "s,gentoo_prefix,$(<"${PORTDIR}"/profiles/repo_name)," "${ROOT}"/tmp/usr/share/portage/config/repos.conf || return 1
 	fi


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/proj/prefix:script-rap commit in: scripts/
@ 2016-05-27 10:53 Benda XU
  0 siblings, 0 replies; 11+ messages in thread
From: Benda XU @ 2016-05-27 10:53 UTC (permalink / raw
  To: gentoo-commits

commit:     499248ea415abdb6b171138a57e343bd779bafa2
Author:     Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Thu May 26 07:06:09 2016 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Thu May 26 13:55:41 2016 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=499248ea

bootstrap-prefix.sh: no USR SPLIT for RAP.  Support Debian multiarch.

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

diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index 63451ce..9990e41 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -225,7 +225,7 @@ bootstrap_setup() {
 			echo "CONFIG_SHELL=\"${ROOT}/bin/bash\""
 			rapx "# sandbox does not work well on Prefix, bug 490246"
 			rapx 'FEATURES="-usersandbox -sandbox"'
-			if [[ -n ${PREFIX_DISABLE_USR_SPLIT} ]] ; then
+			if [[ !is-rap && -n ${PREFIX_DISABLE_USR_SPLIT} ]] ; then
 				echo
 				echo "# This disables /usr-split, removing this will break"
 				echo "PREFIX_DISABLE_GEN_USR_LDSCRIPT=yes"
@@ -1476,83 +1476,11 @@ bootstrap_interactive() {
 	# eventually ends up in make.conf, see the end of stage3.  We don't
 	# do this in bootstrap_setup() because in that case we'd also have
 	# to cater for getting this right with manual bootstraps.
-	export PREFIX_DISABLE_USR_SPLIT=yes 
+	is-rap || export PREFIX_DISABLE_USR_SPLIT=yes
 
-	# immediately die on platforms that we know are impossible due to
-	# brain-deadness (Debian/Ubuntu) or extremely hard dependency chains
-	# (TODO NetBSD/OpenBSD)
-	case ${CHOST} in
-		*-linux-gnu)
-			local toolchain_impossible=
-			# Figure out if this is Ubuntu...
-			if [[ $(lsb_release -is 2>/dev/null) == "Ubuntu" ]] ; then
-				case "$(lsb_release -sr)" in
-					[456789].*|10.*)
-						: # good versions
-						;;
-					*)
-						# Debian/Ubuntu have seriously fscked up their
-						# toolchain to support their multi-arch crap
-						# since Natty (11.04) that noone really wants,
-						# and certainly not upstream.  Some details:
-						# https://bugs.launchpad.net/ubuntu/+source/binutils/+bug/738098
-						toolchain_impossible="Ubuntu >= 11.04 (Natty)"
-						;;
-				esac
-			fi
-			# Figure out if this is Debian
-			if [[ -e /etc/debian_release ]] ; then
-				case "$(< /etc/debian_release)" in
-					hamm/*|slink/*|potato/*|woody/*|sarge/*|etch/*|lenny/*|squeeze/*)
-						: # good versions
-						;;
-					*)
-						# Debian introduced their big crap since Wheezy
-						# (7.0), like for Ubuntu, see above
-						toolchain_impossible="Debian >= 7.0 (Wheezy)"
-						;;
-				esac
-			fi
-			if [[ -n ${toolchain_impossible} ]] ; then
-				# In short, it's impossible for us to compile a
-				# compiler, since 1) gcc picks up our ld, which doesn't
-				# support sysroot (can work around with a wrapper
-				# script), 2) headers and libs aren't found (symlink
-				# them to Prefix), 3) stuff like crtX.i isn't found
-				# during bootstrap, since the bootstrap compiler doesn't
-				# get any of our flags and doesn't know where to find
-				# them (even if we copied them).  So we cannot do this,
-				# unless we use the Ubuntu patches in our ebuilds, which
-				# is a NO-GO area.
-				cat << EOF
-Oh My!  ${toolchain_impossible}!  AAAAAAAAAAAAAAAAAAAAARGH!  HELL comes over me!
-
-EOF
-				echo -n "..."
-				sleep 1
-				echo -n "."
-				sleep 1
-				echo -n "."
-				sleep 1
-				echo -n "."
-				sleep 1
-				echo
-				echo
-				cat << EOF
-and over you.  You're on the worst Linux distribution from a developer's
-(and so Gentoo Prefix) perspective since http://wiki.debian.org/Multiarch/.
-Due to this multi-arch idea, it is IMPOSSIBLE for Gentoo Prefix to
-bootstrap a compiler without using Debuntu patches, which is an absolute
-NO-GO area!  GCC and binutils upstreams didn't just reject those patches
-for fun.
-
-I really can't help you, and won't waste any of your time either.  The
-story simply ends here.  Sorry.
-EOF
-				exit 1
-			fi
-			;;
-	esac
+	# TODO should immediately die on platforms that we know are
+	# impossible due extremely hard dependency chains
+	# (NetBSD/OpenBSD)
 
 	cat <<"EOF"
 


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/proj/prefix:script-rap commit in: scripts/
@ 2016-05-27 10:53 Benda XU
  0 siblings, 0 replies; 11+ messages in thread
From: Benda XU @ 2016-05-27 10:53 UTC (permalink / raw
  To: gentoo-commits

commit:     20607806e796c35f2e44c2cdba59f313abd41ef4
Author:     Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Thu May 26 02:46:25 2016 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Thu May 26 13:55:41 2016 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=20607806

scripts/bootstrap-prefix.sh: disable sandbox.

 scripts/bootstrap-prefix.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index 88f24f3..63451ce 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -223,6 +223,8 @@ bootstrap_setup() {
 			echo 'CXXFLAGS="${CFLAGS}"'
 			echo "MAKEOPTS=\"${MAKEOPTS}\""
 			echo "CONFIG_SHELL=\"${ROOT}/bin/bash\""
+			rapx "# sandbox does not work well on Prefix, bug 490246"
+			rapx 'FEATURES="-usersandbox -sandbox"'
 			if [[ -n ${PREFIX_DISABLE_USR_SPLIT} ]] ; then
 				echo
 				echo "# This disables /usr-split, removing this will break"


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/proj/prefix:script-rap commit in: scripts/
@ 2016-05-27 10:53 Benda XU
  0 siblings, 0 replies; 11+ messages in thread
From: Benda XU @ 2016-05-27 10:53 UTC (permalink / raw
  To: gentoo-commits

commit:     2e5a7a84af53d3704290adfe5273f60ff5116180
Author:     Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Thu May 26 09:41:35 2016 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Fri May 27 07:45:09 2016 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=2e5a7a84

bootstrap-prefix.sh: get_libdir for multilib support on RAP.

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

diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index 9990e41..f3d13f8 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -9,6 +9,7 @@ eerror() { echo "!!! $*" 1>&2; }
 einfo() { echo "* $*"; }
 is-rap() { [[ ${BASH_SOURCE} = *rap.sh ]]; }
 rapx() { is-rap && echo $1 || echo $2; }
+get_libdir() { portageq envvar LIBDIR_$(portageq envvar ABI); }
 
 # prefer gtar over tar
 [[ x$(type -t gtar) == "xfile" ]] \
@@ -124,7 +125,7 @@ configure_cflags() {
 			export LDFLAGS="-L${ROOT}/tmp/usr/lib"
 			;;
 		*)
-			export LDFLAGS="-L${ROOT}/tmp/usr/lib -Wl,-rpath=${ROOT}/tmp/usr/lib"
+			export LDFLAGS="-L${ROOT}/tmp/usr/$(get_libdir) -Wl,-rpath=${ROOT}/tmp/usr/$(get_libdir)"
 			;;
 	esac
 
@@ -407,7 +408,7 @@ EOF
 
 do_tree() {
 	local x
-	for x in etc{,/portage} usr/{{,s}bin,lib} var/tmp var/lib/portage var/log/portage var/db;
+	for x in etc{,/portage} usr/{{,s}bin,$(rapx "" lib)} var/tmp var/lib/portage var/log/portage var/db;
 	do
 		[[ -d ${ROOT}/${x} ]] || mkdir -p "${ROOT}/${x}"
 	done
@@ -423,7 +424,7 @@ do_tree() {
 			[[ -e ${ROOT}/${x} ]] || ( cd "${ROOT}" && ln -s usr/${x} )
 		done
 	else
-		for x in lib sbin ; do
+		for x in $(rapx "" lib) sbin ; do
 			[[ -d ${ROOT}/${x} ]] || mkdir -p "${ROOT}/${x}"
 		done
 	fi
@@ -531,6 +532,7 @@ bootstrap_portage() {
 	[[ -x ${ROOT}/tmp/bin/bash ]] || [[ ! -x ${ROOT}/tmp/usr/bin/bash ]] || ln -s ../usr/bin/bash "${ROOT}"/tmp/bin/bash || return 1
 	[[ -x ${ROOT}/tmp/bin/bash ]] || ln -s "${BASH}" "${ROOT}"/tmp/bin/bash || return 1
 	[[ -x ${ROOT}/tmp/bin/sh ]] || ln -s bash "${ROOT}"/tmp/bin/sh || return 1
+	[[ -x ${ROOT}/bin/bash ]] || ln -s ../tmp/bin/bash "${ROOT}"/bin/bash || return 1
 	[[ -x ${ROOT}/bin/sh ]] || ln -s ../tmp/bin/sh "${ROOT}"/bin/sh || return 1
 	export PORTAGE_BASH="${ROOT}"/tmp/bin/bash
 
@@ -1335,7 +1337,7 @@ bootstrap_stage3() {
 	configure_toolchain || return 1
 	export CONFIG_SHELL="${ROOT}"/tmp/bin/bash
 	export CPPFLAGS="-I${ROOT}/usr/include"
-	export LDFLAGS="-L${ROOT}/usr/lib"
+	export LDFLAGS="-L${ROOT}/usr/$(get_libdir)"
 	unset CC CXX
 
 	emerge_pkgs() {


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/proj/prefix:script-rap commit in: scripts/
@ 2016-05-27 10:53 Benda XU
  0 siblings, 0 replies; 11+ messages in thread
From: Benda XU @ 2016-05-27 10:53 UTC (permalink / raw
  To: gentoo-commits

commit:     bd463298664bc02e58daa67c98bdd33c572be6b7
Author:     Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Mon May 23 10:46:14 2016 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Thu May 26 13:55:41 2016 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=bd463298

scripts/bootstrap-prefix.sh: USE=-acl for linux-standalone.

  Its profile does not mask acl.

 scripts/bootstrap-prefix.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index 86056e6..4b86519 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -1162,6 +1162,7 @@ do_emerge_pkgs() {
 		[[ -n ${pvdb} ]] && continue
 
 		local myuse=(
+			-acl
 			-berkdb
 			-fortran
 			-gdbm


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/proj/prefix:script-rap commit in: scripts/
@ 2016-05-27 10:53 Benda XU
  0 siblings, 0 replies; 11+ messages in thread
From: Benda XU @ 2016-05-27 10:53 UTC (permalink / raw
  To: gentoo-commits

commit:     d0ec5fbc4f6ec72495c65fea8fa0f05aa7ad6791
Author:     Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Thu May 26 09:49:05 2016 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Thu May 26 13:55:41 2016 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=d0ec5fbc

scripts/bootstrap-prefix.sh: emacs local setup for the code standard.

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

diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index 30d3b29..4c2c892 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -2442,3 +2442,8 @@ fi
 einfo "ready to bootstrap ${TODO}"
 # bootstrap_interactive proceeds with guessed defaults when TODO=noninteractive
 bootstrap_${TODO#non} || exit 1
+
+# Local Variables:
+# sh-indentation: 8
+# sh-basic-offset: 8
+# End:


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/proj/prefix:script-rap commit in: scripts/
@ 2016-05-27 10:53 Benda XU
  0 siblings, 0 replies; 11+ messages in thread
From: Benda XU @ 2016-05-27 10:53 UTC (permalink / raw
  To: gentoo-commits

commit:     9a6d95bd9b65158040873f6e3e9e4eed055b0ad4
Author:     Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Thu May 26 09:48:19 2016 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Thu May 26 13:55:41 2016 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=9a6d95bd

scripts/bootstrap-prefix.sh: rap helpers for profiles and portage tree.

 scripts/bootstrap-prefix.sh | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index e5ad6b6..30d3b29 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -7,6 +7,8 @@ trap 'exit 1' TERM KILL INT QUIT ABRT
 # some basic output functions
 eerror() { echo "!!! $*" 1>&2; }
 einfo() { echo "* $*"; }
+is-rap() { [[ ${BASH_SOURCE} = *rap.sh ]]; }
+rapx() { is-rap && echo $1 || echo $2; }
 
 # prefer gtar over tar
 [[ x$(type -t gtar) == "xfile" ]] \
@@ -231,6 +233,8 @@ bootstrap_setup() {
 				echo 'FETCHCOMMAND="bash -c \"echo I need \${FILE} from \${URI} in \${DISTDIR}; read\""'
 		} > "${ROOT}"/etc/portage/make.conf
 	fi
+
+	local linux=$(rapx linux-standalone linux)
 	
 	case ${CHOST} in
 		powerpc-apple-darwin7)
@@ -257,22 +261,22 @@ bootstrap_setup() {
 			profile="prefix/darwin/macos/10.$((rev - 4))/x64"
 			;;
 		i*86-pc-linux-gnu)
-			profile="prefix/linux/x86"
+			profile="prefix/${linux}/x86"
 			;;
 		x86_64-pc-linux-gnu)
-			profile="prefix/linux/amd64"
+			profile="prefix/${linux}/amd64"
 			;;
 		ia64-pc-linux-gnu)
-			profile="prefix/linux/ia64"
+			profile="prefix/${linux}/ia64"
 			;;
 		powerpc-unknown-linux-gnu)
-			profile="prefix/linux/ppc"
+			profile="prefix/${linux}/ppc"
 			;;
 		powerpc64-unknown-linux-gnu)
-			profile="prefix/linux/ppc64"
+			profile="prefix/${linux}/ppc64"
 			;;
 		armv7l-pc-linux-gnu)
-			profile="prefix/linux/arm"
+			profile="prefix/${linux}/arm"
 			;;
 		sparc-sun-solaris2.9)
 			profile="prefix/sunos/solaris/5.9/sparc"
@@ -404,6 +408,7 @@ do_tree() {
 }
 
 bootstrap_tree() {
+	is-rap && LATEST_TREE_YES=1
 	local PV="20160420"
 	if [[ -n ${LATEST_TREE_YES} ]]; then
 		do_tree "${SNAPSHOT_URL}" portage-latest.tar.bz2
@@ -2400,7 +2405,8 @@ export PORTDIR=${PORTDIR:-"${ROOT}/usr/portage"}
 export DISTDIR=${DISTDIR:-"${PORTDIR}/distfiles"}
 PORTAGE_TMPDIR=${PORTAGE_TMPDIR:-${ROOT}/tmp/var/tmp}
 DISTFILES_URL=${DISTFILES_URL:-"http://dev.gentoo.org/~grobian/distfiles"}
-SNAPSHOT_URL=${SNAPSHOT_URL:-"http://rsync.prefix.bitzolder.nl/snapshots"}
+SNAPSHOT_HOST=$(rapx distfiles.gentoo.org rsync.prefix.bitzolder.nl)
+SNAPSHOT_URL=${SNAPSHOT_URL:-"http://${SNAPSHOT_HOST}/snapshots"}
 GNU_URL=${GNU_URL:="http://ftp.gnu.org/gnu"}
 GENTOO_MIRRORS=${GENTOO_MIRRORS:="http://distfiles.gentoo.org"}
 GCC_APPLE_URL="http://www.opensource.apple.com/darwinsource/tarballs/other"


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/proj/prefix:script-rap commit in: scripts/
@ 2016-05-27 10:53 Benda XU
  0 siblings, 0 replies; 11+ messages in thread
From: Benda XU @ 2016-05-27 10:53 UTC (permalink / raw
  To: gentoo-commits

commit:     65eddd9e494e298bc65e63700b2b94cdf204a762
Author:     Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Mon May 23 17:23:55 2016 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Thu May 26 13:55:41 2016 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=65eddd9e

scripts/bootstrap-prefix.sh: support sys-libs/glibc.

  do not need a linker in stage2 on RAP.

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

diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index 4b86519..88f24f3 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -148,7 +148,8 @@ configure_cflags() {
 configure_toolchain() {
 	linker="sys-devel/binutils"
 	local gcc_deps="dev-libs/gmp dev-libs/mpfr dev-libs/mpc"
-	compiler="${gcc_deps} sys-devel/gcc-config sys-devel/gcc"
+	local gcc_rap_deps=$(rapx "sys-kernel/linux-headers sys-libs/glibc")
+	compiler="${gcc_deps} ${gcc_rap_deps} sys-devel/gcc-config sys-devel/gcc"
 	compiler_stage1="${gcc_deps} sys-devel/gcc-config"
 	case ${CHOST} in
 	*-cygwin*)
@@ -1249,7 +1250,7 @@ bootstrap_stage2() {
 		sys-devel/flex
 		sys-devel/bison
 		sys-devel/patch
-		sys-devel/binutils-config
+		$(rapx "" sys-devel/binutils-config)
 		$([[ ${CHOST} == *-aix* ]] && echo sys-apps/diffutils ) # gcc can't deal with aix diffutils, gcc PR14251
 	)
 
@@ -1260,6 +1261,7 @@ bootstrap_stage2() {
 	
 	# Build a linker and compiler that live in ${ROOT}/tmp, but
 	# produce binaries in ${ROOT}.
+	is-rap || \
 	USE="${USE} -cxx" \
 	TPREFIX="${ROOT}" \
 	emerge_pkgs --nodeps ${linker} || return 1
@@ -1269,6 +1271,7 @@ bootstrap_stage2() {
 	# package.use to disable in the temporary prefix.  
 	echo "dev-libs/gmp -cxx" >> "${ROOT}"/tmp/etc/portage/package.use
 
+	BOOTSTRAP_RAP_STAGE2=yes \
 	EXTRA_ECONF="--disable-bootstrap" \
 	GCC_MAKE_TARGET=all \
 	TPREFIX="${ROOT}" \
@@ -1361,6 +1364,11 @@ bootstrap_stage3() {
 	)
 	emerge_pkgs --nodeps "${pkgs[@]}" || return 1
 
+	if is-rap && [[ ! -x "${ROOT}"/usr/bin/perl ]]; then
+		echo "We need perl at ${ROOT}/usr/bin/perl to merge glibc." > "${ROOT}"/usr/bin/perl
+		chmod +x "${ROOT}"/usr/bin/perl
+	fi
+
 	# On some hosts, gcc gets confused now when it uses the new linker,
 	# see for instance bug #575480.  While we would like to hide that
 	# linker, we can't since we want the compiler to pick it up.


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/proj/prefix:script-rap commit in: scripts/
@ 2016-05-27 10:53 Benda XU
  0 siblings, 0 replies; 11+ messages in thread
From: Benda XU @ 2016-05-27 10:53 UTC (permalink / raw
  To: gentoo-commits

commit:     8bcfe8ed4b4a540e27a10d5626c2d922ddae99a0
Author:     Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Thu May 26 09:37:52 2016 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Fri May 27 07:45:27 2016 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=8bcfe8ed

bootstrap-prefix.sh: use tools from stage2 on RAP.

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

diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index f3d13f8..07bd986 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -1351,21 +1351,31 @@ bootstrap_stage3() {
 	export MAKEINFO="echo makeinfo GNU texinfo 4.13"
 	
 	# Build a native compiler.
-	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}
-	)
+	if is-rap ; then
+		pkgs=(
+			sys-apps/baselayout
+			sys-apps/gentoo-functions
+			sys-devel/binutils-config
+			sys-libs/zlib
+			${linker}
+		)
+	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 && [[ ! -x "${ROOT}"/usr/bin/perl ]]; then


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/proj/prefix:script-rap commit in: scripts/
@ 2016-05-27 10:53 Benda XU
  0 siblings, 0 replies; 11+ messages in thread
From: Benda XU @ 2016-05-27 10:53 UTC (permalink / raw
  To: gentoo-commits

commit:     4513898cf015ccb78abba9eb6ec451e754c14ad0
Author:     Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Fri May 27 10:48:26 2016 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Fri May 27 10:48:26 2016 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=4513898c

scripts/bootstrap-prefix.sh: solve RHEL 6.7 bootstrap issues.

  - binutils-config and ldconfig should be called explicitly
  - lto of gcc should be disabled. ld points to the host dynamic
    loader and gcc points to the RAP one, ld cannot load the gcc
    lto plugin.

 scripts/bootstrap-prefix.sh | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index 874e627..196dc73 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -149,8 +149,7 @@ configure_cflags() {
 configure_toolchain() {
 	linker="sys-devel/binutils"
 	local gcc_deps="dev-libs/gmp dev-libs/mpfr dev-libs/mpc"
-	local gcc_rap_deps=$(rapx "sys-kernel/linux-headers sys-libs/glibc")
-	compiler="${gcc_deps} ${gcc_rap_deps} sys-devel/gcc-config sys-devel/gcc"
+	compiler="${gcc_deps} sys-devel/gcc-config sys-devel/gcc"
 	compiler_stage1="${gcc_deps} sys-devel/gcc-config"
 	case ${CHOST} in
 	*-cygwin*)
@@ -1376,10 +1375,14 @@ bootstrap_stage3() {
 			${linker}
 		)
 	fi
-	LDFLAGS="${LDFLAGS} $(rapx -Wl,-rpath=${ROOT}/usr/$(get_libdir))" \
+	# binutils has the host dynamic loader(DL), while gcc will have the RAP one.
+	# A gcc lto plugin (new DL) will fail to work with ld (old DL).
+	# USE=-cxx disables ld.gold and plugins.
+	USE="${USE} $(rapx -cxx)" \
 	emerge_pkgs --nodeps "${pkgs[@]}" || return 1
 
 	if is-rap ; then
+		binutils-config 1 || return 1
 		if [[ ! -x "${ROOT}"/usr/bin/perl ]]; then
 			echo "We need ${ROOT}/usr/bin/perl to merge glibc." > "${ROOT}"/usr/bin/perl
 			chmod +x "${ROOT}"/usr/bin/perl
@@ -1389,8 +1392,9 @@ bootstrap_stage3() {
 			mkdir -p "${ROOT}"/etc/ld.so.conf.d
 			dirname $(gcc -print-libgcc-file-name) > "${ROOT}"/etc/ld.so.conf.d/stage2.conf
 		fi
+		emerge_pkgs --nodeps sys-kernel/linux-headers sys-libs/glibc \
+			&& "${ROOT}"/usr/sbin/ldconfig || return 1
 	fi
-
 	# On some hosts, gcc gets confused now when it uses the new linker,
 	# see for instance bug #575480.  While we would like to hide that
 	# linker, we can't since we want the compiler to pick it up.
@@ -1404,9 +1408,10 @@ bootstrap_stage3() {
 	( cd "${ROOT}"/usr/bin && test ! -e python && ln -s "${ROOT}"/tmp/usr/bin/python2.7 )
 	# in addition, avoid collisions
 	rm -Rf "${ROOT}"/tmp/usr/lib/python2.7/site-packages/clang
+	RAP_DLINKER=$(echo "${ROOT}"/$(get_libdir)/ld*.so.[0-9])
 	# try to get ourself out of the mudd, bug #575324
-	EXTRA_ECONF="--disable-compiler-version-checks" \
-	LDFLAGS="${LDFLAGS} $(rapx -Wl,--dynamic-linker=$(echo ${ROOT}/$(get_libdir)/ld*.so.[0-9]))" \
+	EXTRA_ECONF="--disable-compiler-version-checks $(rapx --disable-lto)" \
+	LDFLAGS="${LDFLAGS} $(rapx -Wl,--dynamic-linker=${RAP_DLINKER})" \
 	emerge_pkgs --nodeps ${compiler} || return 1
 	is-rap && rm -f "${ROOT}"/etc/ld.so.conf.d/stage2.conf
 	( cd "${ROOT}"/usr/bin && test ! -e python && rm -f python2.7 )


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/proj/prefix:script-rap commit in: scripts/
@ 2016-05-27 10:53 Benda XU
  0 siblings, 0 replies; 11+ messages in thread
From: Benda XU @ 2016-05-27 10:53 UTC (permalink / raw
  To: gentoo-commits

commit:     477ae701b57e19a102552ae63c8f686d3e167016
Author:     Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Fri May 27 07:53:40 2016 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Fri May 27 07:53:40 2016 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=477ae701

scripts/bootstrap-prefix.sh: paths of stage 3 toolchain.

 scripts/bootstrap-prefix.sh | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index 07bd986..874e627 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -1376,11 +1376,19 @@ bootstrap_stage3() {
 			${linker}
 		)
 	fi
+	LDFLAGS="${LDFLAGS} $(rapx -Wl,-rpath=${ROOT}/usr/$(get_libdir))" \
 	emerge_pkgs --nodeps "${pkgs[@]}" || return 1
 
-	if is-rap && [[ ! -x "${ROOT}"/usr/bin/perl ]]; then
-		echo "We need perl at ${ROOT}/usr/bin/perl to merge glibc." > "${ROOT}"/usr/bin/perl
-		chmod +x "${ROOT}"/usr/bin/perl
+	if is-rap ; then
+		if [[ ! -x "${ROOT}"/usr/bin/perl ]]; then
+			echo "We need ${ROOT}/usr/bin/perl to merge glibc." > "${ROOT}"/usr/bin/perl
+			chmod +x "${ROOT}"/usr/bin/perl
+		fi
+		# Tell dynamic loader the path of libgcc_s.so of stage2
+		if [[ ! -f "${ROOT}"/etc/ld.so.conf.d/stage2.conf ]]; then
+			mkdir -p "${ROOT}"/etc/ld.so.conf.d
+			dirname $(gcc -print-libgcc-file-name) > "${ROOT}"/etc/ld.so.conf.d/stage2.conf
+		fi
 	fi
 
 	# On some hosts, gcc gets confused now when it uses the new linker,
@@ -1398,7 +1406,9 @@ bootstrap_stage3() {
 	rm -Rf "${ROOT}"/tmp/usr/lib/python2.7/site-packages/clang
 	# try to get ourself out of the mudd, bug #575324
 	EXTRA_ECONF="--disable-compiler-version-checks" \
+	LDFLAGS="${LDFLAGS} $(rapx -Wl,--dynamic-linker=$(echo ${ROOT}/$(get_libdir)/ld*.so.[0-9]))" \
 	emerge_pkgs --nodeps ${compiler} || return 1
+	is-rap && rm -f "${ROOT}"/etc/ld.so.conf.d/stage2.conf
 	( cd "${ROOT}"/usr/bin && test ! -e python && rm -f python2.7 )
 
 	# Use $ROOT tools where possible from now on.


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-05-27 10:54 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-27 10:53 [gentoo-commits] repo/proj/prefix:script-rap commit in: scripts/ Benda XU
  -- strict thread matches above, loose matches on Subject: below --
2016-05-27 10:53 Benda XU
2016-05-27 10:53 Benda XU
2016-05-27 10:53 Benda XU
2016-05-27 10:53 Benda XU
2016-05-27 10:53 Benda XU
2016-05-27 10:53 Benda XU
2016-05-27 10:53 Benda XU
2016-05-27 10:53 Benda XU
2016-05-27 10:53 Benda XU
2016-05-27 10:53 Benda XU

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox