> Date: Mon, 17 Jun 2024 03:01:55 +1000 > from: matthew green <m...@eterna23.net> > > "David H. Gutteridge" writes: > > Module Name: src > > Committed By: gutteridge > > Date: Sun Jun 16 16:03:30 UTC 2024 > > > > tools/gcc/Makefile: force std=c++11 for GCC 12 builds > > > > GCC >= 11 now requires C++11 to build. Impacted individual components > > vary whether they test for if std=c++11 is the default or has to be > > passed. Regardless, our build infrastructure applies its own overrides. > > Force this setting so that we can still build on NetBSD 8.x hosts (and > > probably 7.x, too). Build tested on NetBSD 8.3. > > i'm not sure i like this. the build environment is expected to > provide a valid compiler, and the above assumes how the compiler > works. > > if we really want to support this without user-env setup, then > i think a confiure test (from tools/compat) would be better than > forcing this option here directly. > > (also note this is not the first time this sort of issue has > arrived, and we always asked the build-env provider to fix it, > but i'm not against eg, the configure test idea.)
How is the host C++ compiler supposed to know that we are asking it to compile C++11 and not C++98 or C++17? gcc's configure scripts search for a way to pass this information to the host compiler (e.g., AX_CXX_COMPILE_STDCXX). I'm fuzzy on how these are supposed to work but it looks like maybe the existing configure tests are not getting used for some reason.