git: ca0ca0a01359 - main - devel/build2: fix build with libc++ >= 20
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 01 Feb 2026 19:55:27 UTC
The branch main has been updated by dim:
URL: https://cgit.FreeBSD.org/ports/commit/?id=ca0ca0a01359fe5acccf5a21c4acd2ceceefbd7a
commit ca0ca0a01359fe5acccf5a21c4acd2ceceefbd7a
Author: Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2026-02-01 19:17:16 +0000
Commit: Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2026-02-01 19:54:59 +0000
devel/build2: fix build with libc++ >= 20
With libc++ 20 or higher devel/build2 fails to build, with errors
similar to:
In file included from libbuild2/utility.cxx:27:
./libbuild2/script/regex.hxx:620:10: error: 'make_unsigned' cannot be specialized: Users are not allowed to specialize this standard library entity [-Winvalid-specialization]
620 | struct make_unsigned<build2::script::regex::line_char>
| ^
/usr/include/c++/v1/__type_traits/make_unsigned.h:75:8: note: marked '_Clang::no_specializations' here
75 | struct _LIBCPP_NO_SPECIALIZATIONS make_unsigned {
| ^
/usr/include/c++/v1/__config:1167:9: note: expanded from macro '_LIBCPP_NO_SPECIALIZATIONS'
Upstream committed a fix for this in
https://github.com/build2/build2/commit/7cf9cec, so add that as a patch
file.
PR: 292867
Approved by: fuz (maintainer)
MFH: 2026Q1
---
.../files/patch-build2_libbuild2_script_regex.hxx | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/devel/build2/files/patch-build2_libbuild2_script_regex.hxx b/devel/build2/files/patch-build2_libbuild2_script_regex.hxx
new file mode 100644
index 000000000000..11abe3d274c0
--- /dev/null
+++ b/devel/build2/files/patch-build2_libbuild2_script_regex.hxx
@@ -0,0 +1,19 @@
+--- build2/libbuild2/script/regex.hxx.orig 2022-12-16 05:41:50 UTC
++++ build2/libbuild2/script/regex.hxx
+@@ -616,11 +616,16 @@ namespace std
+ // to use as an index in some internal cache regardless if the cache is used
+ // for this specialization (and the cache is used only if CharT is char).
+ //
++ // Note that starting with libc++ 20 we get -Winvalid-specialization for
++ // this specialization. But luckily it doesn't seem to be necessary.
++ //
++#if !defined(_LIBCPP_VERSION) || _LIBCPP_VERSION < 20000
+ template <>
+ struct make_unsigned<build2::script::regex::line_char>
+ {
+ using type = build2::script::regex::line_char;
+ };
++#endif
+
+ // When used with libc++ the linker complains that it can't find
+ // __match_any_but_newline<line_char>::__exec() function. The problem is