diff --git a/bazel/cc_toolchains/cc_toolchain_cpp_features.bzl b/bazel/cc_toolchains/cc_toolchain_cpp_features.bzl index 29c1105ed4c1..44a243f4cb5e 100644 --- a/bazel/cc_toolchains/cc_toolchain_cpp_features.bzl +++ b/bazel/cc_toolchains/cc_toolchain_cpp_features.bzl @@ -67,6 +67,7 @@ clang_feature = feature( actions = ACTION_NAME_GROUPS.all_cpp_compile_actions, flag_groups = [flag_group(flags = [ "-fno-exceptions", + "-fno-rtti", "-std=c++20", ])], ), diff --git a/toolchain/install/BUILD b/toolchain/install/BUILD index 0e418c994adf..5d445c0ae72f 100644 --- a/toolchain/install/BUILD +++ b/toolchain/install/BUILD @@ -574,6 +574,9 @@ cc_library( # than the client (our toolchain) uses, even though they both include # the same headers from the libraries. "-fexceptions", + # Like exceptions, these libraries are built internally with RTTI + # enabled, while the toolchain is built without. + "-frtti", ], hdrs_check = "strict", includes = [