From bc220ca8038cd86db8955261c459b3ba3460a682 Mon Sep 17 00:00:00 2001 From: Yi Kong Date: Wed, 23 Sep 2020 01:39:32 +0800 Subject: [PATCH] Forbid -fwhole_program_vtables -fwhole_program_vtables depends on LTO being enabled. User manually adding this through ldflag will break no LTO build configuration. Test: TreeHugger Change-Id: I557ec57831f01856a467f9567c3e7e25f8a6c566 --- cc/check.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cc/check.go b/cc/check.go index 46328e915..0058b8c06 100644 --- a/cc/check.go +++ b/cc/check.go @@ -38,6 +38,8 @@ func CheckBadCompilerFlags(ctx BaseModuleContext, prop string, flags []string) { ctx.PropertyErrorf(prop, "Illegal flag `%s`", flag) } else if flag == "--coverage" { ctx.PropertyErrorf(prop, "Bad flag: `%s`, use native_coverage instead", flag) + } else if flag == "-fwhole-program-vtables" { + ctx.PropertyErrorf(prop, "Bad flag: `%s`, use whole_program_vtables instead", flag) } else if flag == "-Weverything" { if !ctx.Config().IsEnvTrue("ANDROID_TEMPORARILY_ALLOW_WEVERYTHING") { ctx.PropertyErrorf(prop, "-Weverything is not allowed in Android.bp files. "+