diff options
Diffstat (limited to 'cc')
-rw-r--r-- | cc/check.go | 2 | ||||
-rw-r--r-- | cc/compiler.go | 20 |
2 files changed, 13 insertions, 9 deletions
diff --git a/cc/check.go b/cc/check.go index fa1926dd4..8e2844f16 100644 --- a/cc/check.go +++ b/cc/check.go @@ -40,6 +40,8 @@ func CheckBadCompilerFlags(ctx BaseModuleContext, prop string, flags []string) { 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 == "-gsplit-dwarf" { + ctx.PropertyErrorf(prop, "Bad flag: `%s`, soong cannot track dependencies to split dwarf debuginfo", flag) } else if flag == "-fno-integrated-as" { ctx.PropertyErrorf("Bad flag: `%s` is disallowed as it may invoke the `as` from the build host", flag) } else if flag == "-Weverything" { diff --git a/cc/compiler.go b/cc/compiler.go index 396ec886b..a6f623f5b 100644 --- a/cc/compiler.go +++ b/cc/compiler.go @@ -437,18 +437,20 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps flags.Global.CommonFlags = append(flags.Global.CommonFlags, "-D__ANDROID_VNDK__") if ctx.inVendor() { flags.Global.CommonFlags = append(flags.Global.CommonFlags, "-D__ANDROID_VENDOR__") - - vendorApiLevel := ctx.Config().VendorApiLevel() - if vendorApiLevel == "" { - // TODO(b/314036847): This is a fallback for UDC targets. - // This must be a build failure when UDC is no longer built - // from this source tree. - vendorApiLevel = ctx.Config().PlatformSdkVersion().String() - } - flags.Global.CommonFlags = append(flags.Global.CommonFlags, "-D__ANDROID_VENDOR_API__="+vendorApiLevel) } else if ctx.inProduct() { flags.Global.CommonFlags = append(flags.Global.CommonFlags, "-D__ANDROID_PRODUCT__") } + + // Define __ANDROID_VENDOR_API__ for both product and vendor variants + // because they both use the same LLNDK libraries. + vendorApiLevel := ctx.Config().VendorApiLevel() + if vendorApiLevel == "" { + // TODO(b/314036847): This is a fallback for UDC targets. + // This must be a build failure when UDC is no longer built + // from this source tree. + vendorApiLevel = ctx.Config().PlatformSdkVersion().String() + } + flags.Global.CommonFlags = append(flags.Global.CommonFlags, "-D__ANDROID_VENDOR_API__="+vendorApiLevel) } if ctx.inRecovery() { |