From nobody Wed Apr 23 00:37:47 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 4Zj0ZP0Tc0z5tRlk for ; Wed, 23 Apr 2025 00:38:05 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic315-55.consmr.mail.gq1.yahoo.com (sonic315-55.consmr.mail.gq1.yahoo.com [98.137.65.31]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Zj0ZN4cKGz41MJ for ; Wed, 23 Apr 2025 00:38:04 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1745368683; bh=hb7oU3/fF0patExjyuVh6XHTeP0Gl5B9D/Uch4QET0k=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject:Reply-To; b=QjzqZMxvmLbH1Ryn9gEBwH6hxUsckq10zO1elH8Jk6hjaNLyID6ufKqrPPyecXXVNEkxXb8xTVTaatJdMttALhf58D+24RzLQCqW15Qf379VEzprUMqOr1h7K8NFBjW+eJ2WFN/YIuWS2jpeuEFhoNIxZTcGW4Quscf86X7uqzvIgz6o41OUCISKA/HSIacyGF86SYOIcXsQX4xg+blEsm4vC547anSZ71KEDt4L2dqFiYI2DlNj1/vT7xa7yqdPiqnUjFvxG1EdfAbna5hI2s+5/PRBpEQ/dwTHIUqyfdHvvNfxreDFGoNMnlGV6Jzqk9ybcURlawEJhEwgI3YzuQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1745368683; bh=9RSDe1cWXAe4cM/TJ882NPNZz45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xCxii1w.wtcMYX6u.SvAZVaUx6yNx5YDu9jtH6JQLHuuAZSmISxHpO1UoK RQRpJBNF7rdN8XL7wwI89.04xWbNX94UhAhrlJ84U.yzQr_CefcGnWQ8ZaF9259LZjj9PoyPhRnf ao_Lh7hVXnX5QyqQCmAHDFOtu6pCWHMR885oSV1WkOqIxPI7ZhLPX3bST_puWuiIwew4bzXPwN3H XarnloaKrOFDoGfe9sr4HKNkJ6CNSwBSPjQVSdSuW3FpiVa2ZYIKSerEITTN.itXjR3VnrwpjpB4 jhmDG9yKeDX99aCqO2AP7_m1H8CjgeKYLw.MR0wygbbGhyOOoxtZYq2NjM6qv1K.tZIEUeVA2oKG HzjZ27lW5stjOPbHMM2Pp7FmkD5BKUvTwe8j9MehPrnRNj51.C5HW.plzkl6c2bKBCbfmjUC3bRo nD0_CH780ibCLzZAlzBQQWvpktwCD7oMTv7rf8_AMNYMowG8JN9m3E5JoJ9CtKZl1UIVEbUsMb0U iHJLJiQb5_1McT7iSMscB3Mt1zB6goIeeshuamHXfg8XWtFNaGz6Yb77Pnyw9Vhi90rlzsKHmLxj jL07OY8zVwPhnzcqD3gEdxH4hdBY- X-Sonic-MF: X-Sonic-ID: 48ad2fe5-d86c-4a19-a801-0f7fa89b045b Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.gq1.yahoo.com with HTTP; Wed, 23 Apr 2025 00:38:03 +0000 Received: by hermes--production-gq1-74d64bb7d7-tqd77 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID a8c1921f40bee98ccb69da9dbbc04230; Wed, 23 Apr 2025 00:37:58 +0000 (UTC) Content-Type: text/plain; charset=us-ascii 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 (Mac OS X Mail 16.0 \(3826.500.181.1.5\)) Subject: Re: git: 6527682ab705 - main - src: Use gnu++17 as the default C++ standard From: Mark Millard In-Reply-To: Date: Tue, 22 Apr 2025 17:37:47 -0700 Cc: dev-commits-src-main@freebsd.org, FreeBSD Toolchain Content-Transfer-Encoding: quoted-printable Message-Id: <3DD77870-F475-4B97-9F01-0DA1F5DFCA22@yahoo.com> References: <5B14F0FB-54D8-4FE0-BEFA-C4713DF11B20.ref@yahoo.com> <5B14F0FB-54D8-4FE0-BEFA-C4713DF11B20@yahoo.com> To: John Baldwin X-Mailer: Apple Mail (2.3826.500.181.1.5) X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US] X-Rspamd-Queue-Id: 4Zj0ZN4cKGz41MJ X-Spamd-Bar: ---- On Apr 22, 2025, at 11:40, John Baldwin wrote: > On 4/11/25 13:14, Mark Millard wrote: >> John Baldwin wrote on >> Date: Fri, 11 Apr 2025 13:54:30 UTC : >>> The branch main has been updated by jhb: >>>=20 >>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D6527682ab7058e5023a2a6dea01d51c1= 5dca701f >>>=20 >>> commit 6527682ab7058e5023a2a6dea01d51c15dca701f >>> Author: John Baldwin >>> AuthorDate: 2025-04-11 13:53:50 +0000 >>> Commit: John Baldwin >>> CommitDate: 2025-04-11 13:53:50 +0000 >>>=20 >>> src: Use gnu++17 as the default C++ standard >>>=20 >>> 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. >>>=20 >>> 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. >>>=20 >>> 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. >>>=20 >>> 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. >>>=20 >>> Reviewed by: imp, asomers, dim, emaste >>> Differential Revision: https://reviews.freebsd.org/D49223 >> [The note below is just a thought prompted by this. It applies >> to the prior context as well.] >> As I understand many C++ ports use the system c++ toolchain >> and libc++ to build and operate --and there is only one libc++ >> available in some respects. If that is the case >> . . . >> This ends ends up controlling the C++ library's features for >> any libc++ library material used via any of: >=20 > No, it does not. libc++ is mostly templates and uses many #ifdef's > to provide support for multiple language standards. For the actual > symbols required at runtime, we build libc++ such that it includes > all of them (in particular, we use a higher CXXSTD to build libc++ > itself and have for a long time). Thanks for that note. I had always implicitly assumed that the likes of: /usr/src/lib/clang/llvm.build.mk:CXXSTD?=3D c++17 was in control of that (presuming no explicit override in my builds). I'm unaware of anything documenting that FreeBSD's libc++ .a and .so are based on something that produces what I now find has -std=3Dc++23 in the relevant *o.meta files in my builds, such as in the various: = /usr/obj/BUILDs/main-CA76-dbg-clang/usr/main-src/arm64.aarch64/lib/libc++/= *o.meta I had never thought to double check that. I think that some reference to the difference probably should be documented, even if it mostly points to where to look in the source tree to see the libc++ default if one has a reason to care about the detail. In my current context: # grep -r -B4 -A1 'CXXSTD.*=3D' /usr/src/lib/libc++/ | more /usr/src/lib/libc++/Makefile-.if ${COMPILER_TYPE} =3D=3D "gcc" && = ${COMPILER_VERSION} < 130000 /usr/src/lib/libc++/Makefile-# NOTE: gcc 12 cannot correctly compile all = libc++'s C++23 code. To temporarily /usr/src/lib/libc++/Makefile-# support gcc 12, compile libc++ in C++20 = mode, but this will leave out any /usr/src/lib/libc++/Makefile-# C++23 features. /usr/src/lib/libc++/Makefile:CXXSTD?=3D c++20 /usr/src/lib/libc++/Makefile-.else /usr/src/lib/libc++/Makefile:CXXSTD?=3D c++23 /usr/src/lib/libc++/Makefile-.endif Part of the point of documenting such is to note that the likes of: /usr/src/lib/clang/llvm.build.mk:CXXSTD?=3D c++17 does not, of itself, override what is in: /usr/src/lib/libc++/Makefile I'll note that there have been a time or two when libc++ did not include everything and I prompted for something to be enabled that was from the C++ standard and the LLVM was supporting it but FreeBSD was missing it. So I was unsure of that aspect as well. "Everything" also gets into if -fexperimental-library should cause anything contribute to libc++'s .a and .so files. (Hopefully such is all header-only material.) LLVM has even finished something but forgotten to remove needing the -fexperimental-library enablement. LLVM19 and jthread is an example. (LLVM20 finally removes the need for -fexperimental-library use.) I'm not claiming that -fexperimental-library would be a good idea if any of it would contribute to the .a and..or .so . But I know that there are ports dependent on partial implementations that -fexperimental-library provides (if libc++ is to be used). > So, no, this doesn't change > anything in libc++ itself. Understood: LIBCXX_ABI_VERSION based for compatibility, avoiding LIBCXX_ABI_UNSTABLE use. > It merely changes the default C++ > environment when using bsd.*.mk. >=20 > The same is true of libstdc++ use by GCC. It also supports the > full range of C++ versions in the dynamic library and does not > require separate builds for different C++ versions. Seems to be: GCC 3.4.0: libstdc++.so.6.0.0 and later so far (ignoring the GCC 4.2.1: libstdc++.so.6.0.9 temporary mistake). Thanks again, Mark =3D=3D=3D Mark Millard marklmi at yahoo.com