Source-Changes-D archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: CVS commit: src/tools/gcc
On 2024-06-16 13:01, matthew green wrote:
"David H. Gutteridge" writes:
Module Name: src
Committed By: gutteridge
Date: Sun Jun 16 16:03:30 UTC 2024
Modified Files:
src/tools/gcc: Makefile
Log Message:
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.)
I can certainly simply revert for now, if you prefer.
I'm a little confused by your answer, as there are pre-existing bits
that already do this or something similar. (Well, or intend to.)
tools/isl/Makefile has:
# XXX this gets lost some how. Not portable.
HOST_CXXFLAGS+= -std=gnu++17
A different example is from tools/Makefile.gmakehost:
# Disable use of pre-compiled headers on Darwin.
BUILD_OSTYPE!= uname -s
HOST_COMPILER_CLANG!= if ${HOST_CC} --version | grep -q -s clang; then
echo yes; else echo no; fi
.if ${HOST_COMPILER_CLANG} == "yes"
HOST_CFLAGS+=-O2 -no-cpp-precomp
.endif
The latter is intended to deal with a different sort of issue, but I
see it as being related in terms of reaching over and injecting its
own HOST_* values. If we say "the host should sort out its own issues",
effectively, then I don't see why that would be there, either. (There
is more like that elsewhere.)
I realize I supplied a "GCC-style" argument that not all compilers
will accept. I don't know what compilers would be viable now other than
GCC and Clang?
The goal is to be able to set different compiler flags on a per
component basis. There could be other components that don't want the
same standard forced (or whatever). To your point, we could have
something that tests and sets a make variable that's conditionally
applied down in a particular component.
Regards,
Dave
Home |
Main Index |
Thread Index |
Old Index