@@ -1337,6 +1337,7 @@ bootstrap_coreutils() {
1337
1337
# 8.16 is the last version released as tar.gz
1338
1338
# 8.18 is necessary for macOS High Sierra (darwin17) and converted
1339
1339
# to tar.gz for this case
1340
+ bootstrap_gnu coreutils 9.5 || \
1340
1341
bootstrap_gnu coreutils 8.32 || bootstrap_gnu coreutils 8.30 || \
1341
1342
bootstrap_gnu coreutils 8.16 || bootstrap_gnu coreutils 8.17
1342
1343
}
@@ -1825,7 +1826,7 @@ do_emerge_pkgs() {
1825
1826
" -qtegrity" # portage-utils
1826
1827
" -readline" # bash
1827
1828
" -sanitize"
1828
- " bootstrap"
1829
+ " system- bootstrap"
1829
1830
" clang"
1830
1831
" internal-glib"
1831
1832
)
@@ -2041,19 +2042,33 @@ bootstrap_stage2() {
2041
2042
emerge_pkgs --nodeps " ${pkg} " || return 1
2042
2043
done
2043
2044
2045
+ # GCC doesn't respect CPPFLAGS because of its own meddling as well
2046
+ # as toolchain.eclass, so provide a wrapper here to force just
2047
+ # installed packages to be found
2048
+ mkdir -p " ${ROOT} " /tmp/usr/local/bin
2049
+ rm -f " ${ROOT} " /tmp/usr/local/bin/my{gcc,g++}
2050
+ cat > " ${ROOT} /tmp/usr/local/bin/mygcc" << -EOS
2051
+ #!/usr/bin/env sh
2052
+ exec ${CC} "\$ @" ${CPPFLAGS}
2053
+ EOS
2054
+ cat > " ${ROOT} /tmp/usr/local/bin/myg++" << -EOS
2055
+ #!/usr/bin/env sh
2056
+ exec ${CXX} "\$ @" ${CPPFLAGS}
2057
+ EOS
2058
+ chmod 755 " ${ROOT} /tmp/usr/local/bin/my" {gcc,g++}
2059
+
2044
2060
for pkg in ${compiler_stage1} ; do
2045
2061
# <glibc-2.5 does not understand .gnu.hash, use
2046
2062
# --hash-style=both to produce also sysv hash.
2047
2063
# GCC apparently drops CPPFLAGS at some point, which makes it
2048
2064
# not find things like gmp which we just installed, so force it
2049
2065
# to find our prefix
2050
- # For >=gcc-12.2.0, rpath needs to be disabled in stage2 on
2051
- # Darwin, see above.
2052
- EXTRA_ECONF=" --disable-bootstrap $( rapx --with-linker-hash-style=both) --with-local-prefix=${ROOT} ${disable_darwin_rpath} " \
2066
+ EXTRA_ECONF=" $( rapx --with-linker-hash-style=both) --with-local-prefix=${ROOT} " \
2053
2067
MYCMAKEARGS=" -DCMAKE_USE_SYSTEM_LIBRARY_LIBUV=OFF" \
2054
2068
GCC_MAKE_TARGET=all \
2069
+ OVERRIDE_CFLAGS=" ${CPPFLAGS} ${OVERRIDE_CFLAGS} " \
2055
2070
OVERRIDE_CXXFLAGS=" ${CPPFLAGS} ${OVERRIDE_CXXFLAGS} " \
2056
- TPREFIX= " ${ROOT} " \
2071
+ CC=mygcc CXX=myg++ \
2057
2072
PYTHON_COMPAT_OVERRIDE=python$( python_ver) \
2058
2073
emerge_pkgs --nodeps " ${pkg} " || return 1
2059
2074
@@ -2134,7 +2149,7 @@ bootstrap_stage3() {
2134
2149
# At this point, we should have a proper GCC, and don't need to
2135
2150
# rely on the system wrappers. Let's get rid of them, so that
2136
2151
# they stop mucking up builds.
2137
- rm -f " ${ROOT} " /tmp/usr/local/bin/*
2152
+ rm -f " ${ROOT} " /tmp/usr/local/bin/{,my, ${CHOST} -}{gcc,g++}
2138
2153
2139
2154
configure_toolchain || return 1
2140
2155
0 commit comments