Merge changes from topic "remove_ndk_platform"

* changes:
  *-ndk.so libraries are added to VndkMustUseVendorVariantList
  Reland: Add more target-specific properties
This commit is contained in:
Jiyong Park
2021-07-27 01:01:58 +00:00
committed by Gerrit Code Review
3 changed files with 43 additions and 7 deletions

View File

@@ -189,6 +189,11 @@ type BaseCompilerProperties struct {
// variant of the C/C++ module.
Cflags []string
}
Platform struct {
// List of additional cflags that should be used to build the platform
// variant of the C/C++ module.
Cflags []string
}
}
Proto struct {
@@ -310,6 +315,7 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps
CheckBadCompilerFlags(ctx, "product.cflags", compiler.Properties.Target.Product.Cflags)
CheckBadCompilerFlags(ctx, "recovery.cflags", compiler.Properties.Target.Recovery.Cflags)
CheckBadCompilerFlags(ctx, "vendor_ramdisk.cflags", compiler.Properties.Target.Vendor_ramdisk.Cflags)
CheckBadCompilerFlags(ctx, "platform.cflags", compiler.Properties.Target.Platform.Cflags)
esc := proptools.NinjaAndShellEscapeList
@@ -502,6 +508,9 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps
if ctx.inVendorRamdisk() {
flags.Local.CFlags = append(flags.Local.CFlags, esc(compiler.Properties.Target.Vendor_ramdisk.Cflags)...)
}
if !ctx.useSdk() {
flags.Local.CFlags = append(flags.Local.CFlags, esc(compiler.Properties.Target.Platform.Cflags)...)
}
// We can enforce some rules more strictly in the code we own. strict
// indicates if this is code that we can be stricter with. If we have

View File

@@ -19,49 +19,61 @@ package config
// has VndkUseCoreVariant set.
// TODO(b/150578172): clean up unstable and non-versioned aidl module
var VndkMustUseVendorVariantList = []string{
"android.hardware.authsecret-unstable-ndk_platform",
"android.hardware.authsecret-ndk_platform",
"android.hardware.authsecret-V1-ndk",
"android.hardware.authsecret-V1-ndk_platform",
"android.hardware.automotive.occupant_awareness-ndk_platform",
"android.hardware.authsecret-ndk_platform",
"android.hardware.authsecret-unstable-ndk_platform",
"android.hardware.automotive.occupant_awareness-V1-ndk",
"android.hardware.automotive.occupant_awareness-V1-ndk_platform",
"android.hardware.health.storage-V1-ndk_platform",
"android.hardware.health.storage-ndk_platform",
"android.hardware.health.storage-unstable-ndk_platform",
"android.hardware.light-V1-ndk_platform",
"android.hardware.light-ndk_platform",
"android.hardware.identity-V2-ndk_platform",
"android.hardware.identity-ndk_platform",
"android.hardware.nfc@1.2",
"android.hardware.light-V1-ndk",
"android.hardware.light-V1-ndk_platform",
"android.hardware.light-ndk_platform",
"android.hardware.memtrack-V1-ndk",
"android.hardware.memtrack-V1-ndk_platform",
"android.hardware.memtrack-ndk_platform",
"android.hardware.memtrack-unstable-ndk_platform",
"android.hardware.nfc@1.2",
"android.hardware.oemlock-V1-ndk",
"android.hardware.oemlock-V1-ndk_platform",
"android.hardware.oemlock-ndk_platform",
"android.hardware.oemlock-unstable-ndk_platform",
"android.hardware.power-V1-ndk_platform",
"android.hardware.power-ndk_platform",
"android.hardware.rebootescrow-V1-ndk",
"android.hardware.rebootescrow-V1-ndk_platform",
"android.hardware.power.stats-V1-ndk",
"android.hardware.power.stats-V1-ndk_platform",
"android.hardware.power.stats-ndk_platform",
"android.hardware.power.stats-unstable-ndk_platform",
"android.hardware.rebootescrow-ndk_platform",
"android.hardware.security.keymint-V1-ndk",
"android.hardware.security.keymint-V1-ndk_platform",
"android.hardware.security.keymint-ndk_platform",
"android.hardware.security.keymint-unstable-ndk_platform",
"android.hardware.security.secureclock-V1-ndk",
"android.hardware.security.secureclock-V1-ndk_platform",
"android.hardware.security.secureclock-unstable-ndk_platform",
"android.hardware.security.secureclock-ndk_platform",
"android.hardware.security.secureclock-unstable-ndk_platform",
"android.hardware.security.sharedsecret-V1-ndk",
"android.hardware.security.sharedsecret-V1-ndk_platform",
"android.hardware.security.sharedsecret-ndk_platform",
"android.hardware.security.sharedsecret-unstable-ndk_platform",
"android.hardware.vibrator-V1-ndk_platform",
"android.hardware.vibrator-ndk_platform",
"android.hardware.weaver-V1-ndk",
"android.hardware.weaver-V1-ndk_platform",
"android.hardware.weaver-ndk_platform",
"android.hardware.weaver-unstable-ndk_platform",
"android.system.keystore2-V1-ndk",
"android.system.keystore2-V1-ndk_platform",
"android.system.keystore2-ndk_platform",
"android.system.keystore2-unstable-ndk_platform",
"android.system.suspend-V1-ndk",
"android.system.suspend-V1-ndk_platform",
"libbinder",
"libcrypto",

View File

@@ -105,6 +105,10 @@ type BaseLinkerProperties struct {
// product variant of the C/C++ module.
Static_libs []string
// list of ehader libs that only should be used to build vendor or product
// variant of the C/C++ module.
Header_libs []string
// list of shared libs that should not be used to build vendor or
// product variant of the C/C++ module.
Exclude_shared_libs []string
@@ -173,6 +177,14 @@ type BaseLinkerProperties struct {
// in most cases the same libraries are available for the SDK and platform
// variants.
Shared_libs []string
// list of ehader libs that only should be used to build platform variant of
// the C/C++ module.
Header_libs []string
// list of shared libs that should not be used to build the platform variant
// of the C/C++ module.
Exclude_shared_libs []string
}
Apex struct {
// list of shared libs that should not be used to build the apex variant of
@@ -284,6 +296,7 @@ func (linker *baseLinker) linkerDeps(ctx DepsContext, deps Deps) Deps {
deps.ReexportSharedLibHeaders = removeListFromList(deps.ReexportSharedLibHeaders, linker.Properties.Target.Vendor.Exclude_shared_libs)
deps.StaticLibs = append(deps.StaticLibs, linker.Properties.Target.Vendor.Static_libs...)
deps.StaticLibs = removeListFromList(deps.StaticLibs, linker.Properties.Target.Vendor.Exclude_static_libs)
deps.HeaderLibs = append(deps.HeaderLibs, linker.Properties.Target.Vendor.Header_libs...)
deps.HeaderLibs = removeListFromList(deps.HeaderLibs, linker.Properties.Target.Vendor.Exclude_header_libs)
deps.ReexportStaticLibHeaders = removeListFromList(deps.ReexportStaticLibHeaders, linker.Properties.Target.Vendor.Exclude_static_libs)
deps.WholeStaticLibs = removeListFromList(deps.WholeStaticLibs, linker.Properties.Target.Vendor.Exclude_static_libs)
@@ -333,6 +346,8 @@ func (linker *baseLinker) linkerDeps(ctx DepsContext, deps Deps) Deps {
if !ctx.useSdk() {
deps.SharedLibs = append(deps.SharedLibs, linker.Properties.Target.Platform.Shared_libs...)
deps.SharedLibs = removeListFromList(deps.SharedLibs, linker.Properties.Target.Platform.Exclude_shared_libs)
deps.HeaderLibs = append(deps.HeaderLibs, linker.Properties.Target.Platform.Header_libs...)
}
deps.SystemSharedLibs = linker.Properties.System_shared_libs