If WITHOUT_LIBCPLUSPLUS=YES is set in /etc/src.conf on 13.0-ALPHA1 amd64, the following warning and error are generated: --- all_subdir_usr.bin --- --- all_subdir_usr.bin/dtc --- In file included from /usr/src/usr.bin/dtc/dtc.cc:46: /usr/src/usr.bin/dtc/fdt.hh:37:10: fatal error: 'algorithm' file not found #include <algorithm> ^~~~~~~~~~~ ... --- netstat.o --- cc -target x86_64-unknown-freebsd13.0 --sysroot=/usr/obj/usr/src/amd64.amd64/tmp -B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin -O2 -pipe -fno-common -DNDEBUG -MD -MF.depend.netstat.o -MTnetstat.o -std=gnu99 -Wno-format-zero-length -nobuiltininc -idirafter /usr/lib/clang/10.0.1/include -Qunused-arguments -c /usr/src/usr.bin/systat/netstat.c -o netstat.o --- all_subdir_usr.sbin --- --- all_subdir_usr.sbin/periodic --- --- all_subdir_usr.sbin/periodic/etc/daily --- ===> usr.sbin/periodic/etc/daily (all) --- all_subdir_usr.bin --- --- all_subdir_usr.bin/procstat --- --- procstat_pwdx.o --- --- all_subdir_usr.bin/dtc --- *** [dtc.o] Error code 1 make[4]: stopped in /usr/src/usr.bin/dtc The following syntax appears to resolve the issue: diff --git a/usr.bin/Makefile b/usr.bin/Makefile index 8ea3b1c2bfe3..8e32e82bdc0f 100644 --- a/usr.bin/Makefile +++ b/usr.bin/Makefile @@ -212,9 +212,12 @@ SUBDIR.${MK_GAMES}+= number SUBDIR.${MK_GAMES}+= pom SUBDIR.${MK_GAMES}+= primes SUBDIR.${MK_GAMES}+= random +.if ${MK_LIBCPLUSPLUS} != "no" +#.if ${COMPILER_FEATURES:Mc++11} || ${MK_LIBCPLUSPLUS} != "no" .if ${COMPILER_FEATURES:Mc++11} SUBDIR+= dtc .endif +.endif .if ${MK_GH_BC} == "yes" SUBDIR+= gh-bc .else This syntax, commented out, did not resolve the issue, but is included should someone be able to combine the two conditions: +#.if ${COMPILER_FEATURES:Mc++11} || ${MK_LIBCPLUSPLUS} != "no"
See also https://reviews.freebsd.org/D27974
THAT is great news! Make it so!
Being dtc related, this fix would need to be conditional on ARM platforms.
IMO the check should be MK_CXX, since this is not related to libc++ vs libstdc++ but rather having a C++ compiler plus standard library. Since C++11 is required now, we could change: .if ${COMPILER_FEATURES:Mc++11} SUBDIR+= dtc .endif to SUBDIR.${MK_CXX}+= dtc
https://reviews.freebsd.org/D28234
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=c1a3d7f20696ab5b72eee45863f3e04410d81fc8 commit c1a3d7f20696ab5b72eee45863f3e04410d81fc8 Author: Alex Richardson <arichardson@FreeBSD.org> AuthorDate: 2021-01-19 15:05:43 +0000 Commit: Alex Richardson <arichardson@FreeBSD.org> CommitDate: 2021-01-19 21:37:36 +0000 Remove remaining uses of ${COMPILER_FEATURES:Mc++11} All supported compilers have C++11 support so these checks can be replaced with MK_CXX guards. See also https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252759 PR: 252759 Reviewed By: emaste Differential Revision: https://reviews.freebsd.org/D28234 lib/libc/tests/stdlib/Makefile | 2 -- lib/ofed/libibnetdisc/Makefile | 2 -- usr.bin/Makefile | 4 +--- usr.sbin/Makefile | 4 +--- 4 files changed, 2 insertions(+), 10 deletions(-)
Should be fixed now that https://reviews.freebsd.org/D28234 and https://reviews.freebsd.org/D27974 have been committed.