-
-
Notifications
You must be signed in to change notification settings - Fork 251
Open
Description
The toolchain will pass in -Xclang -fno-cxx-modules
already when using a recent enough LLVM however it only does this when stdlib == builtin-libc++
. We've found that we need to do this when using GCC's libstdc++ as well.
It's easy enough for us to workaround by passing them in ourselves but perhaps the code in question (linked below) should be lifted out of stdlib conditional?
# With C++20, Clang defaults to using C++ rather than Clang modules,
# which breaks Bazel's `use_module_maps` feature, which is used by
# `layering_check`. Since Bazel doesn't support C++ modules yet, it
# is safe to disable them globally until the toolchain shipped by
# Bazel sets this flag on `use_module_maps`.
# https://github.com/llvm/llvm-project/commit/0556138624edf48621dd49a463dbe12e7101f17d
cxx_flags.append("-Xclang")
cxx_flags.append("-fno-cxx-modules")
Our workaround:
llvm.toolchain(
cxx_flags = {"linux-x86_64": [
"-Xclang",
"-fno-cxx-modules",
]},
llvm_version = "20.1.2",
stdlib = {"linux-x86_64": "stdc++"},
)
xiaopeng-tranxmart
Metadata
Metadata
Assignees
Labels
No labels