Page MenuHomeFreeBSD

lang/gcc48: Build with -std=c++11.
ClosedPublic

Authored by jhb on Jul 8 2023, 4:39 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 26, 1:06 AM
Unknown Object (File)
Mar 27 2024, 6:47 PM
Unknown Object (File)
Mar 11 2024, 3:34 PM
Unknown Object (File)
Mar 5 2024, 7:31 PM
Unknown Object (File)
Mar 5 2024, 7:31 PM
Unknown Object (File)
Mar 5 2024, 7:26 PM
Unknown Object (File)
Mar 5 2024, 1:38 AM
Unknown Object (File)
Jan 21 2024, 3:03 AM
Subscribers

Details

Summary

This works around errors from clang from LLVM16 due to -Wregister
warnings that are fatal in the default C++ standard (C++17) used by
clang 16.

Unlike other GCC ports, I was not able to use USE_CXXSTD to add the
relevant flags to CXXFLAGS as the bootstrap build overrode all of
CXXFLAGS. Instead, I had to include the flag in CXX.

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb requested review of this revision.Jul 8 2023, 4:39 PM

Instead, I had to include the flag in CXX.

Unless it's massively used and thus hard (heavy) to patch, shall we try to simply remove the keyword instead of forcing particular C++ standard?

Instead, I had to include the flag in CXX.

Unless it's massively used and thus hard (heavy) to patch, shall we try to simply remove the keyword instead of forcing particular C++ standard?

This port is about to be removed anyway, but I suspect this will only get worse with newer clang versions defaulting to newer C++ versions, whereas this approach should be more future proof against newer clang versions.

this approach should be more future proof against newer clang versions.

I see your point, but OTOH C++ standard does not get bumped very often, and embedding compiler flags into CXX itself looks a bit hackish to my taste. Let me first try to walk through the door rather than the window. :-)

This revision is now accepted and ready to land.Jul 9 2023, 6:41 AM

As we only need to pacify system compiler during the bootstrap, the following change to the gcc/configure is sufficient (i.e. amend the list of existing flags passed to the external compiler):

@@ -6408,7 +6408,7 @@ fi
  loose_warn=
 save_CFLAGS="$CFLAGS"
-for real_option in -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual; do
+for real_option in -W -Wall -Wno-increment-bool -Wno-narrowing -Wno-register -Wwrite-strings -Wcast-qual; do
   # Do the check with the no- prefix removed since gcc silently
   # accepts any -Wno-* option on purpose

This seems cleaner to me than mangling the CXX but I won't insist.