C++20 Support

I would like to make Haiku my main development platform for some of my projects, however I need a C++20 compliant compiler. There are other issues but the compiler is the main blocker. On Linux (SUSE Linux), I am currently using g++ version 10.2.1.

The latest version available in the HaikuDepot is g++ 8.3.0. I took a look at what may be needed to create a new g++ recipe/package and I think I can build something locally.

But what else is needed?

  • Does the current g++ recipe include the linker or is that separate?
  • What about the C++20 compliant headers?

Any help or links to information would be appreciated.

1 Like

I think the binutils recipe provides the linker.

I have tried to bump the GCC recipe to 10.x, but the GCC 8 patches doesn’t applies cleanly anymore, some parts of it should be redone. I applied most of them manually, but then got an error message during compilation, that some variable were poisoned. Now i don’t know too much about the psyché of compilers, so i abandoned the ship.

Good luck, and if it is possible, create a GCC10 recipe and make a PR at HaikuPorts.

Current GCC recipe: https://github.com/haikuports/haikuports/blob/master/sys-devel/gcc/gcc-8.3.0_2019_05_24.recipe
Current GCC patches: https://github.com/haikuports/haikuports/blob/master/sys-devel/gcc/patches/gcc-8.3.0_2019_05_24.patchset
Binutils: https://github.com/haikuports/haikuports/tree/master/sys-devel/binutils

2 Likes

You would try with -std=c++2a on gcc8.x

3 Likes

Thank you for the suggestion. However using the -std=c++2a option with gcc8.x does not support enough of the C++20 for my projects.

Thank you for the links and sharing you past experiences! The information will be useful as I try to get GCC10 work as time allows.

You can use llvm9 - pkgman install cmd:clang_9. It is an alternate compiler to GCC.