diff --git a/cc/compiler.go b/cc/compiler.go index 2e62b0002..dca6a3c96 100644 --- a/cc/compiler.go +++ b/cc/compiler.go @@ -403,6 +403,10 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps flags.Global.CommonFlags = append(flags.Global.CommonFlags, "-D__ANDROID_RECOVERY__") } + if ctx.inRecovery() || ctx.inRamdisk() || ctx.inVendorRamdisk() { + flags.Global.CommonFlags = append(flags.Global.CommonFlags, "-D__ANDROID_RAMDISK__") + } + if ctx.apexVariationName() != "" { flags.Global.CommonFlags = append(flags.Global.CommonFlags, "-D__ANDROID_APEX__") if ctx.Device() {