diff --git a/recipes/dev/gcc13/recipe.toml b/recipes/dev/gcc13/recipe.toml index 6e5fa9e3b5..1426ea42b6 100644 --- a/recipes/dev/gcc13/recipe.toml +++ b/recipes/dev/gcc13/recipe.toml @@ -42,15 +42,7 @@ export gcc_cv_sys_sdt_h=no # in libcody/{buffer,client,server}.cc. # # This is not a workaround: C++17 is the dialect this release was written -# 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. -# 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" +# against. Applied in the target branch below, not here -- see the note there. if [ "${COOKBOOK_HOST_SYSROOT}" = "/usr" ]; then # not specifying --enable-shared as it will link shared deps @@ -68,6 +60,17 @@ COOKBOOK_CONFIGURE_FLAGS=( else export CFLAGS_FOR_TARGET="${CPPFLAGS}" CXXFLAGS_FOR_TARGET="${CPPFLAGS}" LDFLAGS_FOR_TARGET="${LDFLAGS}" export CC_FOR_BUILD="$CC_WRAPPER gcc" CXX_FOR_BUILD="$CC_WRAPPER g++" +# GCC 13's sources are C++17. libcody is compiled here by the CROSS compiler -- +# the build log shows +# x86_64-unknown-redox-g++ ... -c -o buffer.o .../libcody/buffer.cc +# because --host is the Redox target -- and that compiler is now GCC 16, which +# defaults to C++20. C++20 changed u8"" literals from const char[] to +# const char8_t[], which libcody uses throughout, so the build collapses with +# error: invalid conversion from 'const char8_t*' to 'const char*' +# Scoped to this branch: the freestanding cross-toolchain branch above must not +# get it, or its C++ probe fails before libstdc++ exists with +# configure: error: C++11 is required +export CXXFLAGS="${CXXFLAGS:+$CXXFLAGS }-std=gnu++17" unset CFLAGS CPPFLAGS LDFLAGS COOKBOOK_CONFIGURE_FLAGS+=( --with-sysroot=/