Haiku itself is not built with the compiler from the haikuports recipe. It is built from the compiler in the buildtools repository. I am not sure why we maintain that, since it seems possible to build everything with the one from the recipe, but that’s how it is now.
Update the buildtools repository with current gcc and binutils sources, making sure to preserve any haiku specific patches that could be there. The repository is not structured in a way that makes this easy.
Once you have updated this repository, use the configure script from Haiku to build a compiler from it
Build Haiku using that compiler
Report any problems you find. Does it compile? Does it boot?
Or alternatively, replace the first step with:
Rewrite the Haiku configure script to not use the buildtools repository and use gcc/binutils sources directly
That’s for building Haiku itself with a newer compiler. It should already be possible to enable the gcc11 recipe on haikuports side, and start using it for some applications? We may get in trouble as mixing various libstdc++ versions usually don’t go so well, however.