Merge "Introduce LTO property for -fwhole-program-vtables cflag"
diff --git a/cc/lto.go b/cc/lto.go
index 9868cdf..e034337 100644
--- a/cc/lto.go
+++ b/cc/lto.go
@@ -52,6 +52,9 @@
// Use clang lld instead of gnu ld.
Use_clang_lld *bool
+
+ // Use -fwhole-program-vtables cflag.
+ Whole_program_vtables *bool
}
type lto struct {
@@ -97,6 +100,10 @@
flags.Local.CFlags = append(flags.Local.CFlags, ltoFlag)
flags.Local.LdFlags = append(flags.Local.LdFlags, ltoFlag)
+ if Bool(lto.Properties.Whole_program_vtables) {
+ flags.Local.CFlags = append(flags.Local.CFlags, "-fwhole-program-vtables")
+ }
+
if ctx.Config().IsEnvTrue("USE_THINLTO_CACHE") && Bool(lto.Properties.Lto.Thin) && lto.useClangLld(ctx) {
// Set appropriate ThinLTO cache policy
cacheDirFormat := "-Wl,--thinlto-cache-dir="