Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 702342
Collapse All | Expand All

(-)a/scripts/bootstrap-prefix.sh (-1 / +67 lines)
Lines 938-943 bootstrap_gnu() { Link Here
938
	einfo "${PN}-${PV} successfully bootstrapped"
938
	einfo "${PN}-${PV} successfully bootstrapped"
939
}
939
}
940
940
941
bootstrap_autotools_tarball() {
942
	PN="${1}"
943
	PV="${2}"
944
	PEXT="${3}"
945
	A=${PN}-${PV}.${PEXT}
946
947
	einfo "Bootstrapping ${A%-*}"
948
949
	efetch ${DISTFILES_G_O}/distfiles/${A} || return 1
950
951
	einfo "Unpacking ${A%%-*}"
952
	export S="${PORTAGE_TMPDIR}/${PN}-${PV}"
953
	rm -rf "${S}"
954
	mkdir -p "${S}"
955
	cd "${S}"
956
	if [[ ${PEXT} == "tar.gz" ]] ; then
957
		gzip -dc "${DISTDIR}"/${A} | tar -xf - || return 1
958
	elif [[ ${PEXT} == "tar.xz" ]] ; then
959
		xz -dc "${DISTDIR}"/${A} | tar -xf - || return 1
960
	elif [[ ${PEXT} == "tar.bz2" ]] ; then
961
		bzip2 -dc "${DISTDIR}"/${A} | tar -xf - || return 1
962
	elif [[ ${PEXT} == "tar" ]] ; then
963
		tar -xf "${DISTDIR}"/${A} || return 1
964
	else
965
		einfo "unhandled extension: $PEXT"
966
		return 1
967
	fi
968
	S="${S}"/${PN}-${PV}
969
	cd "${S}"
970
971
	local makeopts=( ${MAKEOPTS} )
972
973
	einfo "Compiling ${A%-*}"
974
	CHOST= ${CONFIG_SHELL} ./configure --prefix="${ROOT}"/tmp/usr || return 1
975
	$MAKE "${makeopts[@]}" || return 1
976
977
	einfo "Installing ${A%-*}"
978
	$MAKE "${makeopts[@]}" -j1 install || return 1
979
980
	einfo "${A%-*} bootstrapped"
981
}
982
941
PYTHONMAJMIN=3.6   # keep this number in line with PV below for stage1,2
983
PYTHONMAJMIN=3.6   # keep this number in line with PV below for stage1,2
942
bootstrap_python() {
984
bootstrap_python() {
943
	PV=3.6.10
985
	PV=3.6.10
Lines 1256-1261 bootstrap_patch() { Link Here
1256
	bootstrap_gnu patch 2.6.1
1298
	bootstrap_gnu patch 2.6.1
1257
}
1299
}
1258
1300
1301
bootstrap_patchelf() {
1302
	bootstrap_autotools_tarball patchelf 0.10 tar.bz2
1303
}
1304
1259
bootstrap_gawk() {
1305
bootstrap_gawk() {
1260
	bootstrap_gnu gawk 4.0.1 || bootstrap_gnu gawk 4.0.0 || \
1306
	bootstrap_gnu gawk 4.0.1 || bootstrap_gnu gawk 4.0.0 || \
1261
		bootstrap_gnu gawk 3.1.8
1307
		bootstrap_gnu gawk 3.1.8
Lines 1401-1406 bootstrap_stage1() { Link Here
1401
	[[ $(tar --version 2>&1) == *GNU* ]] || (bootstrap_tar) || return 1
1447
	[[ $(tar --version 2>&1) == *GNU* ]] || (bootstrap_tar) || return 1
1402
	[[ $(patch --version 2>&1) == *"patch 2."[6-9]*GNU* ]] \
1448
	[[ $(patch --version 2>&1) == *"patch 2."[6-9]*GNU* ]] \
1403
		|| (bootstrap_patch) || return 1
1449
		|| (bootstrap_patch) || return 1
1450
	[[ $(patchelf --version 2>&1) == *"patchelf 0.10" ]] \
1451
		|| [[ $(patchelf --version 2>&1) == *"patchelf 0.9" ]] \
1452
		|| (bootstrap_patchelf) || return 1
1404
	[[ $(grep --version 2>&1) == *GNU* ]] || (bootstrap_grep) || return 1
1453
	[[ $(grep --version 2>&1) == *GNU* ]] || (bootstrap_grep) || return 1
1405
	[[ $(awk --version < /dev/null 2>&1) == *GNU" Awk "[456789]* ]] \
1454
	[[ $(awk --version < /dev/null 2>&1) == *GNU" Awk "[456789]* ]] \
1406
		|| bootstrap_gawk || return 1
1455
		|| bootstrap_gawk || return 1
Lines 1921-1926 bootstrap_stage3() { Link Here
1921
		# use the new dynamic linker in place of rpath from now on.
1970
		# use the new dynamic linker in place of rpath from now on.
1922
		RAP_DLINKER=$(echo "${ROOT}"/$(get_libdir)/ld*.so.[0-9])
1971
		RAP_DLINKER=$(echo "${ROOT}"/$(get_libdir)/ld*.so.[0-9])
1923
		export LDFLAGS="-L${ROOT}/usr/$(get_libdir) -Wl,--dynamic-linker=${RAP_DLINKER}"
1972
		export LDFLAGS="-L${ROOT}/usr/$(get_libdir) -Wl,--dynamic-linker=${RAP_DLINKER}"
1973
1974
		# Use the new dynamic linker even for the stage2 gcc, so that
1975
		# stage2 gcc does not break while building stage3 gcc when
1976
		# LD_LIBRARY_PATH starts to override some of the gcc libraries
1977
		# (libstdc++.so) from host versions to stage3 versions, which
1978
		# may be incompatible with the host versions of the remaining
1979
		# non-overriden libraries (libc.so). The alternative to
1980
		# changing interpreter now would be to link stage2 gcc
1981
		# statically in the first place, so that it is not affected by
1982
		# LD_LIBRARY_PATH, but that doesn't (and can't?) happen on
1983
		# hosts that do not have libc.a (glibc-static) and libstdc++.a
1984
		# (libstdc++-static) installed. Workaround for Bug #702342.
1985
		find "${ROOT}"/tmp/usr/bin/${CHOST}-* "${ROOT}"/tmp/usr/libexec/gcc/${CHOST} \
1986
			\( -type f -or -type l \) -executable \
1987
			-not \( -name '*.la' -or -name '*.a' -or -name '*.so.*' -or -name '*.so' \) \
1988
			-exec patchelf --set-interpreter "${RAP_DLINKER}" {} \; \
1989
                       || return 1
1990
1924
		BOOTSTRAP_RAP=yes \
1991
		BOOTSTRAP_RAP=yes \
1925
		with_stack_emerge_pkgs --nodeps "${pkgs[@]}" || return 1
1992
		with_stack_emerge_pkgs --nodeps "${pkgs[@]}" || return 1
1926
1993
1927
- 

Return to bug 702342