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)
Wed, Oct 23, 12:29 AM
Unknown Object (File)
Oct 20 2024, 4:25 AM
Unknown Object (File)
Oct 20 2024, 4:23 AM
Unknown Object (File)
Oct 2 2024, 5:47 AM
Unknown Object (File)
Sep 24 2024, 3:27 AM
Unknown Object (File)
Sep 21 2024, 12:39 PM
Unknown Object (File)
Sep 17 2024, 9:17 AM
Unknown Object (File)
Sep 12 2024, 10:17 PM
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.