gcc13: scope -std=gnu++17 to the build-side compiler only

Putting it in plain CXXFLAGS also handed it to the Redox cross g++, whose
C++ probe then failed during the freestanding stage, before libstdc++
exists:

    configure: error: C++11 is required

libcody -- where the char8_t failures occur -- is compiled by
CXX_FOR_BUILD (the host g++ 16), so CXXFLAGS_FOR_BUILD is the correct
knob and the cross compiler is left alone.
This commit is contained in:
2026-08-03 17:44:19 +03:00
parent 96da04403d
commit 8218c3f5d1
+5 -1
View File
@@ -45,7 +45,11 @@ export gcc_cv_sys_sdt_h=no
# against, and GCC's own build documentation expects the host compiler to be
# driven at the standard the sources use. Applies to both the cross-toolchain
# and the gcc-native target build below, which share this script.
export CXXFLAGS="${CXXFLAGS:+$CXXFLAGS }-std=gnu++17"
# Build-side ONLY. libcody is compiled by CXX_FOR_BUILD (the host g++ 16),
# which is where the char8_t failures occur. Putting -std=gnu++17 into plain
# CXXFLAGS also hands it to the Redox cross g++, whose C++ probe then fails
# during the freestanding stage before libstdc++ exists:
# configure: error: C++11 is required
export CXXFLAGS_FOR_BUILD="${CXXFLAGS_FOR_BUILD:+$CXXFLAGS_FOR_BUILD }-std=gnu++17"
if [ "${COOKBOOK_HOST_SYSROOT}" = "/usr" ]; then