Disable RTTI in the toolchain#7552
Conversation
|
Depends on #7532, start review with these changes (Last updated: 2026-07-22 17:14:15 UTC) |
|
Looks like we use |
|
#7554 removes the |
| ACTION_NAMES.cpp_header_parsing, | ||
| ACTION_NAMES.cpp_module_compile, |
There was a problem hiding this comment.
We should probably keep these. We'd need it for modules to work, and header parsing should give the same error messages.
There was a problem hiding this comment.
These moved up to line 70 (this is in the dependent PR)
| # omit a meaningful cache key as when using the Carbon toolchain we | ||
| # don't need it as it is a hermetic part of Bazel. | ||
| project_features = carbon_project_features(cache_key = ""), | ||
| project_features = carbon_project_features(cache_key = "", toolchain_internals = False), |
There was a problem hiding this comment.
Rather than this workaround, I think we should just fix the runtimes to correctly force these features on. I think this is just about adding -fexceptions and -frtti to the libc++ (and libc++abi) copts:
Those flags should be ordered after the project feature flags, and allow us to re-enable things.
There was a problem hiding this comment.
I see, okay I will look at regenerating patches, or adding another patch (but not today).
There was a problem hiding this comment.
You could also add them explicitly to the two libcxx rules instead of the variable. No patch generation and we already have -w in both for similar reasons so minimally hacky workaround
This reduces object sizes which is desirable for linking speed.
zygoloid did some analysis to determine if any of our code requires RTTI for
dynamic_casthere: #7532 (comment):We use
llvm::printfunctionality, notstd::print, so this doesn't affect our toolchain.