Skip to content

0.20.0: a SYCL build has one C++ runtime, libstdc++ - #51

Open
Sunrisepeak wants to merge 2 commits into
mainfrom
feat/sycl-one-cxx-runtime
Open

Sunrisepeak wants to merge 2 commits into
mainfrom
feat/sycl-one-cxx-runtime

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

0.20.0: a SYCL build has one C++ runtime, and it is libstdc++ (mcpp-community/mcpp#841, mcpp#838).

libsycl.so throws sycl::exception on libstdc++. A typed catch does not match across two C++ runtimes in one process, so 0.19's -l:libstdc++.so.6 beside an llvm build's libc++ let only catch (...) see what the runtime threw. Changes:

  • mcpp.rules.sycl names no C++ library on the link line. On Linux it refuses a build whose C++ library (mcpp::cxx_stdlib()) is not libstdc++, before any unit is compiled, and names both remedies (gcc.libstdcxx beside llvm, or a gcc toolchain). --gcc-install-dir follows the build's own GCC, in this order: the graph's supplier (MCPP_CXX_ABI_ROOT, read from the environment so the rule still compiles on older engines), the gcc toolchain's payload, then the xim:gcc the rule declares.
  • tests/sycl-consumer declares gcc.libstdcxx and the runtime adapter under cfg(accelerator = "sycl"), so the CPU variant (--no-accel) keeps llvm's libc++.
  • Docs (docs/rules.md), version 0.20.0. CI runs mcpp 2026.10.26.1.

Measured locally with dpcpp 7.1.0:

  • llvm + gcc.libstdcxx: builds and runs.
  • gcc: builds and runs.
  • llvm without a supplier: refused, with both remedies.
  • --no-accel: builds and runs on libc++.

The SYCL consumer needs gcc.libstdcxx from mcpplibs/mcpp-index#568.

Co-authored-by: speak-agent 248744407+speak-agent@users.noreply.github.com

Sunrisepeak and others added 2 commits October 26, 2026 07:43
libsycl.so throws sycl::exception on libstdc++, and a typed catch does not match
across two C++ runtimes in one process (mcpp-community/mcpp#838). The rule put
-l:libstdc++.so.6 beside the libc++ an llvm build links; it now names no C++
library, refuses a build whose C++ library is not libstdc++ with both remedies
(gcc.libstdcxx beside llvm, or a gcc toolchain), and points --gcc-install-dir at
the build's own GCC: the graph's supplier (MCPP_CXX_ABI_ROOT), the gcc
toolchain's payload, or the xim:gcc it declares. The SYCL consumer takes
gcc.libstdcxx and the runtime adapter under the accelerator, so the CPU variant
keeps libc++.

Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
The consumers, the editor lane and the bootstrap run mcpp 2026.10.26.1, which the
SYCL consumer's llvm build over gcc.libstdcxx needs.

Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant