Add "Optimize_for_size" build property
Projects with this property will be aggresively optimized for size. This is useful for large binaries that are rarely executed and performance insensitive (e.g. debugging tools, deprecated libraries). This changeset reduces total system native binary size by 1.1%. Test: presubmit Bug: 342090838 Change-Id: I46a1db0c44e2e7d482b14eca1299f8ad48661d2d
This commit is contained in:
@@ -693,6 +693,10 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps
|
||||
flags.Local.CFlags = append(flags.Local.CFlags, "-fopenmp")
|
||||
}
|
||||
|
||||
if ctx.optimizeForSize() {
|
||||
flags.Local.CFlags = append(flags.Local.CFlags, "-Oz")
|
||||
}
|
||||
|
||||
// Exclude directories from manual binder interface allowed list.
|
||||
//TODO(b/145621474): Move this check into IInterface.h when clang-tidy no longer uses absolute paths.
|
||||
if android.HasAnyPrefix(ctx.ModuleDir(), allowedManualInterfacePaths) {
|
||||
|
Reference in New Issue
Block a user