disable rtti by default even for non-bionic builds

With this change, we'll use same the logic to determine whether to
disable RTTI for all targets. Previously, there was no way to disable
RTTI for glibc or musl host builds.

Bug: 341341056
Test: m
Change-Id: I096ddf54314c7692d4a82f549e2071471a6c72f3
This commit is contained in:
Frederick Mayle
2024-06-06 14:55:07 -07:00
parent 3125b75d5d
commit 8e8f8606b8

View File

@@ -549,12 +549,10 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps
flags.Global.CommonFlags = append(flags.Global.CommonFlags, "${config.ExternalCflags}")
}
if tc.Bionic() {
if Bool(compiler.Properties.Rtti) {
flags.Local.CppFlags = append(flags.Local.CppFlags, "-frtti")
} else {
flags.Local.CppFlags = append(flags.Local.CppFlags, "-fno-rtti")
}
if Bool(compiler.Properties.Rtti) {
flags.Local.CppFlags = append(flags.Local.CppFlags, "-frtti")
} else {
flags.Local.CppFlags = append(flags.Local.CppFlags, "-fno-rtti")
}
flags.Global.AsFlags = append(flags.Global.AsFlags, "${config.CommonGlobalAsflags}")