https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123366
--- Comment #36 from Mark Millard <markmigm at gmail dot com> --- Created attachment 63605 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=63605&action=edit Temporary FreeBSD lang/gcc16-devel patch for one of the 2 problems For now, for FreeBSD port lang/gcc16-devel . . . This update to files/patch-gcc_configure should fix the incorrect placement of a flags restore line pair in gcc/configure for 20251130, from being like: if . . . . . . saved_CXXFLAGS="$CXXFLAGS" saved_LDFLAGS="$LDFLAGS" . . . fi CXXFLAGS="$saved_CXXFLAGS" LDFLAGS="$saved_LDFLAGS" To being like: if . . . . . . saved_CXXFLAGS="$CXXFLAGS" saved_LDFLAGS="$LDFLAGS" . . . CXXFLAGS="$saved_CXXFLAGS" LDFLAGS="$saved_LDFLAGS" fi In other words ( see comment #12 ): https://gcc.gnu.org/cgit/gcc/commit/?id=56889bfec25e467deedb2750bdae7ec456a8f92c is wrong. (gcc/configure.ac should get such a change upstream as well. But I've not supplied such in the patch for lang/gcc16-devel .) The other of the 2 problems identified (no handling of a null pointer return where such returns are allowed) is not fixed but is hidden because the build happens to no longer return the null pointer value during the build. In other words, this should be enough to be a work around for the FreeBSD OS lang/gcc16-devel context until upstream fixes things. But it is only build tested in my context. Also, the patch makes no attempt to support prior to 20251130 and is only build tested for 20251130 . Unpatched 20251130 code could be used for investigating whatever the fix is for the null pointer handling problem. I do not plan on investigating such.
