Index | Thread | Search

From:
c2qd <c2qd@proton.me>
Subject:
PATCH: libcxx: Update PSTL backend macros to match new names
To:
"tech@openbsd.org" <tech@openbsd.org>
Date:
Sun, 01 Feb 2026 15:32:31 +0000

Download raw body.

Thread
  • c2qd:

    PATCH: libcxx: Update PSTL backend macros to match new names

Hello,
Currently, C++ code that includes <syncstream> fails to compile on
OpenBSD 7.8-release(amd64) with
'/usr/include/c++/v1/__pstl/backend_fwd.h:63:4: error:
"Invalid PSTL backend configuration'.

The root cause is a naming mismatch for PSTL (Parallel STL) backend
macros in gnu/lib/libcxx/include/c++/v1/__config_site. 


Upstream libc++ renamed these macros in the following commit:
https://github.com/llvm/llvm-project/commit/d423d80

Specifically, the "_CPU" part was removed or changed:
_LIBCPP_PSTL_CPU_BACKEND_SERIAL -> _LIBCPP_PSTL_BACKEND_SERIAL
_LIBCPP_PSTL_CPU_BACKEND_THREAD -> _LIBCPP_PSTL_BACKEND_STD_THREAD
_LIBCPP_PSTL_CPU_BACKEND_LIBDISPATCH -> _LIBCPP_PSTL_BACKEND_LIBDISPATCH

Since our __config_site still uses the old names, internal headers
like __pstl/backend_fwd.h fail to find a valid configuration,
triggering a #error "Invalid PSTL backend configuration".

Example of the failure:
$ cat a.cpp
#include <syncstream>

int main(){}
$ clang++ -std=c++20 -fexperimental-library -L/usr/local/llvm19/lib a.cpp
...
/usr/include/c++/v1/__pstl/backend_fwd.h:63:4: error:
"Invalid PSTL backend configuration"
63 | #  error "Invalid PSTL backend configuration"
|    ^
...

The attached patch updates __config_site to use the current macro names.
I've verified that this fix allows <syncstream> to be included and
correctly identifies the thread backend.

-c2qd

Index: gnu/lib/libcxx/include/c++/v1/__config_site
===================================================================
RCS file: /cvs/src/gnu/lib/libcxx/include/c++/v1/__config_site,v
diff -u -p -u -r1.3 __config_site
--- gnu/lib/libcxx/include/c++/v1/__config_site	21 Aug 2025 15:26:58 -0000	1.3
+++ gnu/lib/libcxx/include/c++/v1/__config_site	1 Feb 2026 14:00:08 -0000
@@ -34,9 +34,9 @@
 

 

 // PSTL backends
-/* #undef _LIBCPP_PSTL_CPU_BACKEND_SERIAL */
-#define _LIBCPP_PSTL_CPU_BACKEND_THREAD
-/* #undef _LIBCPP_PSTL_CPU_BACKEND_LIBDISPATCH */
+/* #undef _LIBCPP_PSTL_BACKEND_SERIAL */
+#define _LIBCPP_PSTL_BACKEND_STD_THREAD
+/* #undef _LIBCPP_PSTL_BACKEND_LIBDISPATCH */
 

 // Hardening.
 #define _LIBCPP_HARDENING_MODE_DEFAULT 2