From 8218c3f5d199fcbeaa5bffb9d56dfc2a3f53cb20 Mon Sep 17 00:00:00 2001 From: vasilito Date: Mon, 3 Aug 2026 17:44:19 +0300 Subject: [PATCH] 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. --- recipes/dev/gcc13/recipe.toml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/recipes/dev/gcc13/recipe.toml b/recipes/dev/gcc13/recipe.toml index 316b8d43c0..6e5fa9e3b5 100644 --- a/recipes/dev/gcc13/recipe.toml +++ b/recipes/dev/gcc13/recipe.toml @@ -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