From nobody Fri Apr 11 13:54:30 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ZYypt2Ydjz5s3V9; Fri, 11 Apr 2025 13:54:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZYypt1Tbxz40vT; Fri, 11 Apr 2025 13:54:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1744379670; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r8Vq5/Mx/TIg8Po9tsZzhWKLozooqw5DQCoLFSB18I8=; b=P43zbl9xPR+XCgCp0ZCVQleOGbl577wt2Zqtst8k/f43Oegl5q+4E6aL9jwM3D/G9zeubm DHW2cmkTBKLrHiHXpq1EtTuW5MOXrag992STiOYsNCBvwhbSOjxIEivDKqj9hYQocnItoX xaEsXDQtiAWrc2hpAFu+L0jh6vM2KQ1KvAuDWvxjLFcVDIrwktHy/h6cgk33+yiWOW+n7J DwTHm2L2qYA9HaoZPTtxCmk7p1Pfq3uwEnKtkVByGpmFPf8M5FsUK1npQVReTQ+D5IjLff i+FEb8bIELsuVrvFqmiYiD06imXhkQm1cF+uZvJhBp9kN/WG1JXyl/yK87Yc9w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1744379670; a=rsa-sha256; cv=none; b=daANiqvMTgCl923FXXxe38JEefJP0OHJ4Kj2MEjtLN+UJ/vo53VhgE83AmtzfbrWlKVNyq zNTYKJZ3ww5WOSEffFQHnCI1tHreWVK4I0foYQpWL4UV7m1WjstVzpCVJwdafxdt6So+vK htwVLRrTe26Zdy5z75rOQ+DI7muiLPf2hep5aZXgWEFH0HsiaN9fUWcMfqQx1MVb/CH1dL +mwoE3+f+UkabsVsMJYLWpjcRuCY/41YGvrak3YjqwcaYrEVbbrD3urjjnDkHV5AGS63TU GcJoFHz4usUHSb1oCLuOht4toHBv0QQFPLXSchO4bI2JU/nXyrWG5aU771XrRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1744379670; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r8Vq5/Mx/TIg8Po9tsZzhWKLozooqw5DQCoLFSB18I8=; b=BMWEZtVDyvTWctbELiOycF4qoG8zG0+9I/DV6B3IIpwWBsbXsPshUvn7bDNnj0mizcMY4v RVeGgLUmakW/ybWH2vkpbu3Isl7EyH96cDao/Cx2rfRhrnw+nv7TZjbT1HMEHO3GeZJ1xr Dw201iYXzj4byxC2smQteQFG3tNYqI6Vtl+9z0B6ut6f1FgyLKfqJl9NzNt0ipKbZq82zZ 1WMrm5xbLT8ar7S/vGdHX1A1AKrXYi30/8KTfQ5og3T/VyopNrpinfdtL11WzC/X7lpGBm V3FWhNW5Eo4kYZP/jVEmTNcLA1T96hx2Fw2tzKXaufSMGnglIU1Dla2vTOXMPw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ZYypt11pXzbvM; Fri, 11 Apr 2025 13:54:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 53BDsUYj034374; Fri, 11 Apr 2025 13:54:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 53BDsUue034371; Fri, 11 Apr 2025 13:54:30 GMT (envelope-from git) Date: Fri, 11 Apr 2025 13:54:30 GMT Message-Id: <202504111354.53BDsUue034371@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 6527682ab705 - main - src: Use gnu++17 as the default C++ standard List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6527682ab7058e5023a2a6dea01d51c15dca701f Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=6527682ab7058e5023a2a6dea01d51c15dca701f commit 6527682ab7058e5023a2a6dea01d51c15dca701f Author: John Baldwin AuthorDate: 2025-04-11 13:53:50 +0000 Commit: John Baldwin CommitDate: 2025-04-11 13:53:50 +0000 src: Use gnu++17 as the default C++ standard Previously the compiler's default C++ standard was used unlike C where bsd.sys.mk explicitly sets a default language version. Setting an explicit default version will give a more uniform experience across different compilers and compiler versions. gnu++17 was chosen to match the default C standard. It is well supported by a wide range of clang (5+) and GCC (9+) versions. gnu++17 is also the default C++ standard in recent versions of clang (16+) and GCC (11+). As a result, many of the explicit CXXSTD settings in Makefiles had the effect of lowering the C++ standard instead of raising it as was originally intended and are removed. Note that the remaining explicit CXXSTD settings for atf and liblutok explicitly lower the standard to C++11 due to use of the deprecated auto_ptr<> template which is removed in later versions. Reviewed by: imp, asomers, dim, emaste Differential Revision: https://reviews.freebsd.org/D49223 --- lib/clang/llvm.build.mk | 1 - lib/libc/tests/stdlib/Makefile | 2 -- lib/libclang_rt/Makefile.inc | 1 - lib/libcxxrt/Makefile | 1 - lib/libgcc_eh/Makefile.inc | 1 - lib/libomp/Makefile | 1 - lib/ofed/libibnetdisc/Makefile | 1 - libexec/atf/atf-pytest-wrapper/Makefile | 1 - share/mk/bsd.sys.mk | 2 ++ share/mk/googletest.test.inc.mk | 2 -- tests/sys/fs/fusefs/Makefile | 1 - usr.bin/dtc/Makefile | 2 -- usr.sbin/pmc/Makefile | 1 - 13 files changed, 2 insertions(+), 15 deletions(-) diff --git a/lib/clang/llvm.build.mk b/lib/clang/llvm.build.mk index 2520637e2d06..c731deba8976 100644 --- a/lib/clang/llvm.build.mk +++ b/lib/clang/llvm.build.mk @@ -119,7 +119,6 @@ LDFLAGS+= -Wl,-m,elf64lriscv_fbsd .endif .endif -CXXSTD?= c++17 CXXFLAGS+= -fno-exceptions CXXFLAGS+= -fno-rtti .if ${.MAKE.OS} == "FreeBSD" || !defined(BOOTSTRAPPING) diff --git a/lib/libc/tests/stdlib/Makefile b/lib/libc/tests/stdlib/Makefile index 54ac8a5f3b42..15b8d3844d08 100644 --- a/lib/libc/tests/stdlib/Makefile +++ b/lib/libc/tests/stdlib/Makefile @@ -59,8 +59,6 @@ PROGS+= h_getopt h_getopt_long CFLAGS+= -I${.CURDIR} -CXXSTD.cxa_thread_atexit_test= c++11 -CXXSTD.cxa_thread_atexit_nothr_test= c++11 LIBADD.cxa_thread_atexit_test+= pthread # Tests that requires Blocks feature diff --git a/lib/libclang_rt/Makefile.inc b/lib/libclang_rt/Makefile.inc index c472e8b741be..e7db5a469661 100644 --- a/lib/libclang_rt/Makefile.inc +++ b/lib/libclang_rt/Makefile.inc @@ -33,4 +33,3 @@ CXXFLAGS+= -fvisibility-inlines-hidden CXXFLAGS+= -fvisibility=hidden CFLAGS+= -I${CRTSRC}/include CFLAGS+= -I${CRTSRC}/lib -CXXSTD= c++17 diff --git a/lib/libcxxrt/Makefile b/lib/libcxxrt/Makefile index 7a683ba779f6..0f203b3a7cb1 100644 --- a/lib/libcxxrt/Makefile +++ b/lib/libcxxrt/Makefile @@ -23,7 +23,6 @@ SRCS+= typeinfo.cc WARNS?= 0 CFLAGS+= -isystem ${SRCDIR} -nostdinc++ -CXXSTD?= c++14 .if exists(Version.map.${MACHINE}) VERSION_MAP= ${.CURDIR}/Version.map.${MACHINE} diff --git a/lib/libgcc_eh/Makefile.inc b/lib/libgcc_eh/Makefile.inc index af59ee7aaa65..529ef7170485 100644 --- a/lib/libgcc_eh/Makefile.inc +++ b/lib/libgcc_eh/Makefile.inc @@ -38,7 +38,6 @@ CFLAGS+= -I${UNWINDINCDIR} CFLAGS+= -D_LIBUNWIND_IS_NATIVE_ONLY CFLAGS+= -D_LIBUNWIND_USE_FRAME_HEADER_CACHE CXXFLAGS+= -fno-rtti -CXXSTD?= c++11 STATIC_CXXFLAGS+= -fvisibility=hidden -fPIC # Probably need to just move this earlier or use CXXFLAGS .if ${MK_DIRDEPS_BUILD} == "yes" diff --git a/lib/libomp/Makefile b/lib/libomp/Makefile index 6c14c7d21077..f1513e70f3f6 100644 --- a/lib/libomp/Makefile +++ b/lib/libomp/Makefile @@ -57,7 +57,6 @@ CFLAGS+= -fdata-sections CXXFLAGS+= -fvisibility-inlines-hidden CXXFLAGS+= -fno-exceptions CXXFLAGS+= -fno-rtti -CXXSTD= c++17 .if ${COMPILER_TYPE} == "clang" .if ${MACHINE_CPUARCH} == "i386" diff --git a/lib/ofed/libibnetdisc/Makefile b/lib/ofed/libibnetdisc/Makefile index d3e0dd92509a..aac0bf0f5971 100644 --- a/lib/ofed/libibnetdisc/Makefile +++ b/lib/ofed/libibnetdisc/Makefile @@ -29,7 +29,6 @@ LIBADD= osmcomp ibmad ibumad CFLAGS+= -DHAVE_CONFIG_H=1 CFLAGS+= -I${_spath} CFLAGS+= -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/infiniband -CXXSTD= c++11 VERSION_MAP= ${_spath}/libibnetdisc.map .include diff --git a/libexec/atf/atf-pytest-wrapper/Makefile b/libexec/atf/atf-pytest-wrapper/Makefile index e4dc0f8a5fd1..80b5e411ec4e 100644 --- a/libexec/atf/atf-pytest-wrapper/Makefile +++ b/libexec/atf/atf-pytest-wrapper/Makefile @@ -4,7 +4,6 @@ PACKAGE= tests PROG_CXX= atf_pytest_wrapper SRCS= atf_pytest_wrapper.cpp -CXXSTD= c++17 MAN= .include diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 63496e9b8ccd..b8535809e5aa 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -22,6 +22,8 @@ CFLAGS+= -std=iso9899:1999 CFLAGS+= -std=${CSTD} .endif # CSTD +CXXSTD?= gnu++17 + .if !empty(CXXSTD) CXXFLAGS+= -std=${CXXSTD} .endif diff --git a/share/mk/googletest.test.inc.mk b/share/mk/googletest.test.inc.mk index 05415775448b..9ef5a3ceac00 100644 --- a/share/mk/googletest.test.inc.mk +++ b/share/mk/googletest.test.inc.mk @@ -9,6 +9,4 @@ GTESTS_CXXFLAGS+= -frtti # libgmock's, etc, headers. CXXFLAGS+= -I${DESTDIR}${INCLUDEDIR}/private -CXXSTD?= c++14 - NO_WTHREAD_SAFETY= diff --git a/tests/sys/fs/fusefs/Makefile b/tests/sys/fs/fusefs/Makefile index d91199fd519e..06b82071fe31 100644 --- a/tests/sys/fs/fusefs/Makefile +++ b/tests/sys/fs/fusefs/Makefile @@ -89,7 +89,6 @@ CXXFLAGS+= -I${SRCTOP}/tests CXXFLAGS+= -I${FUSEFS} CXXFLAGS+= -I${MOUNT} .PATH: ${MOUNT} -CXXSTD= c++14 LIBADD+= pthread LIBADD+= gmock gtest diff --git a/usr.bin/dtc/Makefile b/usr.bin/dtc/Makefile index 9b1aff13511f..d7661ae164c3 100644 --- a/usr.bin/dtc/Makefile +++ b/usr.bin/dtc/Makefile @@ -6,8 +6,6 @@ WARNS?= 3 CXXFLAGS+= -fno-rtti -fno-exceptions -CXXSTD= c++17 - NO_SHARED?=NO .include diff --git a/usr.sbin/pmc/Makefile b/usr.sbin/pmc/Makefile index 3f73dd398958..02292917ab57 100644 --- a/usr.sbin/pmc/Makefile +++ b/usr.sbin/pmc/Makefile @@ -2,7 +2,6 @@ PROG_CXX= pmc MAN= -CXXSTD= c++14 CWARNFLAGS.gcc+= -Wno-redundant-decls CFLAGS+= -I${SRCTOP}/lib/libpmcstat