From 8fe14e6a49b472de975aec577c926830e0dcc0c6 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Mon, 19 Oct 2020 22:47:34 +0900 Subject: Enable sdk and sdk members in os_arch granularity This amends Idad7ef138cdbcbd209d390bf6c10ca8365d4619f. With the change, when there is a member that returns IsHostOsDependent() == true, the sdk having the member and the member itself are disable for host and only the os that the member supports is explicitly enabled. However, that change will cause a problem when we add the support for the linux_bionic_arm64 target. The target is not enabled when building sdk snapshots. The only linux_bionic target that is enabled is 'linux_bionic_x86_64'. However, since the granularity is os which is linux_bionic, the snapshot is generated as follows. cc_prebuilt_binary { target: { host: { enabled: false, }, linux_bionic: { enabled: true, }, linux_bionic_x86_64: { srcs: ["x86_64/bin/..."], }, // no srcs for linux_bionic_arm64 }, } Above is a problem for linux_bionic_arm64 target because the target is enabled (via linux_bionic.enabled: true), but srcs is not provided. To fix the problem, the enabling of a target is done in a target (os_arch) granularity, rather than os granularity. For example, above now becomes ... cc_prebuilt_binary { target: { host: { enabled: false, }, linux_bionic_x86_64: { enabled: true, srcs: ["x86_64/bin/..."], }, }, } Only the targets that the snapshot actually can provide srcs are enabled and the rest of the host targets are disabled. Bug: 159685774 Test: m nothing Test: build/soong/scripts/build-aml-prebuilts.sh runtime-module-host-exports Change-Id: Ibca48c40f6dc4628b5f4bfa4ceb68ebe0973cc81 --- sdk/cc_sdk_test.go | 204 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 115 insertions(+), 89 deletions(-) (limited to 'sdk/cc_sdk_test.go') diff --git a/sdk/cc_sdk_test.go b/sdk/cc_sdk_test.go index c214e75c4..c1813ecd0 100644 --- a/sdk/cc_sdk_test.go +++ b/sdk/cc_sdk_test.go @@ -120,10 +120,8 @@ cc_prebuilt_library_shared { android_arm64: { srcs: ["android/arm64/lib/sdkmember.so"], }, - linux_glibc: { - enabled: true, - }, linux_glibc_x86_64: { + enabled: true, srcs: ["linux_glibc/x86_64/lib/sdkmember.so"], }, }, @@ -143,10 +141,8 @@ cc_prebuilt_library_shared { android_arm64: { srcs: ["android/arm64/lib/sdkmember.so"], }, - linux_glibc: { - enabled: true, - }, linux_glibc_x86_64: { + enabled: true, srcs: ["linux_glibc/x86_64/lib/sdkmember.so"], }, }, @@ -162,7 +158,7 @@ sdk_snapshot { host: { enabled: false, }, - linux_glibc: { + linux_glibc_x86_64: { enabled: true, }, }, @@ -670,20 +666,21 @@ cc_prebuilt_binary { enabled: false, }, linux_glibc: { - enabled: true, compile_multilib: "both", }, linux_glibc_x86_64: { + enabled: true, srcs: ["linux_glibc/x86_64/bin/mynativebinary"], }, linux_glibc_x86: { + enabled: true, srcs: ["linux_glibc/x86/bin/mynativebinary"], }, windows: { - enabled: true, compile_multilib: "64", }, windows_x86_64: { + enabled: true, srcs: ["windows/x86_64/bin/mynativebinary.exe"], }, }, @@ -701,20 +698,21 @@ cc_prebuilt_binary { enabled: false, }, linux_glibc: { - enabled: true, compile_multilib: "both", }, linux_glibc_x86_64: { + enabled: true, srcs: ["linux_glibc/x86_64/bin/mynativebinary"], }, linux_glibc_x86: { + enabled: true, srcs: ["linux_glibc/x86/bin/mynativebinary"], }, windows: { - enabled: true, compile_multilib: "64", }, windows_x86_64: { + enabled: true, srcs: ["windows/x86_64/bin/mynativebinary.exe"], }, }, @@ -727,15 +725,20 @@ module_exports_snapshot { host_supported: true, native_binaries: ["myexports_mynativebinary@current"], target: { + windows: { + compile_multilib: "64", + }, host: { enabled: false, }, - linux_glibc: { + linux_glibc_x86_64: { enabled: true, }, - windows: { + linux_glibc_x86: { + enabled: true, + }, + windows_x86_64: { enabled: true, - compile_multilib: "64", }, }, } @@ -811,10 +814,8 @@ cc_prebuilt_binary { host: { enabled: false, }, - linux_bionic: { - enabled: true, - }, linux_bionic_x86_64: { + enabled: true, srcs: ["x86_64/bin/mynativebinary"], }, }, @@ -832,10 +833,8 @@ cc_prebuilt_binary { host: { enabled: false, }, - linux_bionic: { - enabled: true, - }, linux_bionic_x86_64: { + enabled: true, srcs: ["x86_64/bin/mynativebinary"], }, }, @@ -854,10 +853,8 @@ cc_prebuilt_library_shared { host: { enabled: false, }, - linux_bionic: { - enabled: true, - }, linux_bionic_x86_64: { + enabled: true, srcs: ["x86_64/lib/mynativelib.so"], }, }, @@ -875,10 +872,8 @@ cc_prebuilt_library_shared { host: { enabled: false, }, - linux_bionic: { - enabled: true, - }, linux_bionic_x86_64: { + enabled: true, srcs: ["x86_64/lib/mynativelib.so"], }, }, @@ -896,7 +891,7 @@ module_exports_snapshot { host: { enabled: false, }, - linux_bionic: { + linux_bionic_x86_64: { enabled: true, }, }, @@ -952,13 +947,12 @@ cc_prebuilt_binary { host: { enabled: false, }, - linux_glibc: { - enabled: true, - }, linux_glibc_x86_64: { + enabled: true, srcs: ["x86_64/bin/linker"], }, linux_glibc_x86: { + enabled: true, srcs: ["x86/bin/linker"], }, }, @@ -978,13 +972,12 @@ cc_prebuilt_binary { host: { enabled: false, }, - linux_glibc: { - enabled: true, - }, linux_glibc_x86_64: { + enabled: true, srcs: ["x86_64/bin/linker"], }, linux_glibc_x86: { + enabled: true, srcs: ["x86/bin/linker"], }, }, @@ -1000,7 +993,10 @@ module_exports_snapshot { host: { enabled: false, }, - linux_glibc: { + linux_glibc_x86_64: { + enabled: true, + }, + linux_glibc_x86: { enabled: true, }, }, @@ -1345,14 +1341,13 @@ cc_prebuilt_library_shared { host: { enabled: false, }, - linux_glibc: { - enabled: true, - }, linux_glibc_x86_64: { + enabled: true, srcs: ["x86_64/lib/mynativelib.so"], export_include_dirs: ["x86_64/include_gen/mynativelib"], }, linux_glibc_x86: { + enabled: true, srcs: ["x86/lib/mynativelib.so"], export_include_dirs: ["x86/include_gen/mynativelib"], }, @@ -1373,14 +1368,13 @@ cc_prebuilt_library_shared { host: { enabled: false, }, - linux_glibc: { - enabled: true, - }, linux_glibc_x86_64: { + enabled: true, srcs: ["x86_64/lib/mynativelib.so"], export_include_dirs: ["x86_64/include_gen/mynativelib"], }, linux_glibc_x86: { + enabled: true, srcs: ["x86/lib/mynativelib.so"], export_include_dirs: ["x86/include_gen/mynativelib"], }, @@ -1397,7 +1391,10 @@ sdk_snapshot { host: { enabled: false, }, - linux_glibc: { + linux_glibc_x86_64: { + enabled: true, + }, + linux_glibc_x86: { enabled: true, }, }, @@ -1464,20 +1461,21 @@ cc_prebuilt_library_shared { enabled: false, }, linux_glibc: { - enabled: true, compile_multilib: "both", }, linux_glibc_x86_64: { + enabled: true, srcs: ["linux_glibc/x86_64/lib/mynativelib.so"], }, linux_glibc_x86: { + enabled: true, srcs: ["linux_glibc/x86/lib/mynativelib.so"], }, windows: { - enabled: true, compile_multilib: "64", }, windows_x86_64: { + enabled: true, srcs: ["windows/x86_64/lib/mynativelib.dll"], }, }, @@ -1495,20 +1493,21 @@ cc_prebuilt_library_shared { enabled: false, }, linux_glibc: { - enabled: true, compile_multilib: "both", }, linux_glibc_x86_64: { + enabled: true, srcs: ["linux_glibc/x86_64/lib/mynativelib.so"], }, linux_glibc_x86: { + enabled: true, srcs: ["linux_glibc/x86/lib/mynativelib.so"], }, windows: { - enabled: true, compile_multilib: "64", }, windows_x86_64: { + enabled: true, srcs: ["windows/x86_64/lib/mynativelib.dll"], }, }, @@ -1521,15 +1520,20 @@ sdk_snapshot { host_supported: true, native_shared_libs: ["mysdk_mynativelib@current"], target: { + windows: { + compile_multilib: "64", + }, host: { enabled: false, }, - linux_glibc: { + linux_glibc_x86_64: { enabled: true, }, - windows: { + linux_glibc_x86: { + enabled: true, + }, + windows_x86_64: { enabled: true, - compile_multilib: "64", }, }, } @@ -1669,14 +1673,13 @@ cc_prebuilt_library_static { host: { enabled: false, }, - linux_glibc: { - enabled: true, - }, linux_glibc_x86_64: { + enabled: true, srcs: ["x86_64/lib/mynativelib.a"], export_include_dirs: ["x86_64/include_gen/mynativelib"], }, linux_glibc_x86: { + enabled: true, srcs: ["x86/lib/mynativelib.a"], export_include_dirs: ["x86/include_gen/mynativelib"], }, @@ -1696,14 +1699,13 @@ cc_prebuilt_library_static { host: { enabled: false, }, - linux_glibc: { - enabled: true, - }, linux_glibc_x86_64: { + enabled: true, srcs: ["x86_64/lib/mynativelib.a"], export_include_dirs: ["x86_64/include_gen/mynativelib"], }, linux_glibc_x86: { + enabled: true, srcs: ["x86/lib/mynativelib.a"], export_include_dirs: ["x86/include_gen/mynativelib"], }, @@ -1720,7 +1722,10 @@ module_exports_snapshot { host: { enabled: false, }, - linux_glibc: { + linux_glibc_x86_64: { + enabled: true, + }, + linux_glibc_x86: { enabled: true, }, }, @@ -1885,10 +1890,8 @@ cc_prebuilt_library_static { host: { enabled: false, }, - linux_glibc: { - enabled: true, - }, linux_glibc_x86_64: { + enabled: true, srcs: ["x86_64/lib/mynativelib.a"], export_include_dirs: ["x86_64/include_gen/mynativelib"], }, @@ -1908,10 +1911,8 @@ cc_prebuilt_library_static { host: { enabled: false, }, - linux_glibc: { - enabled: true, - }, linux_glibc_x86_64: { + enabled: true, srcs: ["x86_64/lib/mynativelib.a"], export_include_dirs: ["x86_64/include_gen/mynativelib"], }, @@ -1929,7 +1930,7 @@ module_exports_snapshot { host: { enabled: false, }, - linux_glibc: { + linux_glibc_x86_64: { enabled: true, }, }, @@ -2027,7 +2028,10 @@ cc_prebuilt_library_headers { host: { enabled: false, }, - linux_glibc: { + linux_glibc_x86_64: { + enabled: true, + }, + linux_glibc_x86: { enabled: true, }, }, @@ -2046,7 +2050,10 @@ cc_prebuilt_library_headers { host: { enabled: false, }, - linux_glibc: { + linux_glibc_x86_64: { + enabled: true, + }, + linux_glibc_x86: { enabled: true, }, }, @@ -2062,7 +2069,10 @@ sdk_snapshot { host: { enabled: false, }, - linux_glibc: { + linux_glibc_x86_64: { + enabled: true, + }, + linux_glibc_x86: { enabled: true, }, }, @@ -2118,9 +2128,14 @@ cc_prebuilt_library_headers { export_include_dirs: ["android/include/include-android"], }, linux_glibc: { - enabled: true, export_include_dirs: ["linux_glibc/include/include-host"], }, + linux_glibc_x86_64: { + enabled: true, + }, + linux_glibc_x86: { + enabled: true, + }, }, } @@ -2140,9 +2155,14 @@ cc_prebuilt_library_headers { export_include_dirs: ["android/include/include-android"], }, linux_glibc: { - enabled: true, export_include_dirs: ["linux_glibc/include/include-host"], }, + linux_glibc_x86_64: { + enabled: true, + }, + linux_glibc_x86: { + enabled: true, + }, }, } @@ -2155,7 +2175,10 @@ sdk_snapshot { host: { enabled: false, }, - linux_glibc: { + linux_glibc_x86_64: { + enabled: true, + }, + linux_glibc_x86: { enabled: true, }, }, @@ -2346,13 +2369,12 @@ cc_prebuilt_library_shared { android_arm: { srcs: ["android/arm/lib/sslvariants.so"], }, - linux_glibc: { - enabled: true, - }, linux_glibc_x86_64: { + enabled: true, srcs: ["linux_glibc/x86_64/lib/sslvariants.so"], }, linux_glibc_x86: { + enabled: true, srcs: ["linux_glibc/x86/lib/sslvariants.so"], }, }, @@ -2377,13 +2399,12 @@ cc_prebuilt_library_shared { android_arm: { srcs: ["android/arm/lib/sslvariants.so"], }, - linux_glibc: { - enabled: true, - }, linux_glibc_x86_64: { + enabled: true, srcs: ["linux_glibc/x86_64/lib/sslvariants.so"], }, linux_glibc_x86: { + enabled: true, srcs: ["linux_glibc/x86/lib/sslvariants.so"], }, }, @@ -2398,7 +2419,10 @@ sdk_snapshot { host: { enabled: false, }, - linux_glibc: { + linux_glibc_x86_64: { + enabled: true, + }, + linux_glibc_x86: { enabled: true, }, }, @@ -2536,13 +2560,12 @@ cc_prebuilt_library_shared { android_arm: { srcs: ["android/arm/lib/stubslib.so"], }, - linux_glibc: { - enabled: true, - }, linux_glibc_x86_64: { + enabled: true, srcs: ["linux_glibc/x86_64/lib/stubslib.so"], }, linux_glibc_x86: { + enabled: true, srcs: ["linux_glibc/x86/lib/stubslib.so"], }, }, @@ -2571,13 +2594,12 @@ cc_prebuilt_library_shared { android_arm: { srcs: ["android/arm/lib/stubslib.so"], }, - linux_glibc: { - enabled: true, - }, linux_glibc_x86_64: { + enabled: true, srcs: ["linux_glibc/x86_64/lib/stubslib.so"], }, linux_glibc_x86: { + enabled: true, srcs: ["linux_glibc/x86/lib/stubslib.so"], }, }, @@ -2592,7 +2614,10 @@ sdk_snapshot { host: { enabled: false, }, - linux_glibc: { + linux_glibc_x86_64: { + enabled: true, + }, + linux_glibc_x86: { enabled: true, }, }, @@ -2637,13 +2662,12 @@ cc_prebuilt_library_shared { android_arm: { srcs: ["android/arm/lib/mylib.so"], }, - linux_glibc: { - enabled: true, - }, linux_glibc_x86_64: { + enabled: true, srcs: ["linux_glibc/x86_64/lib/mylib-host.so"], }, linux_glibc_x86: { + enabled: true, srcs: ["linux_glibc/x86/lib/mylib-host.so"], }, }, @@ -2666,13 +2690,12 @@ cc_prebuilt_library_shared { android_arm: { srcs: ["android/arm/lib/mylib.so"], }, - linux_glibc: { - enabled: true, - }, linux_glibc_x86_64: { + enabled: true, srcs: ["linux_glibc/x86_64/lib/mylib-host.so"], }, linux_glibc_x86: { + enabled: true, srcs: ["linux_glibc/x86/lib/mylib-host.so"], }, }, @@ -2687,7 +2710,10 @@ sdk_snapshot { host: { enabled: false, }, - linux_glibc: { + linux_glibc_x86_64: { + enabled: true, + }, + linux_glibc_x86: { enabled: true, }, }, -- cgit v1.2.3-59-g8ed1b