Lines 239-248
configure_toolchain() {
Link Here
|
239 |
# this is Clang, recent enough to compile recent clang |
239 |
# this is Clang, recent enough to compile recent clang |
240 |
compiler_stage1+=" |
240 |
compiler_stage1+=" |
241 |
${llvm_deps} |
241 |
${llvm_deps} |
242 |
sys-libs/libcxxabi |
242 |
sys-libs/compiler-rt |
243 |
sys-libs/libcxx |
|
|
244 |
sys-devel/llvm |
243 |
sys-devel/llvm |
|
|
244 |
sys-devel/lld |
245 |
sys-devel/clang |
245 |
sys-devel/clang |
|
|
246 |
sys-devel/clang-common |
246 |
" |
247 |
" |
247 |
CC=clang |
248 |
CC=clang |
248 |
CXX=clang++ |
249 |
CXX=clang++ |
Lines 250-256
configure_toolchain() {
Link Here
|
250 |
# binutils-apple, rely on the host-installed ld to |
251 |
# binutils-apple, rely on the host-installed ld to |
251 |
# build a compiler, we'll pull in binutils-apple |
252 |
# build a compiler, we'll pull in binutils-apple |
252 |
# from system set |
253 |
# from system set |
253 |
linker=sys-devel/native-cctools |
254 |
linker=sys-devel/lld |
254 |
;; |
255 |
;; |
255 |
*) |
256 |
*) |
256 |
eerror "unknown/unsupported compiler" |
257 |
eerror "unknown/unsupported compiler" |
Lines 261-270
configure_toolchain() {
Link Here
|
261 |
compiler=" |
262 |
compiler=" |
262 |
dev-libs/libffi |
263 |
dev-libs/libffi |
263 |
${llvm_deps} |
264 |
${llvm_deps} |
|
|
265 |
sys-libs/compiler-rt |
264 |
sys-libs/libcxxabi |
266 |
sys-libs/libcxxabi |
265 |
sys-libs/libcxx |
267 |
sys-libs/libcxx |
266 |
sys-devel/llvm |
268 |
sys-devel/llvm |
267 |
sys-devel/clang" |
269 |
sys-devel/lld |
|
|
270 |
sys-libs/llvm-libunwind |
271 |
sys-devel/clang |
272 |
sys-devel/clang-common |
273 |
" |
268 |
;; |
274 |
;; |
269 |
*-freebsd* | *-openbsd*) |
275 |
*-freebsd* | *-openbsd*) |
270 |
CC=clang |
276 |
CC=clang |
Lines 470-480
bootstrap_profile() {
Link Here
|
470 |
fi |
476 |
fi |
471 |
( cd "${ROOT}" && ln -s "${SDKPATH}" MacOSX.sdk ) |
477 |
( cd "${ROOT}" && ln -s "${SDKPATH}" MacOSX.sdk ) |
472 |
einfo "using system sources from ${SDKPATH}" |
478 |
einfo "using system sources from ${SDKPATH}" |
473 |
fi |
|
|
474 |
|
479 |
|
475 |
if [[ ${DARWIN_USE_GCC} == 1 ]] ; then |
480 |
if [[ ${DARWIN_USE_GCC} == 1 ]] ; then |
476 |
# amend profile, to use gcc one |
481 |
# amend profile, to use gcc one |
477 |
profile="${profile}/gcc" |
482 |
profile="${profile}/gcc" |
|
|
483 |
elif [[ "${STAGE}" != stage2 ]]; then |
484 |
profile="${profile}/clang" |
485 |
fi |
478 |
fi |
486 |
fi |
479 |
|
487 |
|
480 |
[[ -n ${PROFILE_BASE}${PROFILE_VARIANT} ]] && |
488 |
[[ -n ${PROFILE_BASE}${PROFILE_VARIANT} ]] && |
Lines 542-547
do_tree() {
Link Here
|
542 |
fi |
550 |
fi |
543 |
|
551 |
|
544 |
mkdir -p "${PORTDIR}" |
552 |
mkdir -p "${PORTDIR}" |
|
|
553 |
rm -rf "${PORTDIR}" |
554 |
cp -Rp ~/Gentoo2/var/db/repos/gentoo "${PORTDIR}" |
555 |
return 0 |
545 |
if [[ ! -e ${PORTDIR}/.unpacked ]]; then |
556 |
if [[ ! -e ${PORTDIR}/.unpacked ]]; then |
546 |
# latest tree cannot be fetched from mirrors, always have to |
557 |
# latest tree cannot be fetched from mirrors, always have to |
547 |
# respect the source to get the latest |
558 |
# respect the source to get the latest |
Lines 651-656
bootstrap_portage() {
Link Here
|
651 |
|
662 |
|
652 |
fix_config_sub |
663 |
fix_config_sub |
653 |
|
664 |
|
|
|
665 |
patch -p1 < "${ROOT}/var/db/repos/gentoo/sys-apps/portage/files/portage-3.0.49-prefix-stage2.patch" |
666 |
|
654 |
# disable ipc |
667 |
# disable ipc |
655 |
sed -e "s:_enable_ipc_daemon = True:_enable_ipc_daemon = False:" \ |
668 |
sed -e "s:_enable_ipc_daemon = True:_enable_ipc_daemon = False:" \ |
656 |
-i lib/_emerge/AbstractEbuildProcess.py || \ |
669 |
-i lib/_emerge/AbstractEbuildProcess.py || \ |
Lines 1165-1176
bootstrap_cmake_core() {
Link Here
|
1165 |
|
1178 |
|
1166 |
# we need sysroot crap to build cmake itself, but it makes trouble |
1179 |
# we need sysroot crap to build cmake itself, but it makes trouble |
1167 |
# later on, so kill it in the installed version |
1180 |
# later on, so kill it in the installed version |
1168 |
ver=${A%-*} ; ver=${ver%.*} |
|
|
1169 |
sed -i -e '/cmake_gnu_set_sysroot_flag/d' \ |
1181 |
sed -i -e '/cmake_gnu_set_sysroot_flag/d' \ |
1170 |
"${ROOT}"/tmp/usr/share/${ver}/Modules/Platform/Apple-GNU-*.cmake || die |
1182 |
"${ROOT}"/tmp/usr/share/cmake*/Modules/Platform/Apple-GNU-*.cmake || die |
1171 |
# disable isysroot usage with clang as well |
1183 |
# disable isysroot usage with clang as well |
1172 |
sed -i -e '/_SYSROOT_FLAG/d' \ |
1184 |
sed -i -e '/_SYSROOT_FLAG/d' \ |
1173 |
"${ROOT}"/tmp/usr/share/${ver}/Modules/Platform/Apple-Clang.cmake || die |
1185 |
"${ROOT}"/tmp/usr/share/cmake*/Modules/Platform/Apple-Clang.cmake || die |
1174 |
|
1186 |
|
1175 |
einfo "${A%.tar.*} bootstrapped" |
1187 |
einfo "${A%.tar.*} bootstrapped" |
1176 |
} |
1188 |
} |
Lines 1404-1410
bootstrap_stage1() {
Link Here
|
1404 |
[[ -e ${ROOT}/tmp/${x} ]] || ( cd "${ROOT}"/tmp && ln -s usr/${x} ) |
1416 |
[[ -e ${ROOT}/tmp/${x} ]] || ( cd "${ROOT}"/tmp && ln -s usr/${x} ) |
1405 |
done |
1417 |
done |
1406 |
|
1418 |
|
1407 |
configure_toolchain |
1419 |
STAGE=stage1 configure_toolchain || return 1 |
1408 |
export CC CXX |
1420 |
export CC CXX |
1409 |
|
1421 |
|
1410 |
# Run all bootstrap_* commands in a subshell since the targets |
1422 |
# Run all bootstrap_* commands in a subshell since the targets |
Lines 1572-1578
bootstrap_stage1() {
Link Here
|
1572 |
[[ -e ${ROOT}/tmp/etc/portage/make.profile ]] || \ |
1584 |
[[ -e ${ROOT}/tmp/etc/portage/make.profile ]] || \ |
1573 |
( "${CP}" -dpR "${ROOT}"/etc/portage "${ROOT}"/tmp/etc && \ |
1585 |
( "${CP}" -dpR "${ROOT}"/etc/portage "${ROOT}"/tmp/etc && \ |
1574 |
rm -f "${ROOT}"/tmp/etc/portage/make.profile && \ |
1586 |
rm -f "${ROOT}"/tmp/etc/portage/make.profile && \ |
1575 |
(ROOT="${ROOT}"/tmp PREFIX_DISABLE_RAP=yes bootstrap_profile) ) || return 1 |
1587 |
(ROOT="${ROOT}"/tmp PREFIX_DISABLE_RAP=yes STAGE=stage2 bootstrap_profile) ) || return 1 |
1576 |
|
1588 |
|
1577 |
# setup portage |
1589 |
# setup portage |
1578 |
[[ -e ${ROOT}/tmp/usr/bin/emerge ]] || (bootstrap_portage) || return 1 |
1590 |
[[ -e ${ROOT}/tmp/usr/bin/emerge ]] || (bootstrap_portage) || return 1 |
Lines 1628-1634
do_emerge_pkgs() {
Link Here
|
1628 |
-fortran |
1640 |
-fortran |
1629 |
-gdbm |
1641 |
-gdbm |
1630 |
-git |
1642 |
-git |
1631 |
-libcxx |
|
|
1632 |
-nls |
1643 |
-nls |
1633 |
-pcre |
1644 |
-pcre |
1634 |
-python |
1645 |
-python |
Lines 1639-1644
do_emerge_pkgs() {
Link Here
|
1639 |
clang |
1650 |
clang |
1640 |
internal-glib |
1651 |
internal-glib |
1641 |
) |
1652 |
) |
|
|
1653 |
if [[ ${CHOST} == *-darwin* && ${DARWIN_USE_GCC} == 0 ]] ; then |
1654 |
myuse+=( |
1655 |
-binutils-plugin |
1656 |
default-compiler-rt |
1657 |
default-libcxx |
1658 |
default-lld |
1659 |
) |
1660 |
else |
1661 |
myuse+=( -libcxx ) |
1662 |
fi |
1663 |
if [[ ${STAGE} == stage2 ]] ; then |
1664 |
myuse+=( bootstrap-prefix ) |
1665 |
fi |
1642 |
local override_make_conf_dir="${PORTAGE_OVERRIDE_EPREFIX}${MAKE_CONF_DIR#${ROOT}}" |
1666 |
local override_make_conf_dir="${PORTAGE_OVERRIDE_EPREFIX}${MAKE_CONF_DIR#${ROOT}}" |
1643 |
|
1667 |
|
1644 |
if [[ " ${USE} " == *" prefix-stack "* ]] && |
1668 |
if [[ " ${USE} " == *" prefix-stack "* ]] && |
Lines 1698-1708
bootstrap_stage2() {
Link Here
|
1698 |
|
1722 |
|
1699 |
# Find out what toolchain packages we need, and configure LDFLAGS |
1723 |
# Find out what toolchain packages we need, and configure LDFLAGS |
1700 |
# and friends. |
1724 |
# and friends. |
1701 |
configure_toolchain || return 1 |
1725 |
STAGE=stage2 configure_toolchain || return 1 |
1702 |
configure_cflags || return 1 |
1726 |
configure_cflags || return 1 |
1703 |
export CONFIG_SHELL="${ROOT}"/tmp/bin/bash |
1727 |
export CONFIG_SHELL="${ROOT}"/tmp/bin/bash |
1704 |
export CC CXX |
1728 |
export CC CXX |
1705 |
|
1729 |
|
|
|
1730 |
# provide active SDK link on Darwin |
1731 |
if [[ ${CHOST} == *-darwin* ]] ; then |
1732 |
rm -f "${ROOT}"/tmp/MacOSX.sdk |
1733 |
( cd "${ROOT}"/tmp && ln -s ../MacOSX.sdk . ) |
1734 |
if [[ ${DARWIN_USE_GCC} == 0 ]] ; then |
1735 |
# TODO: libtool is here only because of the hack in the compiler-rt's ebuild |
1736 |
for bin in libtool clang clang++ ; do |
1737 |
{ |
1738 |
echo "#!${ROOT}/tmp/bin/sh" |
1739 |
echo "${bin}"' "$@"' |
1740 |
} > "${ROOT}"/tmp/usr/bin/${CHOST}-${bin} |
1741 |
chmod +x "${ROOT}"/tmp/usr/bin/${CHOST}-${bin} |
1742 |
done |
1743 |
fi |
1744 |
if [[ ${DARWIN_USE_GCC} == 123 ]] ; then |
1745 |
{ |
1746 |
echo 'PATH="/Library/Developer/CommandLineTools/usr/bin:$PATH"' |
1747 |
echo "CFLAGS=\"-L ${ROOT}/tmp/MacOSX.sdk/usr/lib -isystem ${ROOT}/tmp/MacOSX.sdk/usr/include ${CFLAGS}\"" |
1748 |
#echo 'CXXFLAGS="${CFLAGS}"' |
1749 |
#echo 'LDFLAGS="${LDFLAGS} -mlinker-version=305"' |
1750 |
#echo LIBTOOL=libtool |
1751 |
# clang-cpp and llvm-ar set by profile don't exist yet |
1752 |
#echo 'CPP="clang -E"' |
1753 |
#echo 'AR=ar' |
1754 |
#echo 'NM=nm' |
1755 |
#echo 'RANLIB=ranlib' |
1756 |
} > "${ROOT}/tmp/etc/portage/make.conf/0102_bootstrap_prefix_darwin.conf" |
1757 |
fi |
1758 |
fi |
1759 |
|
1706 |
emerge_pkgs() { |
1760 |
emerge_pkgs() { |
1707 |
EPREFIX="${ROOT}"/tmp \ |
1761 |
EPREFIX="${ROOT}"/tmp \ |
1708 |
STAGE=stage2 \ |
1762 |
STAGE=stage2 \ |
Lines 1793-1813
bootstrap_stage2() {
Link Here
|
1793 |
[[ ${CHOST} == *-solaris* ]] && echo "=dev-libs/libffi-3.3_rc0" \ |
1847 |
[[ ${CHOST} == *-solaris* ]] && echo "=dev-libs/libffi-3.3_rc0" \ |
1794 |
>> "${ROOT}"/tmp/etc/portage/package.mask |
1848 |
>> "${ROOT}"/tmp/etc/portage/package.mask |
1795 |
|
1849 |
|
1796 |
# provide active SDK link on Darwin |
|
|
1797 |
if [[ ${CHOST} == *-darwin* ]] ; then |
1798 |
rm -f "${ROOT}"/tmp/MacOSX.sdk |
1799 |
( cd "${ROOT}"/tmp && ln -s ../MacOSX.sdk ) |
1800 |
fi |
1801 |
|
1802 |
# cmake has some external dependencies which require autoconf, etc. |
1850 |
# cmake has some external dependencies which require autoconf, etc. |
1803 |
# unless we only build the buildtool, bug #603012 |
1851 |
# unless we only build the buildtool, bug #603012 |
1804 |
echo "dev-util/cmake -server" >> "${ROOT}"/tmp/etc/portage/package.use |
1852 |
echo "dev-util/cmake -server" >> "${ROOT}"/tmp/etc/portage/package.use |
1805 |
|
1853 |
|
1806 |
emerge_pkgs --nodeps "${pkgs[@]}" || return 1 |
1854 |
emerge_pkgs --nodeps "${pkgs[@]}" || return 1 |
1807 |
|
1855 |
|
1808 |
# Debian multiarch supported by RAP needs ld to support sysroot. |
1856 |
if [[ ${CHOST} == *-darwin* && ${DARWIN_USE_GCC} == 0 ]] ; then |
1809 |
EXTRA_ECONF=$(rapx --with-sysroot=/) \ |
1857 |
: |
1810 |
emerge_pkgs --nodeps ${linker} || return 1 |
1858 |
else |
|
|
1859 |
# Debian multiarch supported by RAP needs ld to support sysroot. |
1860 |
EXTRA_ECONF=$(rapx --with-sysroot=/) \ |
1861 |
emerge_pkgs --nodeps ${linker} || return 1 |
1862 |
fi |
1811 |
|
1863 |
|
1812 |
# During Gentoo prefix bootstrap stage2, GCC is built with |
1864 |
# During Gentoo prefix bootstrap stage2, GCC is built with |
1813 |
# "--disable-bootstrap". For Darwin, it means that rather than letting |
1865 |
# "--disable-bootstrap". For Darwin, it means that rather than letting |
Lines 1824-1830
bootstrap_stage2() {
Link Here
|
1824 |
# Thus, embedded rpath should be disabled during prefix bootstrap stage2 |
1876 |
# Thus, embedded rpath should be disabled during prefix bootstrap stage2 |
1825 |
# and passed into EXTRA_ECONF. |
1877 |
# and passed into EXTRA_ECONF. |
1826 |
# https://bugs.gentoo.org/895334 |
1878 |
# https://bugs.gentoo.org/895334 |
1827 |
if [[ ${CHOST} == *-darwin* ]] ; |
1879 |
if [[ ${CHOST} == *-darwin* && ${DARWIN_USE_GCC} == 1 ]] ; |
1828 |
then |
1880 |
then |
1829 |
local disable_darwin_rpath="--disable-darwin-at-rpath" |
1881 |
local disable_darwin_rpath="--disable-darwin-at-rpath" |
1830 |
else |
1882 |
else |
Lines 1839-1848
bootstrap_stage2() {
Link Here
|
1839 |
# to find our prefix |
1891 |
# to find our prefix |
1840 |
# For >=gcc-12.2.0, rpath needs to be disabled in stage2 on |
1892 |
# For >=gcc-12.2.0, rpath needs to be disabled in stage2 on |
1841 |
# Darwin, see above. |
1893 |
# Darwin, see above. |
|
|
1894 |
# OVERRIDE_CXXFLAGS="${CPPFLAGS} -O2 -pipe" \ |
1842 |
EXTRA_ECONF="--disable-bootstrap $(rapx --with-linker-hash-style=both) --with-local-prefix=${ROOT} ${disable_darwin_rpath}" \ |
1895 |
EXTRA_ECONF="--disable-bootstrap $(rapx --with-linker-hash-style=both) --with-local-prefix=${ROOT} ${disable_darwin_rpath}" \ |
1843 |
MYCMAKEARGS="-DCMAKE_USE_SYSTEM_LIBRARY_LIBUV=OFF" \ |
1896 |
MYCMAKEARGS="-DCMAKE_USE_SYSTEM_LIBRARY_LIBUV=OFF" \ |
1844 |
GCC_MAKE_TARGET=all \ |
1897 |
GCC_MAKE_TARGET=all \ |
1845 |
OVERRIDE_CXXFLAGS="${CPPFLAGS} -O2 -pipe" \ |
|
|
1846 |
TPREFIX="${ROOT}" \ |
1898 |
TPREFIX="${ROOT}" \ |
1847 |
PYTHON_COMPAT_OVERRIDE=python$(python_ver) \ |
1899 |
PYTHON_COMPAT_OVERRIDE=python$(python_ver) \ |
1848 |
emerge_pkgs --nodeps ${pkg} || return 1 |
1900 |
emerge_pkgs --nodeps ${pkg} || return 1 |
Lines 1855-1860
bootstrap_stage2() {
Link Here
|
1855 |
[[ -x ${ROOT}/tmp/usr/bin/clang++ ]] && CXX=clang++ |
1907 |
[[ -x ${ROOT}/tmp/usr/bin/clang++ ]] && CXX=clang++ |
1856 |
fi |
1908 |
fi |
1857 |
done |
1909 |
done |
|
|
1910 |
if [[ ${CHOST} == *-darwin* && ${DARWIN_USE_GCC} == 0 ]] ; then |
1911 |
rm ${ROOT}/tmp/usr/bin/${CHOST}-{libtool,clang,clang++} |
1912 |
ln -s ${ROOT}/tmp/usr/lib/llvm/*/bin/llvm-libtool-darwin ${ROOT}/usr/local/bin/libtool |
1913 |
fi |
1858 |
|
1914 |
|
1859 |
if [[ ${compiler_type} == clang ]] ; then |
1915 |
if [[ ${compiler_type} == clang ]] ; then |
1860 |
# We use Clang as our toolchain compiler, so we need to make |
1916 |
# We use Clang as our toolchain compiler, so we need to make |
Lines 1918-1924
bootstrap_stage3() {
Link Here
|
1918 |
# they stop mucking up builds. |
1974 |
# they stop mucking up builds. |
1919 |
rm -f "${ROOT}"/tmp/usr/local/bin/* |
1975 |
rm -f "${ROOT}"/tmp/usr/local/bin/* |
1920 |
|
1976 |
|
1921 |
configure_toolchain || return 1 |
1977 |
STAGE=stage3 configure_toolchain || return 1 |
1922 |
|
1978 |
|
1923 |
if [[ ${compiler_type} == clang ]] ; then |
1979 |
if [[ ${compiler_type} == clang ]] ; then |
1924 |
if ! type -P clang > /dev/null ; then |
1980 |
if ! type -P clang > /dev/null ; then |
Lines 1965-1971
bootstrap_stage3() {
Link Here
|
1965 |
# (CBUILD, BDEPEND) and with the system being built |
2021 |
# (CBUILD, BDEPEND) and with the system being built |
1966 |
# (CHOST, RDEPEND). To correctly bootstrap stage3, |
2022 |
# (CHOST, RDEPEND). To correctly bootstrap stage3, |
1967 |
# PORTAGE_OVERRIDE_EPREFIX as BROOT is needed. |
2023 |
# PORTAGE_OVERRIDE_EPREFIX as BROOT is needed. |
1968 |
PREROOTPATH="${ROOT}"$(echo /{,tmp/}{usr/,}{,lib/llvm/{12,11,10}/}{s,}bin | sed "s, ,:${ROOT},g") \ |
2024 |
#PREROOTPATH="${ROOT}"$(echo /{,tmp/}{usr/,}{,lib/llvm/{12,11,10}/}{s,}bin | sed "s, ,:${ROOT},g") \ |
|
|
2025 |
|
1969 |
EPREFIX="${ROOT}" PORTAGE_TMPDIR="${PORTAGE_TMPDIR}" \ |
2026 |
EPREFIX="${ROOT}" PORTAGE_TMPDIR="${PORTAGE_TMPDIR}" \ |
1970 |
EMERGE_LOG_DIR="${ROOT}"/var/log \ |
2027 |
EMERGE_LOG_DIR="${ROOT}"/var/log \ |
1971 |
STAGE=stage3 \ |
2028 |
STAGE=stage3 \ |
Lines 2096-2103
bootstrap_stage3() {
Link Here
|
2096 |
sys-devel/flex |
2153 |
sys-devel/flex |
2097 |
sys-devel/binutils-config |
2154 |
sys-devel/binutils-config |
2098 |
sys-libs/zlib |
2155 |
sys-libs/zlib |
2099 |
${linker} |
|
|
2100 |
) |
2156 |
) |
|
|
2157 |
if [[ ${CHOST} == *-darwin* && ${DARWIN_USE_GCC} == 0 ]] ; then |
2158 |
: |
2159 |
else |
2160 |
pkgs+=(${linker}) |
2161 |
fi |
2101 |
|
2162 |
|
2102 |
pre_emerge_pkgs --nodeps "${pkgs[@]}" || return 1 |
2163 |
pre_emerge_pkgs --nodeps "${pkgs[@]}" || return 1 |
2103 |
fi |
2164 |
fi |
Lines 2120-2125
bootstrap_stage3() {
Link Here
|
2120 |
# in addition, avoid collisions |
2181 |
# in addition, avoid collisions |
2121 |
rm -Rf "${ROOT}"/tmp/usr/lib/python$(python_ver)/site-packages/clang |
2182 |
rm -Rf "${ROOT}"/tmp/usr/lib/python$(python_ver)/site-packages/clang |
2122 |
|
2183 |
|
|
|
2184 |
if [[ ${CHOST} == *-darwin* && ${DARWIN_USE_GCC} == 0 ]] ; then |
2185 |
# TODO: libtool is here only because of the hack in the compiler-rt's ebuild |
2186 |
if [[ ! -e ${ROOT}/usr/bin/${CHOST}-libtool ]]; then |
2187 |
ln -s ${ROOT}/tmp/usr/lib/llvm/*/bin/llvm-libtool-darwin ${ROOT}/usr/bin/${CHOST}-libtool |
2188 |
fi |
2189 |
fi |
2190 |
|
2123 |
# Try to get ourself out of the mud, bug #575324 |
2191 |
# Try to get ourself out of the mud, bug #575324 |
2124 |
EXTRA_ECONF="--disable-compiler-version-checks $(rapx '--disable-lto --disable-bootstrap')" \ |
2192 |
EXTRA_ECONF="--disable-compiler-version-checks $(rapx '--disable-lto --disable-bootstrap')" \ |
2125 |
GCC_MAKE_TARGET=$(rapx all) \ |
2193 |
GCC_MAKE_TARGET=$(rapx all) \ |
Lines 2127-2140
bootstrap_stage3() {
Link Here
|
2127 |
PYTHON_COMPAT_OVERRIDE=python$(python_ver) \ |
2195 |
PYTHON_COMPAT_OVERRIDE=python$(python_ver) \ |
2128 |
pre_emerge_pkgs --nodeps ${compiler} || return 1 |
2196 |
pre_emerge_pkgs --nodeps ${compiler} || return 1 |
2129 |
|
2197 |
|
|
|
2198 |
# At this point our libc++abi.dylib is dynamically linked to /usr/lib/libc++abi.dylib. |
2199 |
# That causes issues with perl later. Force rebuild of sys-libs/libcxxabi to break this link. |
2200 |
rm -rf "${ROOT}/var/db/pkg/sys-libs/libcxxabi"* |
2201 |
PYTHON_COMPAT_OVERRIDE=python$(python_ver) \ |
2202 |
without_stack_emerge_pkgs --nodeps "sys-libs/libcxxabi" || return 1 |
2203 |
|
2130 |
# Undo libgcc_s.so path of stage2 |
2204 |
# Undo libgcc_s.so path of stage2 |
2131 |
# Now we have the compiler right there |
2205 |
# Now we have the compiler right there |
2132 |
unset CC CXX CPPFLAGS LDFLAGS |
2206 |
unset CC CXX CPPFLAGS LDFLAGS |
2133 |
|
2207 |
|
|
|
2208 |
# Now clang is ready, can use it instead of /usr/bin/gcc |
2209 |
# TODO: perhaps symlink the whole etc/portage instead? |
2210 |
ln -s -f "${ROOT}/etc/portage/make.profile" "${ROOT}/tmp/etc/portage/make.profile" |
2211 |
if [[ ${compiler_type} == clang ]] ; then |
2212 |
cp "${ROOT}/etc/portage/make.conf/0100_bootstrap_prefix_clang.conf" \ |
2213 |
"${ROOT}/tmp/etc/portage/make.conf/" |
2214 |
fi |
2215 |
|
2134 |
rm -f "${ROOT}"/etc/ld.so.conf.d/stage2.conf |
2216 |
rm -f "${ROOT}"/etc/ld.so.conf.d/stage2.conf |
2135 |
|
2217 |
|
2136 |
# need special care, it depends on texinfo, #717786 |
2218 |
# need special care, it depends on texinfo, #717786 |
2137 |
pre_emerge_pkgs --nodeps sys-apps/gawk || return 1 |
2219 |
without_stack_emerge_pkgs --nodeps sys-apps/gawk || return 1 |
2138 |
|
2220 |
|
2139 |
( cd "${ROOT}"/usr/bin && test ! -e python && rm -f python$(python_ver) ) |
2221 |
( cd "${ROOT}"/usr/bin && test ! -e python && rm -f python$(python_ver) ) |
2140 |
# Use $ROOT tools where possible from now on. |
2222 |
# Use $ROOT tools where possible from now on. |
Lines 2144-2153
bootstrap_stage3() {
Link Here
|
2144 |
fi |
2226 |
fi |
2145 |
|
2227 |
|
2146 |
# Start using apps from new target |
2228 |
# Start using apps from new target |
2147 |
export PREROOTPATH="${ROOT}/usr/bin:${ROOT}/bin" |
2229 |
cat > "${ROOT}"/tmp/etc/env.d/10stage3 <<-EOF |
|
|
2230 |
PATH="${ROOT}/usr/bin:${ROOT}/bin:${ROOT}" |
2231 |
EOF |
2232 |
if [[ ${compiler_type} == clang ]] ; then |
2233 |
if [[ ! -e "${ROOT}"/tmp/etc/env.d/11stage3-llvm ]]; then |
2234 |
ln -s "${ROOT}"/etc/env.d/60llvm-* "${ROOT}"/tmp/etc/env.d/11stage3-llvm |
2235 |
fi |
2236 |
# Prevent usage of AppleClang aka gcc for bad packages |
2237 |
if [[ ! -e "${ROOT}"/usr/bin/gcc ]]; then |
2238 |
echo "#!${ROOT}/bin/bash" > "${ROOT}"/usr/bin/gcc |
2239 |
echo "false ${CHOST}-clang \"\$@\"" >> "${ROOT}"/usr/bin/gcc |
2240 |
fi |
2241 |
if [[ ! -e "${ROOT}"/usr/bin/g++ ]]; then |
2242 |
echo "#!${ROOT}/bin/bash" > "${ROOT}"/usr/bin/g++ |
2243 |
echo "false ${CHOST}-clang++ \"\$@\"" >> "${ROOT}"/usr/bin/g++ |
2244 |
fi |
2245 |
chmod +x "${ROOT}"/usr/bin/{gcc,g++} |
2246 |
if [[ ${CHOST} == *-darwin* ]]; then |
2247 |
if [[ ! -e "${ROOT}"/usr/bin/ld ]]; then |
2248 |
echo "#!${ROOT}/bin/bash" > "${ROOT}"/usr/bin/ld |
2249 |
echo "false ld64.lld \"\$@\"" >> "${ROOT}"/usr/bin/ld |
2250 |
fi |
2251 |
chmod +x "${ROOT}"/usr/bin/ld |
2252 |
fi |
2253 |
fi |
2254 |
"${ROOT}"/tmp/usr/sbin/env-update |
2148 |
|
2255 |
|
2149 |
# Get a sane bash, overwriting tmp symlinks |
2256 |
# Get a sane bash, overwriting tmp symlinks |
2150 |
pre_emerge_pkgs "" "app-shells/bash" || return 1 |
2257 |
without_stack_emerge_pkgs "" "app-shells/bash" || return 1 |
|
|
2258 |
ln -s "${ROOT}"/bin/bash "${ROOT}"/usr/bin/bash |
2151 |
|
2259 |
|
2152 |
# now we have a shell right there |
2260 |
# now we have a shell right there |
2153 |
unset CONFIG_SHELL |
2261 |
unset CONFIG_SHELL |
Lines 2169-2175
bootstrap_stage3() {
Link Here
|
2169 |
# OSX, confusing the buildsystem |
2277 |
# OSX, confusing the buildsystem |
2170 |
ac_cv_c_decl_report=warning \ |
2278 |
ac_cv_c_decl_report=warning \ |
2171 |
TIME_T_32_BIT_OK=yes \ |
2279 |
TIME_T_32_BIT_OK=yes \ |
2172 |
pre_emerge_pkgs "" "${pkgs[@]}" || return 1 |
2280 |
without_stack_emerge_pkgs "" "${pkgs[@]}" || return 1 |
2173 |
|
2281 |
|
2174 |
if [[ ! -x "${ROOT}"/sbin/openrc-run ]]; then |
2282 |
if [[ ! -x "${ROOT}"/sbin/openrc-run ]]; then |
2175 |
echo "We need openrc-run at ${ROOT}/sbin to merge rsync." \ |
2283 |
echo "We need openrc-run at ${ROOT}/sbin to merge rsync." \ |
Lines 2188-2193
bootstrap_stage3() {
Link Here
|
2188 |
# Switch to the proper portage. |
2296 |
# Switch to the proper portage. |
2189 |
hash -r |
2297 |
hash -r |
2190 |
|
2298 |
|
|
|
2299 |
if false; then |
2191 |
# Update the portage tree. |
2300 |
# Update the portage tree. |
2192 |
estatus "stage3: updating Portage tree" |
2301 |
estatus "stage3: updating Portage tree" |
2193 |
treedate=$(date -f "${PORTDIR}"/metadata/timestamp +%s) |
2302 |
treedate=$(date -f "${PORTDIR}"/metadata/timestamp +%s) |
Lines 2201-2206
bootstrap_stage3() {
Link Here
|
2201 |
else |
2310 |
else |
2202 |
emerge --color n --sync || emerge-webrsync || return 1 |
2311 |
emerge --color n --sync || emerge-webrsync || return 1 |
2203 |
fi |
2312 |
fi |
|
|
2313 |
fi |
2204 |
|
2314 |
|
2205 |
# Avoid installing git or encryption just for fun while completing @system |
2315 |
# Avoid installing git or encryption just for fun while completing @system |
2206 |
# e.g. bug #901101 |
2316 |
# e.g. bug #901101 |
Lines 3233-3239
case ${CHOST} in
Link Here
|
3233 |
case ${DARWIN_USE_GCC} in |
3343 |
case ${DARWIN_USE_GCC} in |
3234 |
yes|true|1) DARWIN_USE_GCC=1 ;; |
3344 |
yes|true|1) DARWIN_USE_GCC=1 ;; |
3235 |
no|false|0) DARWIN_USE_GCC=0 ;; |
3345 |
no|false|0) DARWIN_USE_GCC=0 ;; |
3236 |
*) DARWIN_USE_GCC=1 ;; # default to GCC build |
3346 |
*) DARWIN_USE_GCC=0 ;; # default to GCC build |
3237 |
esac |
3347 |
esac |
3238 |
;; |
3348 |
;; |
3239 |
*) |
3349 |
*) |