The Makefile has USE_GCC=12, however the port does not depend on gcc12 and depends on gcc11 instead (see make all-depends-list, see index, see freshports etc.). Since I am now maintaining most of gcc ports, I am going to investigate about why USE_GCC=12 does not work as expected and try to fix it. However, if the port is working fine with gcc11, it is porbably better to set USE_GCC=yes instead (or even better try clang, if it works).
See also make test-gcc, which is probably the most helpful.
I have studied the issue and I discovered that bsd.gcc.mk is fine. The problem is in the port Makefile only: USES=cc-c++11-lib overrides USE_GCC=12 and set USE_GCC=11 instead. You can check it with make -V USE_GCC.
I am also concerned that USES=compiler:foo-bar even determines the version of the compiler to be used. I think it would be better for USES=compiler:foo-bar to determine the range of compiler versions to be used, and let USE_GCC and USE_LLVM determine the final version to be used....
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=b6afd65b60898fb1637061ad7686c30597d1c8e1 commit b6afd65b60898fb1637061ad7686c30597d1c8e1 Author: Muhammad Moinur Rahman <bofh@FreeBSD.org> AuthorDate: 2022-10-27 17:23:55 +0000 Commit: Muhammad Moinur Rahman <bofh@FreeBSD.org> CommitDate: 2022-10-27 17:25:23 +0000 lang/guile: Remove USE_GCC=12 The Makefile has USE_GCC=12, however the port does not depend on gcc12 and depends on gcc11 instead. Somehow the USES=cc-c++11-lib overrides USE_GCC=12 and this port perfectly builds with GCC 11 PR: 265947 Reported by: salvadore lang/guile/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)