Commit Graph

5779 Commits

Author SHA1 Message Date
Treehugger Robot 7349652925 Merge ""current" is implicitly added to stubs.versions" am: 25c47a43a5 am: 4ce23de995 am: cab9b4b25c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1641782

Change-Id: Ibc0b6e3fdd98b59900f9998f5c11c417d5d4a20a
2021-04-01 06:57:10 +00:00
Yi Kong 44208d77df Merge "Move gen_sorted_bss_symbols.sh to use LLVM binutils" am: 9d9e053964 am: dd19e029a5 am: 3ef89b207a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1659997

Change-Id: Ia30bce0b8866cbc5078f2c7fb8b4b8a8c930077f
2021-04-01 05:34:55 +00:00
Treehugger Robot 25c47a43a5 Merge ""current" is implicitly added to stubs.versions" 2021-04-01 04:53:55 +00:00
Yi Kong 9d9e053964 Merge "Move gen_sorted_bss_symbols.sh to use LLVM binutils" 2021-04-01 03:10:08 +00:00
Jiyong Park d4a3a137ed "current" is implicitly added to stubs.versions
So far, when a library `libfoo` has `stubs.versions: ["10", "11"]`, then
`shared_libs: ["libfoo"]` is linked to the version 11 of the stub.

This requires the author of `libfoo` to manually update the property
whenever a new version is introduced. Otherwise, clients are not able
to use the newly added APIs because the latest stub is for an old
version.

This change eliminates the need for manual updating. "current" version
is always implicitly added to `stubs.versions`. It is added even when
nothing is set on the property, if `stubs.symbol_file` is set. i.e.

```
cc_library {
    name: "libfoo",
    stubs: {
        symbol_file: "libfoo.map.txt",
	// no versions: [...] needed
    },
}

cc_library {
    name: "a_client",
    shared_libs: ["libfoo"],
    apex_available: ["myapex"],
    min_sdk_version: "29",
}

apex {
    name: "myapex",
    native_shared_libraries: ["a_client"],
    min_sdk_version: "29",
}
```

`a_client` links to the "current" stub of `libfoo` that has all symbols
shown in the map file.

Note that, above doesn't mean that the client has unlimited access to
APIs that are introduced even after the min_sdk_version of the client
(29 in this example). The use of such APIs still has to be guarded with
`__builtin_available` check.

Bug: N/A
Test: m
Change-Id: I70bb1600c18e74d36c6b24c3569d2149f02aaf96
2021-04-01 09:58:53 +09:00
Ryan Prichard 4ccd490ae5 Revert^2 "Switch platform-NDK unwinder to LLVM libunwind.a prebuilt"
This reverts commit 74bdc28817.

Bug: http://b/153025717
Test: treehugger
Change-Id: I11410f213732c52755a3bd3d4d0769570354484e
2021-03-31 15:33:44 -07:00
Liz Kammer fc8bc62d2a Merge "Handle product_variable asflag for cc_object." am: acacbc1166 am: 2cc845060d am: 263bdc570c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652787

Change-Id: I6f9fd6727fd3eb0a5fdf3b0ccd324fed24a05be6
2021-03-31 21:17:47 +00:00
Liz Kammer 9af11134ff Merge "Don't use custom mixed build logic for cc_object" am: 7dfaa3a732 am: 227e8e9493 am: 8ac144c6e6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1615643

Change-Id: Iff33eedc973c18eb99ee0de60548c8272b525104
2021-03-31 21:17:42 +00:00
Liz Kammer acacbc1166 Merge "Handle product_variable asflag for cc_object." 2021-03-31 18:43:55 +00:00
Liz Kammer 7dfaa3a732 Merge "Don't use custom mixed build logic for cc_object" 2021-03-31 18:43:55 +00:00
Paul Duffin 2303174d95 Merge changes Ia3e93b8a,I964af3cb am: 4f6d15465b am: 18674bc4a8 am: 4d7fd01c00
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1655215

Change-Id: Ic22d20d0e3618ccacea62beb01a91117f5a56bc8
2021-03-31 16:28:16 +00:00
Paul Duffin 4eca3c04fc Merge "Extract prepareForCcTest" am: d11d199ba6 am: 3b56761441 am: 0dcfdfd118
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1655213

Change-Id: I7f0bc0e5600ff5dbe95319fa1c2f74c592398c66
2021-03-31 16:27:16 +00:00
Paul Duffin 4f6d15465b Merge changes Ia3e93b8a,I964af3cb
* changes:
  Remove ccFixtureFactory
  Remove buildDir from cc package
2021-03-31 14:26:03 +00:00
Paul Duffin d11d199ba6 Merge "Extract prepareForCcTest" 2021-03-31 14:25:19 +00:00
Paul Duffin 4b2ff1652c Merge "Rename OptionalPath.RelativeToPath -> RelativeToTop" am: 32eccae1ac am: 4ac8cd6582 am: d188fa7de2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1658072

Change-Id: I1ad2710e2439861542f01a976b185bb4084b02dd
2021-03-31 10:45:46 +00:00
Yi Kong bf1db7b149 Move gen_sorted_bss_symbols.sh to use LLVM binutils
Test: build
Change-Id: I496b92d963d127087daef405dafa24377d6bac97
2021-03-31 17:13:43 +08:00
Paul Duffin 32eccae1ac Merge "Rename OptionalPath.RelativeToPath -> RelativeToTop" 2021-03-31 08:57:43 +00:00
Ryan Prichard 9de87e4487 Merge "Revert "Switch platform-NDK unwinder to LLVM libunwind.a prebuilt"" am: ae4246488f am: 1a454d987c am: ffec4fb0b4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1658930

Change-Id: Ic19ef4205284bb64ead303bc004667ce22d725f5
2021-03-31 05:59:10 +00:00
Jose "Pepe" Galmes 99e56981b1 Merge "Fix missing snapshot headers." am: 9d54139763 am: db27fa0986 am: 9c3fe4daa8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1658921

Change-Id: I13a5641d55b8df4225bf7154154e69eb47a2eed6
2021-03-31 05:58:57 +00:00
Ryan Prichard ae4246488f Merge "Revert "Switch platform-NDK unwinder to LLVM libunwind.a prebuilt"" 2021-03-31 05:29:51 +00:00
Jose "Pepe" Galmes 9d54139763 Merge "Fix missing snapshot headers." 2021-03-31 04:45:43 +00:00
Ryan Prichard 74bdc28817 Revert "Switch platform-NDK unwinder to LLVM libunwind.a prebuilt"
This reverts commit 29b9de083e.

Reason for revert: b/184095989

Change-Id: I11d90562e0703631258a5e9f1b2dc36f1702289a
2021-03-31 03:25:57 +00:00
Jose Galmes 0d736917e6 Fix missing snapshot headers.
Bug: 184057288
Test: Run unit tests using:
Test: source build/envsetup.sh
Test: m -j nothing
Change-Id: If7402be9199313f9f03627cad662405b03b5d0fe
2021-03-30 17:27:45 -07:00
Dan Albert 667fd9bdae Merge "Switch platform-NDK unwinder to LLVM libunwind.a prebuilt" am: 368b7e6a13 am: 1ef79d5171 am: 6f23a7332e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1554719

Change-Id: Ie4987e20fcbf288817a3ad5c401929a89d6aa727
2021-03-31 00:20:17 +00:00
Paul Duffin b4c0f11cb7 Automatically call TestingBuildParams.RelativeToTop() am: e8366da1f6 am: fe53b7a2df am: 53325362e9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1655208

Change-Id: I2260f4020c4631310626f77ec7480f106e4c7c3b
2021-03-30 23:14:01 +00:00
Paul Duffin 8567f226e4 Remove ccFixtureFactory
Bug: 182885307
Test: m nothing
Change-Id: Ia3e93b8ab70a7a6a986debd837bd2df84b234847
2021-03-30 23:44:43 +01:00
Paul Duffin 2e6f90e0d0 Extract prepareForCcTest
Bug: 182885307
Test: m nothing
Change-Id: Ica17d20775c6dae00978f0f84f768fdaaf55e031
2021-03-30 23:44:43 +01:00
Paul Duffin c3e6ce04d9 Remove buildDir from cc package
Bug: 182885307
Test: m nothing
Change-Id: I964af3cb9a3e7a1dfbd9d5176a702591f6b19f16
2021-03-30 23:44:43 +01:00
Dan Albert 368b7e6a13 Merge "Switch platform-NDK unwinder to LLVM libunwind.a prebuilt" 2021-03-30 21:44:35 +00:00
Liz Kammer a060c4521e Handle product_variable asflag for cc_object.
cc_object crtbrand sets product_variable.platform_sdk_version.asflag
and will not compile correctly within mixed builds without it.

Only handles product_variables that expand product variables.

Bug: 181794963
Test: ~/aosp/build/bazel/scripts/milestone-2/demo.sh full
Change-Id: I293fcb18032aa51f63bb7b3de94abd6d1ec38180
2021-03-30 15:16:43 -04:00
Paul Duffin afdd4061ee Rename OptionalPath.RelativeToPath -> RelativeToTop
Bug: 183650682
Test: m nothing
Change-Id: I95239c2273e715e8c4c15a4a02967e01f6913234
2021-03-30 20:06:22 +01:00
Paul Duffin e8366da1f6 Automatically call TestingBuildParams.RelativeToTop()
Fixes the few tests that break due to this and which cannot easily be
separated into their own changes.

Bug: 183650682
Test: m nothing
Change-Id: Ia2f31213a1f114a78e66a81d89279ecde9f4c465
2021-03-30 19:35:35 +01:00
Jingwen Chen 2f9549fece bp2build: arch-configurable selects for label list attrs. am: 0702791a99 am: ca0664d2fe am: b1fb88681b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1635579

Change-Id: Ic633ddfe15248d31833d62f71b081512d31c06d7
2021-03-30 16:41:16 +00:00
Jingwen Chen 0702791a99 bp2build: arch-configurable selects for label list attrs.
This CL adds the configurable LabelListAttribute support to bp2build.

Test: go test
Change-Id: I2ef9e385d9cf1b1845988128eca1d8cda1ecb5e8
2021-03-30 13:22:48 +00:00
Martin Stjernholm 2f1e93ef36 Merge changes Iaa6411b5,I2118b8a2,Ibbdd3cbd,I2d1bbda2 am: 38e9f0b82f am: 99f29d244a am: c5c5d80d30
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652620

Change-Id: I09a93351bcae2c27531fd258ddacdd8bc5ddd474
2021-03-30 12:42:38 +00:00
Martin Stjernholm 38e9f0b82f Merge changes Iaa6411b5,I2118b8a2,Ibbdd3cbd,I2d1bbda2
* changes:
  Make test_for arch variant.
  Don't use APEX stubs between internal libs in the same APEX when building test_for modules.
  Add FilterListPred.
  Don't panic on "go test" invocations from the command line.
2021-03-30 09:26:36 +00:00
Treehugger Robot 83c426a3fe Merge "Append ".static" to ubsan runtime for static binaries" am: e2f39b038d am: c1f3f6acbc am: 8b81b2b528
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1655969

Change-Id: Iaa8cd1979d5dd6b551175a6b898922098ec2472e
2021-03-30 04:58:02 +00:00
Treehugger Robot e2f39b038d Merge "Append ".static" to ubsan runtime for static binaries" 2021-03-30 03:07:27 +00:00
Colin Cross 32f1de3327 Append ".static" to ubsan runtime for static binaries
Bug: 183611452
Test: m BUILD_HOST_static=1 tinyplay2
Change-Id: I8d8ef762781f0583c8b9337ce5876c7d3140f665
2021-03-29 16:47:56 -07:00
Martin Stjernholm 855e90b57c Make test_for arch variant.
To be able to avoid registering dependencies on nonexistent host APEXes
in host builds.

Test: art/tools/buildbot-build.sh --host
  with http://r.android.com/q/topic:libdexfile-noext applied
Bug: 183217299
Change-Id: Iaa6411b511b6f50da01827b49852607ae825bc83
2021-03-28 22:06:34 +01:00
Martin Stjernholm 4e6c269de5 Don't use APEX stubs between internal libs in the same APEX when
building test_for modules.

This extends the current approach where test modules always depend on
the platform variants of the APEX libs, and only skips the stubs on
them. It still has the limitation that the internal libs must have the
exact same apex_available lists.

Also some improvement of the test accuracy in TestTestFor.

Test: m libartagent-target
  with http://r.android.com/q/topic:libdexfile-noext applied
Bug: 183217299
Change-Id: I2118b8a22c887077867a3ddbbe73437b4a29a6ad
2021-03-28 22:06:34 +01:00
Ivan Lozano 3f62a868e8 Merge "rust: Add whole_static_libs, revert static_lib" am: 352bdf29b3 am: f34d6487ae am: 04edf27ef6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652928

Change-Id: I170a6291d8f2f92abe1104f90a8f14037015a9da
2021-03-26 14:57:22 +00:00
Ivan Lozano 352bdf29b3 Merge "rust: Add whole_static_libs, revert static_lib" 2021-03-26 13:01:14 +00:00
Treehugger Robot 1b2236a225 Merge changes from topic "min_sdk_version" am: 10906f5cc6 am: 22d43c0676 am: b62df79d53
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1646949

Change-Id: Ie7f1d9752a2db369d73a6e2a006f63cf78f5b4e6
2021-03-26 10:17:36 +00:00
Treehugger Robot 10906f5cc6 Merge changes from topic "min_sdk_version"
* changes:
  Versioned CRT objects are built with correct __ANDROID_API__
  Always respect min_sdk_version
2021-03-26 08:07:28 +00:00
Rupert Shuttleworth b8ba92912b Merge "Add bp2build support for cc_library_static." am: 0f256ff07d am: 5b5f675f48 am: 14a2686d7d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652835

Change-Id: I6594ee7d4490bacf553f43431fef64219900b74f
2021-03-25 23:03:12 +00:00
Colin Cross 8a63fa9fd2 Merge changes Ie8721dcd,If1827b9d,Iec250a2d,I3f46f611,Idf136919, ... am: ba5fff85a7 am: 0b0fcae3ca am: defc5c9f8a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1651847

Change-Id: Ifc60075b65f4f27134aaab9315e4c0ffe90f2481
2021-03-25 23:03:02 +00:00
Rupert Shuttleworth 0f256ff07d Merge "Add bp2build support for cc_library_static." 2021-03-25 21:01:29 +00:00
Colin Cross ba5fff85a7 Merge changes Ie8721dcd,If1827b9d,Iec250a2d,I3f46f611,Idf136919, ...
* changes:
  Replace ANDROID_SDK_HOME with ANDROID_PREFS_ROOT for metalava
  Simplify lint rules using improved RuleBuilder rsp support
  Support multiple rsp files in RuleBuilder
  Pass rsp files into sbox and rewrapper
  Add test for sbox input sandboxing
  Support multiple rsp files in REParams
  Move response file handling to a separate package
2021-03-25 20:55:56 +00:00
Paul Duffin c5296cd586 Merge "Disallow non-existent paths in sdk package" am: 863ecfb7ba am: a48aed59ee am: 146b43cc63
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1647171

Change-Id: Ic3aa5af880a293457d5303b362c38421591f55e2
2021-03-25 19:47:49 +00:00
Pirama Arumuga Nainar b418b98eee Merge "[pgo] Do not explicitly link profile runtime" am: 4c0b11a16e am: a65c8e8172 am: bf56f6b1f6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1651751

Change-Id: I36e663461bbd27e23cde64287526fc50ba5fcc97
2021-03-25 19:47:08 +00:00
Paul Duffin 863ecfb7ba Merge "Disallow non-existent paths in sdk package" 2021-03-25 18:09:06 +00:00
Colin Cross a4eafddc41 Support multiple rsp files in REParams
rewrapper supports a comma separate list of rsp files, replace
REParams.RSPFile with REParmas.RSPFiles.

Test: remoteexec_test.go
Change-Id: I7850c071c23d368d6fad4480dd527d146c13c6d3
2021-03-25 11:06:45 -07:00
Pirama Arumuga Nainar 4c0b11a16e Merge "[pgo] Do not explicitly link profile runtime" 2021-03-25 17:57:49 +00:00
Ivan Lozano 63bb7680c9 rust: Add whole_static_libs, revert static_lib
Revert the static_lib behavior to the previous behavior (pass static
libs to the linker rather than via to rustc using `-lstatic=<lib>`). To
bundle static libraries into libraries, provide the whole_static_libs
property which retains the current static_libs behavior.

Passing all static libraries via -lstatic was resulting in odd bloat
where in some cases static symbols were duplicated in binaries and
libraries. This split makes it possible to be explicit about when static
libraries should be bundled.

Bug: 183182230
Test: mma system/bt; mma system/security/keystore2; mma external/rust

Change-Id: Ic2dde5d1542dca5ce145aa3a3fbd9ea54440d991
2021-03-25 13:50:17 -04:00
Liz Kammer 8206d4ff98 Don't use custom mixed build logic for cc_object
Starlark implementation of cc_object now performs partial linking, which
better matches Soong's implementation of cc_object.

Bug: 181794963
Test: generate build files with bp2build, mixed build droid
Change-Id: I5a325aa1c608981deaee3671ac28c6014e6cbf08
2021-03-25 12:00:30 -04:00
Rupert Shuttleworth 095081c6d7 Add bp2build support for cc_library_static.
Also refactor bp2build-related code for cc_library_headers.

(Retry of previous CL after the presubmit failed to detect a merge conflict)

Test: Added unit test.

Test: bp2build-sync.py write; bazel build //bionic/... still works (but bp2build is disabled for most cc_library_static targets for other reasons)
Change-Id: I2f4405c2fea305623bbc6daaaf62808b0c074216
2021-03-25 15:16:11 +00:00
Paul Duffin db462dd987 Disallow non-existent paths in sdk package
Test behavior was changed a while ago so that tests by default ignore
non-existent source paths (unless they explicitly check for/rely on
them). Prior to that CheckSnapshot() could detect when files were
missing from the snapshot but it no longer can.

This change disallows non-existent source files in all the sdk tests
which means that they are disallowed when processing the snapshots as
they use the same preparers as were used to process the sources.

This caused a test failure which has been temporarily ignored and has
a TODO and bug associated with it.

Bug: 183184375
Test: m nothing
Change-Id: I969d8515d20ef5ae515f2b5f93d8ed4e4f8ede75
2021-03-25 12:53:22 +00:00
Treehugger Robot 9cacf2e311 Merge "Enable safe ICF for all devices" am: f7e79a591c am: 660e778db6 am: ef42232afb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1649333

Change-Id: I1e1eb1e3b82b2ff1f59f01fac59049cdf6e581cf
2021-03-25 10:52:47 +00:00
Treehugger Robot f7e79a591c Merge "Enable safe ICF for all devices" 2021-03-25 08:59:00 +00:00
Jingwen Chen 7c8de8545d Merge "Revert "Add bp2build support for cc_library_static."" am: 8b086655cd am: 1763a4add1 am: 8729dfc636
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652233

Change-Id: I6e5d18b5ec499179cbe167bce7702bb0d51b2c5d
2021-03-25 08:08:45 +00:00
Rupert Shuttleworth 1b5200cb4f Merge "Add bp2build support for cc_library_static." am: d3e10104b0 am: 76d01a0522 am: ce8062d357
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1594371

Change-Id: I36cb39f43847e2a4a56bce6920a2f304ebf2df0a
2021-03-25 08:08:31 +00:00
Jingwen Chen 8b086655cd Merge "Revert "Add bp2build support for cc_library_static."" 2021-03-25 06:14:03 +00:00
Jingwen Chen f9410540a8 Revert "Add bp2build support for cc_library_static."
Revert submission 1594391-bp2build-cc_library_static

Reason for revert: Broke the build on aosp-master
Reverted Changes:
Ib16ccf31a:Add cc_library_static macro to help with bp2build ...
I37c856be2:Add bp2build support for cc_library_static.

Change-Id: Ie94d5bc6da81758cd4e0461c08a810a29643c971
2021-03-25 06:11:59 +00:00
Rupert Shuttleworth d3e10104b0 Merge "Add bp2build support for cc_library_static." 2021-03-25 05:39:39 +00:00
Jingwen Chen a6a6d1acb6 Merge "bp2build: add allowlist for package-level conversions." am: 95c6eb3959 am: cf615d8640 am: a7b2d95cf6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1625820

Change-Id: I57f618c5c3b7e4524c44e29c61a6de2547a225b7
2021-03-24 23:51:18 +00:00
Rupert Shuttleworth 21e743df41 Add bp2build support for cc_library_static.
Also refactor bp2build-related code for cc_library_headers.

Test: Added unit test.

Test: bp2build-sync.py write; bazel build //bionic/... still works (but bp2build is disabled for most cc_library_static targets for other reasons)

Change-Id: I37c856be20a47b154909338a22a7dba1ab55693f
2021-03-24 13:56:44 +00:00
Jingwen Chen 12b4c2706d bp2build: add allowlist for package-level conversions.
This CL adds the support for specifying lists of directories in
build/soong/android/bazel.go, which are then written into
out/soong/bp2build/MANIFEST. Using this configuration,
modules/directories can either default to bp2build_available: true or
false, while still retaining the ability to opt-in or out at the module level.

It also ensures that ConvertWithBp2Build returns true iff the module
type has a registered bp2build converter.

Test: go tests
Test: demo.sh full
Test: TreeHugger presubmits for bp2build and mixed builds.

Change-Id: I0e0f6f4b1b2ec045f2f1c338f7084defc5d23a55
2021-03-24 02:27:19 -04:00
Ryo Hashimoto 5818b9344f Enable safe ICF for all devices
--icf=safe has been enabled for arm and arm64.
Do the same thing for all devices.

On bertha_x86_64, this CL makes system.raw.img 4.4MB smaller.

Bug: 182446785
Test: build

Change-Id: Ifd597cd8496c49b55df269f22e01b1c50dc8f6e8
2021-03-24 13:00:32 +09:00
Pirama Arumuga Nainar bedca74471 [pgo] Do not explicitly link profile runtime
Bug: http://b/181740505

Explicitly adding dependency to profile runtime causes apex dependency
errors.  We're already passing -fprofile-instr-generate to the linker so
depending on the profile runtimes is unnecessary.

Test: pgo-coral-config1 on internal release branch and run tests on
      APCT.
Change-Id: Ie54785726c7ac044e5a5a2299073d02d45d5e0a7
2021-03-23 18:07:30 -07:00
Treehugger Robot 41cfa60853 Merge "Handle include_build_directory prop in bp2build" am: dca349a782 am: a5be000743 am: 421020e361
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1646268

Change-Id: I1e3dd722eb55d03feaba5a273dd55c750c8c099f
2021-03-23 16:36:28 +00:00
Treehugger Robot dca349a782 Merge "Handle include_build_directory prop in bp2build" 2021-03-23 14:39:19 +00:00
Ryan Prichard 29b9de083e Switch platform-NDK unwinder to LLVM libunwind.a prebuilt
Link against the libunwind.a shipped with the NDK so it matches what's
linked into the NDK's libc++_shared.so.

Bug: http://b/153025717
Test: device boots, manually inspect some linker command lines
Change-Id: Icc79844f5e70f0eaa97ea758449c30fbddd030d2
2021-03-22 13:46:54 -07:00
Pirama Arumuga Nainar e7c30b32c0 Merge "Switch to clang r416183 12.0.4." am: 679d5308ec am: 042fce9dfd am: 59fed69211
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1640559

Change-Id: I301bb50687a8f8a613b30ae9af11c193465de1f9
2021-03-22 20:37:26 +00:00
Pirama Arumuga Nainar 679d5308ec Merge "Switch to clang r416183 12.0.4." 2021-03-22 16:26:13 +00:00
Jiyong Park fdaa5f7164 Versioned CRT objects are built with correct __ANDROID_API__
Background: `min_sdk_version` of a crt object is the oldest SDK version
that the crt object supports. When it's set to for example 16, Soong
creates a number of versioned variants of the crt object starting from
16 to the latest version. The variant for version X is provided to NDK
clients having `min_sdk_version` set to X.

Problem: all versioned variants of a crt object were built with `-target
<arch>-linux-android16`. Therefore they all have been with `#define __ANDROID_API__
16`.  This is because the mutated variants still have the same
min_sdk_version property and the clang triple follows min_sdk_version,
not sdk_version. This is too conservative and against our intention to
provide the latest crt object that matches with the min_sdk_version of
the client.

In the other hand, the platform(non-sdk) variant of the crt object
doesn't have such a problem. min_sdk_version is completely ignored.
However, this is a bug and will be fixed by aosp/1640364. As a side
effect of the fixing, the platform variant will begin to built with a
very old __ANDROID_API__ which unnecessarily turns off the new platform
features like the TLS segment over-alignment.

This change fixes the problems:

* For the versioned variants of crt objects, we set both
`min_sdk_version` and `sdk_versio` to the version that the variant is
created for.

* For the platform variant of crt objects, `min_sdk_version` is force
reset to "current".

Bug: 183191008
Test: m

Change-Id: I8c9d0fcea816de8cd1532dac4a47eee4f726c037
2021-03-23 01:18:31 +09:00
Jiyong Park a008fb08cf Always respect min_sdk_version
Background:
When compiling cc_* modules, min_sdk_version determines the "version"
part of the clang triple: -target <arch>-linux-android<version>. The
version part is used to make sure that calls to the APIs that are added
after the version are guarded with a runtime check (i.e.
__builtin_available).

Previously, min_sdk_version was used as the version part only when the
cc_* module is unbundled (e.g. built for an APEX or built with SDK). In
other words, min_sdk_version has been ignored for the platform variants.
They were built with the version number 10000.

This was problematic for Mainline module tests. Since they are neither
part of an APEX nor built with SDK (because they need to have access to
some of the module-only APIs), they are built with the version number
10000. As a side effect, __builtin_available macro are expanded to 1 at
build time - because 10000 is higher than any API versions. When such a
test built in the latest platform source tree runs on a device running
an old platform, it tries to call an API that might not be available on
the platform and experience a crash, due to the lack of the runtime
check.

This change fixes the problem by using min_sdk_version as the "version"
part of the clang triple, regardless of the module's variant. Then
__builtin_available macro in the tests doesn't expand to 1, but to a
function call to the libclang_rt.builtin library which checks the system
property ro.build.version.sdk.

Bug: N/A
Test: run resolv_stress_test

Change-Id: I88f64c5a35f1b5276c3350e177b116932011a940
2021-03-23 01:18:31 +09:00
Treehugger Robot 8de6291424 Merge "Revert "[strip.sh] Move remaining GNU binutils usage to llvm binutils"" am: f2be52c4dc am: 7ce29d53bf am: 62701ff807
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1647203

Change-Id: I421b4ee552ec335a363c0393100352982b1161a1
2021-03-20 21:24:27 +00:00
Treehugger Robot f2be52c4dc Merge "Revert "[strip.sh] Move remaining GNU binutils usage to llvm binutils"" 2021-03-20 19:25:23 +00:00
David Srbecky 33dfba1d9c Revert "[strip.sh] Move remaining GNU binutils usage to llvm binutils"
This reverts commit ad50ce8349.

Bug: 183237575
Reason for revert: Breaks stack unwinding

Change-Id: I256dc77525687fb3e670355587b1eac72158b274
2021-03-20 14:46:15 +00:00
Colin Cross 6dee49ca7f Merge changes Iab4e09d9,Icf2f24dd,I15be5ef1,Ic0db9619 am: d2db7953a0 am: fa5bd82ef0 am: 5c2afde7f1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1634812

Change-Id: Ic4b43962a5ac32605216fec53a1b2e5803874191
2021-03-19 19:20:57 +00:00
Yi Kong d28df8630d Merge "[strip.sh] Move remaining GNU binutils usage to llvm binutils" am: 00d54280d0 am: dd3494b8e4 am: 55163399f5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1235781

Change-Id: I04470e88b6848c10137368d6b8d7d91c99f1fd01
2021-03-19 17:25:14 +00:00
Colin Cross d2db7953a0 Merge changes Iab4e09d9,Icf2f24dd,I15be5ef1,Ic0db9619
* changes:
  Run lint actions in sbox
  Support sbox-in-RBE
  Move android package on top of remotexec
  Support sandboxing inputs in RuleBuilder
2021-03-19 17:25:14 +00:00
Liz Kammer a4aa43072b Handle include_build_directory prop in bp2build
Test: go test cc tests
Test: generate bp2build, sync bp2build, bazel build //bionic/...
Bug: 181794963
Change-Id: I8dcef585e3025ef6f44d22430ed67b1e0429dca0
2021-03-19 12:33:34 -04:00
Yi Kong 00d54280d0 Merge "[strip.sh] Move remaining GNU binutils usage to llvm binutils" 2021-03-19 15:32:49 +00:00
Jingwen Chen eafb095afe Merge "bp2build: cc_library_headers converter should only include that module type" am: b1672af5d2 am: 5d622ec767 am: b1ab70742c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1645006

Change-Id: I269f513856d3b1a4bd1d83ea1fce7a550220a507
2021-03-19 11:31:25 +00:00
Jingwen Chen b1672af5d2 Merge "bp2build: cc_library_headers converter should only include that module type" 2021-03-19 09:18:15 +00:00
Yi Kong ad50ce8349 [strip.sh] Move remaining GNU binutils usage to llvm binutils
With clang r377782, llvm binutils implements all the necessary
funtionaility for strip.sh. We can finally get rid of all the fallback
GNU binutils usage.

Test: m
Bug: 141010852
Bug: 135627985
Change-Id: I110f6028dab7f599decf59a5cb1b927b35e11857
2021-03-19 12:28:44 +08:00
Justin Yun 43ad83767b Merge "Define __ANDROID_VENDOR__ and __ANDROID_PRODUCT__" am: b1d5479783 am: 2d0020dbbd am: 76e4387707
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1620648

Change-Id: I507c493b93fc1fdfefe7f2d01e50e2c22e036368
2021-03-19 01:50:55 +00:00
Pirama Arumuga Nainar c7d23478e1 Switch to clang r416183 12.0.4.
Bug: http://b/181927912

Test: go/android-llvm-testing-dashboard tag: test_clang_r416183
      go/android-llvm-windows-testing
      go/ab/P20855845 sdk_phone_armv7-sdk_mac build on Forrest
      Forrest run L21700000838126631 for CtsNNAPITestCases

Change-Id: If677b57616348ae52704494f40c7b1ed470bb5f4
2021-03-19 01:14:20 +00:00
Justin Yun b1d5479783 Merge "Define __ANDROID_VENDOR__ and __ANDROID_PRODUCT__" 2021-03-18 23:33:43 +00:00
Colin Cross 77cdcfdeaf Move android package on top of remotexec
Remove the references to the android package in remotexec so that
the android package can reference the remoteexec package.  This
will allow RuleBuilder to integrate directly with remoteexec.

Bug: 182612695
Test: m checkbuild
Change-Id: I15be5ef126d8aacbd605518638f341daf6f31bb3
2021-03-18 16:17:34 -07:00
Jingwen Chen c7846f38fa bp2build: cc_library_headers converter should only include that module type
Test: bp2build; bazel build //bionic/...
Change-Id: I34768b51098c5b801e7c6d9b3a95ec0f37c3bb09
2021-03-18 18:35:39 -04:00
Colin Cross ecd91c9ffa Add explicit rspfile argument to RuleBuilderCommand.FlagWithRspFileInputList am: 70c4741215 am: 37225a7b05 am: 27a4326c78
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1634804

Change-Id: I6a33941387ce9d6054c49f61b41d4f9a4b911e36
2021-03-17 22:21:53 +00:00
Liz Kammer a801072f60 Merge "Temporarily disable cc_objects in mixed builds" am: 39d3830205 am: f84f690929 am: f0946b0715
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1640582

Change-Id: I21f5c94906565d2f712199a0cc9826b1b8c35935
2021-03-17 16:19:39 +00:00
Liz Kammer 16d355ac92 Merge changes from topic "mixed-bp2build" am: a5f86249a4 am: 2b6af78207 am: dd93334831
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1607554

Change-Id: Iff4681eca0b887c43f7faccf2e1418671a2f2088
2021-03-17 16:19:36 +00:00
Christopher Parsons 944c00991a Merge "Refactor and cleanup of cquery processing" am: bc3f7e0276 am: 70f670df1a am: 8e0d430822
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1629139

Change-Id: I08f029d182ef715b64ca5c40944709691a959ad6
2021-03-17 16:18:52 +00:00
Justin DeMartino 89bcfecf6a Merge "Allow extending of the list of directories to be scanned for VSDK" am: dd1decf7f6 am: e7c7a5e8d6 am: 1bbe7b54ec
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1603623

Change-Id: I749bf59c09bc250e342953b4760695408aa8b513
2021-03-17 16:18:07 +00:00
Colin Cross 70c4741215 Add explicit rspfile argument to RuleBuilderCommand.FlagWithRspFileInputList
Using $out.rsp as the rsp file adds extra complexity around keeping
the $ unescaped.  Make callers to FlagWithRspFileInputList provide
an explicit path for the rsp file instead.

Bug: 182612695
Test: rule_builder_test.go
Change-Id: I3f531d80c1efa8a9d09aac0a63790c5b11a9f0c6
2021-03-16 16:52:56 -07:00
Liz Kammer 39d3830205 Merge "Temporarily disable cc_objects in mixed builds" 2021-03-16 21:40:04 +00:00
Liz Kammer a5f86249a4 Merge changes from topic "mixed-bp2build"
* changes:
  Support autoconverted modules in mixed builds
  Use handcrafted build targets in bp2build
2021-03-16 21:40:04 +00:00
Christopher Parsons bc3f7e0276 Merge "Refactor and cleanup of cquery processing" 2021-03-16 21:12:01 +00:00
Liz Kammer bdc609972c Support autoconverted modules in mixed builds
modules converted with bp2build_available are will also be available to
be used in mixed builds.

Test: build/bazel/scripts/milestone-2/demo.sh full
Test: go tests
Change-Id: I49f16ec3ba5bb11dfed8066af069c27eb04371fb
2021-03-16 15:11:49 -04:00
Chris Parsons 944e7d01aa Refactor and cleanup of cquery processing
Test: USE_BAZEL_ANALYSIS=1 m libc
Change-Id: Iaf9a92e84d39c132e2444a8aaafd79505a12b8ec
2021-03-16 14:39:16 -04:00
Liz Kammer 57355683d4 Temporarily disable cc_objects in mixed builds
Bug: 181794963
Test: generate bp2build targets and run mixed builds
Change-Id: If4562fe8ed7bde88141b40166eca9d01f6538106
2021-03-16 13:34:48 -04:00
Justin DeMartino 383bfb392f Allow extending of the list of directories to be scanned for VSDK
Bug: 180925851
Bug: 181564692
Test: m nothing, manually
Change-Id: Ifff95db4c9ec362322fecca08f7fd1a7b60755c0
2021-03-15 23:14:47 +00:00
Justin Yun 13decfb0bb Define __ANDROID_VENDOR__ and __ANDROID_PRODUCT__
__ANDROID_VNDK__ is defined for the modules that are able to use the
VNDK libraries. As both product and vendor variants define
__ANDROID_VNDK__, we don't know if a module is built for vendor or
product on build time.

__ANDROID_VENDOR__ and __ANDROID_PRODUCT__ macros can be used to
specify the image-variant-dependent codes.

Bug: 180646847
Test: m nothing
Change-Id: Id6c3e1e3d47deaf3684c0c02964718658cf2fec5
2021-03-15 17:28:59 +09:00
Paul Duffin 1b511a9f47 Migrate from result methods to function Asserts am: e84b1338c5 am: 37e8d92321 am: b364e7b212
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1629626

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic7f8e38989f273939aea30427ba61bdf88043e99
2021-03-13 03:48:12 +00:00
Paul Duffin e84b1338c5 Migrate from result methods to function Asserts
Bug: 181070625
Test: m nothing
Change-Id: Iadb85270290acb52c55f2ad70c9f145f1c34b611
2021-03-12 22:24:51 +00:00
Cindy Zhou 370fc523a8 Merge "Enable cfi for 32bit arch" am: 34d300ba76 am: 809e91cf12 am: 87075e20e7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1570600

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ide322a8fbcce16b1382cf0eacfc18ad4f5bba8f9
2021-03-12 13:47:22 +00:00
Cindy Zhou 34d300ba76 Merge "Enable cfi for 32bit arch" 2021-03-12 12:41:39 +00:00
Paul Duffin 24963ea1e3 Merge "Prevent mock filesystem files being overridden by accident" am: 412a209d87 am: a517bddd85 am: 53b805d276
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1629639

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If124e77a419bc9d1b9416187263a88aefb28874c
2021-03-12 09:44:20 +00:00
Paul Duffin 412a209d87 Merge "Prevent mock filesystem files being overridden by accident" 2021-03-12 08:04:43 +00:00
Paul Duffin f2d55024bb Merge "Convert cc/prebuilt_test.go to use fixtures" am: f11bced30b am: e70de62af3 am: 8c0ee2d8ce
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1626515

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib741c9ce6a2b10021960fa25dee42ae24d0069cb
2021-03-12 00:09:21 +00:00
Paul Duffin efa480f650 Merge changes I6b408d44,I7e57c978 am: d7bbeffe0e am: 7ac41ea830 am: e447d4d0ee
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1626514

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ibee3298948c2c842788442c53ba7125ecd61c54f
2021-03-12 00:09:15 +00:00
Paul Duffin f11bced30b Merge "Convert cc/prebuilt_test.go to use fixtures" 2021-03-11 21:58:39 +00:00
Paul Duffin d7bbeffe0e Merge changes I6b408d44,I7e57c978
* changes:
  Add preparer for test to use AndroidMk
  Convert cc/cc_test.go tests that use CreateTestContext to fixtures
2021-03-11 21:58:14 +00:00
Paul Duffin 6e9a4007b5 Prevent mock filesystem files being overridden by accident
Bug: 181070625
Test: m nothing
Change-Id: Ib12b5cbe9af980706620d7d7d85bcfe31f36b07f
2021-03-11 19:21:12 +00:00
Christopher Parsons 3a642e2800 Merge "mixed builds for cc_static_library without deps" am: 2bed9ffaf4 am: a86985e40a am: 3cb7e6bd83
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1625068

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iddbc0f04dec0faeb70f5ccfe694dd3deaa65cb61
2021-03-11 15:46:38 +00:00
Paul Duffin 73bfe21a62 Merge "Convert fuchsia tests to use test fixtures" am: 4e1916011c am: 3dbfef078e am: 9225cc2bf9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1626509

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic1b047130460625a91c636c8e2aa516bcbbf35f3
2021-03-11 15:45:03 +00:00
Christopher Parsons 2bed9ffaf4 Merge "mixed builds for cc_static_library without deps" 2021-03-11 15:11:44 +00:00
Paul Duffin 6a1160e749 Convert cc/prebuilt_test.go to use fixtures
Bug: 181070625
Test: m nothing
Change-Id: I6048812962382e2adaf79d941a24e5c0ffdd9b25
2021-03-11 15:04:43 +00:00
Paul Duffin 7d8a8ad0d1 Convert cc/cc_test.go tests that use CreateTestContext to fixtures
Bug: 181070625
Test: m nothing
Change-Id: I7e57c978fa07ee8c0f35d567753751bd7b128b1e
2021-03-11 15:04:39 +00:00
Paul Duffin 4e1916011c Merge "Convert fuchsia tests to use test fixtures" 2021-03-11 14:07:01 +00:00
Lukacs T. Berki 778c31d32f Hard-wire the path to xcrun as /usr/bin/xcrun. am: 21d5c7aaa9 am: 8f23c72f9e am: 177e95d4d6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1626516

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I980be00ea77f4423ff04f4c44b03391aef94d735
2021-03-11 12:38:50 +00:00
Lukacs T. Berki 21d5c7aaa9 Hard-wire the path to xcrun as /usr/bin/xcrun.
This lets us not leak $PATH to soong_build. It was only needed for
Darwin tests anyway.

Test: Will ask jingwen@ who has a Mac.
Change-Id: I4647e41275b323fe6283580f8f92718c6229f23e
2021-03-11 08:52:39 +01:00
Paul Duffin ecdac8a6d6 Convert fuchsia tests to use test fixtures
Bug: 181070625
Test: m nothing
Change-Id: Ic2b86f7c603ff1c4b48884cb58908db536d98f37
2021-03-11 07:26:11 +00:00
Treehugger Robot 3ccb6af0e7 Merge "AIDEGen: Add "-fprofile-sample-use" parameter into category." am: b3d6edd6c0 am: d32045e2f3 am: 0a74edc095
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1620690

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I390e6a4e1024d7343b4baa527f10b258b6f7e2a8
2021-03-11 06:30:59 +00:00
Treehugger Robot b3d6edd6c0 Merge "AIDEGen: Add "-fprofile-sample-use" parameter into category." 2021-03-11 04:34:02 +00:00
Cindy Zhou e0c14678d4 Enable cfi for 32bit arch
Enabling cfi for 32-bit arch; b/35157333 seems to have been resolved in b/67507331.

Bug: 158010610

Test: manual interaction with Wimbley device: youtube video, chrome
navigations, gmail
MPTS testing on Sargo
Change-Id: I9eb034deed9938710f0f7b690fa57108d9bc5669

Change-Id: I434748ede352f998e64a6639de6ba162762ee7f0
2021-03-10 17:14:02 -08:00
Paul Duffin 0416343c5b Merge changes Ib2c6ac28,I7c76ed6d,I00415f10,I4be2a16c,I6f269c9c, ... am: 67e848ab04 am: 07d76a4ec2 am: 020cd977dc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1625385

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9535f62f41e12d1c09c0173d6ece58abede67945
2021-03-10 23:57:35 +00:00
Chris Parsons 808d84c45d mixed builds for cc_static_library without deps
Test: Manual mixed builds testing of `libc` target with manually
migrated "libc_nopthread" and "libc_init_dynamic".

Change-Id: If7d67e95eca9899271b1eeb662c7c2e571f64afa
2021-03-10 13:24:59 -05:00
Paul Duffin 02a3d65402 Support test fixtures in cc package
Restructures the cc package test setup code to create FixturePreparer
instances for setting up a test fixture and converts some tests to
use it.

The goal with this change is not to switch all the cc tests over to
directly using the new model but instead to ensure that the majority of
the cc tests run with the new model, to allow existing tests to easily
switch to the new model when needed and to allow dependent packages to
be switched to the new model.

Bug: 181070625
Test: m nothing
Change-Id: I00415f10fb44c1b9e78e1317e7f50bb61984d3a4
2021-03-09 23:06:00 +00:00
bralee c117f6fc00 AIDEGen: Add "-fprofile-sample-use" parameter into category.
"-fprofile-sample-use" parameter needs to be added to
categorizeParameter function.

Bug: 181817731
Test: 1. aidegen -a -i c art build bootable frameworks/base/core libnativehelper external/protobuf external/gflags external/googletest hardware/interfaces/health packages/modules/Gki system/apex system/core/fastboot system/core/fs_mgr system/core/healthd system/core/init system/core/libbinderwrapper system/core/libcutils system/core/liblog system/core/libprocessgroup system/core/libutils system/core/property_service system/core/rootdir system/core/storaged system/extras system/gsid system/hwservicemanager system/libbase system/libhidl system/libhwbinder system/libvintf system/sepolicy system/update_engine test tools
      2. CLion launched without errors in 'CMake' tag.
Change-Id: I4e9b0fd19fe00d23a9aa535b1ab7ade9c4a46f69
2021-03-08 09:33:23 +08:00
Paul Duffin 381bd33c04 Merge "Fix build break caused by registering genrules twice" am: 6d3e726887 am: bbb10d2452 am: 6ce4598e3c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1621418

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I8970e441a817db83cbf64623954e51c814cf4ada
2021-03-06 11:53:35 +00:00
Paul Duffin cdcd2be1ff Fix build break caused by registering genrules twice
Two separate changes that passed presubmits separately and did not
conflict when merged together unfortunately clashed at runtime. The
changes are:
* Ic00c7e480dc738d7a88d038aca6ab95a1502a24a
* Ic98fdc29a63155174a3227e7e918b26f0a8763bb

Test: m nothing
Change-Id: I7b5704c22cc2ea2095f5fb92c59f0526bb445f13
2021-03-06 10:03:22 +00:00
Paul Duffin 8d74783b41 Merge "Clean up cc.RegisterRequiredBuildComponentsForTest()" am: 0805d4ebdd am: b6ae322278 am: 1f50ff0df6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1621414

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I22877e0de75fbb1f4899fad3081418acf3b6df74
2021-03-06 09:56:58 +00:00
Paul Duffin 1c58ce4a52 Merge "Fix mutator ordering issue in apex tests" am: 97c8128eea am: d8033e1d26 am: e672daac6b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1621415

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ifa3b28737bcf55fb5ccda37e3e4dec4973cf8e34
2021-03-06 09:56:43 +00:00
Paul Duffin 0805d4ebdd Merge "Clean up cc.RegisterRequiredBuildComponentsForTest()" 2021-03-06 08:43:56 +00:00
Paul Duffin 6d119b804c Fix mutator ordering issue in apex tests
Previously, the override mutators were being run before the prebuilt
mutators that did not match the runtime behavior. This change fixes
that ordering.

In the process it broke TestApexWithAppImportsPrefer. That test tries
to verify that an apex that depends on an android_app will use an
android_app_import if that is preferred. Unfortunately, it only worked
because of the incorrect order of the mutators.

The test worked before this change because the prebuilt mutators were
being run after the overridableModuleDepsMutator. That meant that any
dependencies added by that mutator onto source modules could be
replaced by the PrebuiltPostDepsMutator with the preferred prebuilt
module.

Switching the order to match the runtime meant that the prebuilt
mutators were run before the overrides so never had a chance to replace
the dependencies added by the overrides.

Bug: 181953909
Bug: 181974714
Test: m nothing
Change-Id: Ic98fdc29a63155174a3227e7e918b26f0a8763bb
2021-03-05 18:38:58 +00:00
Paul Duffin d6ceb8600c Clean up cc.RegisterRequiredBuildComponentsForTest()
Changes this function so it only registers components from the cc
package by pushing the call to genrule.RegisterGenruleBuildComponents()
down into those packages whose tests need it.

This will make it easier to migrate cc package tests to test fixtures
as the RegisterRequiredBuildComponentsForTest() no longer overlaps with
preparers from the genrule packages.

Bug: 181070625
Test: m nothing
Change-Id: Ic00c7e480dc738d7a88d038aca6ab95a1502a24a
2021-03-05 18:20:33 +00:00
Treehugger Robot 5921172be1 Merge "Remove Abseil checks from clang-tidy defaults." am: 636d152e08 am: 93a58aaf37 am: d39700c648
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1612584

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Idedbaae3e0b5b4777503107de5950b17784239a2
2021-03-03 00:23:58 +00:00
Christopher Parsons 3bc0783320 Merge "Support cc_object modules in mixed builds" am: bc39e17a1d am: 218cf3dec6 am: cd4dcdda18
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1599675

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2609ec4b223d49d5312bb44ae05b01eefe38a023
2021-03-03 00:23:46 +00:00
Paul Duffin 0b0921a808 Merge "Remove deapexer and prebuilt apex select mutators" am: 4b786d2da1 am: 0630dacc0c am: 9d697b3d94
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1610795

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4670d011f304c943cc6156312b0154e9236ca08f
2021-03-03 00:23:03 +00:00
Treehugger Robot 636d152e08 Merge "Remove Abseil checks from clang-tidy defaults." 2021-03-02 20:22:14 +00:00
Christopher Parsons bc39e17a1d Merge "Support cc_object modules in mixed builds" 2021-03-02 16:44:56 +00:00
Paul Duffin 4b786d2da1 Merge "Remove deapexer and prebuilt apex select mutators" 2021-03-02 10:48:29 +00:00
Treehugger Robot b8b4d74d37 Merge "APEX uses the latest version of the stub" am: ce80f18749 am: 3310e2d9ea am: 803eece603
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1609533

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic9355035dd83782c478a12fb16a5896c50968a58
2021-03-02 03:10:43 +00:00
Treehugger Robot ce80f18749 Merge "APEX uses the latest version of the stub" 2021-03-02 01:02:18 +00:00
Chris Parsons 8d6e433c1e Support cc_object modules in mixed builds
Test: With a handwritten conversion of crtbegin_so1, USE_BAZEL_ANALYSIS=1 m crtbegin_so1
Change-Id: I7c777d7f46b37aa1827cc04205e2014f9293bf35
2021-03-01 18:22:34 -05:00
Krzysztof Kosiński a3014f1c13 Remove Abseil checks from clang-tidy defaults.
Abseil is not available in Android, so these checks are not
actionable.

Test: Compiled frameworks/av, no more spurious warnings.
Change-Id: Ic573a3234a99b0fa1f63449e8d020a17a43a134c
2021-03-01 13:25:03 -08:00
Paul Duffin c04fb9e6a2 Remove deapexer and prebuilt apex select mutators
Originally, when the prebuilt_apex was first created, it selected the
source to use in its DepsMutator. It did that because that was a
convenient place for it to perform that work which had to be:
* After the arch mutator had run so MultiTargets() was available.
* Before the prebuilt_select mutator runs as that relied on the Source
  property to have been set.

Change 064b70c9 then duplicated the call from the DepsMutator of the
deapexer module type that was added as part of the work to make dex
files available for hiddenapi processing.

Change 356f7d45 moved it out of the the DepsMutator methods into its
their own mutators, presumably because it interfered with the
Soong -> Bazel conversion work.

This change improves the existing PrebuiltSrcsSupplier mechanism to
support reporting errors so that the logic for selecting the source can
be done on demand rather than in separate mutators.

The main complication was that PrebuiltSrcsSupplier is called with a
BaseModuleContext for both source and prebuilt modules so it cannot use
any methods on it that are related to the current module. That
necessitated adding MultiTargets() to android.Module.

Bug: 181267622
Test: m droid
Change-Id: I106c78fd21016f051a315b82b470d8f12b1f820b
2021-03-01 17:11:25 +00:00
Jingwen Chen 713cff84de Merge "bp2build: add configurable attribute (select) support." am: 37bd24a1db am: 1c65191027 am: f28de7434b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1603778

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iafe936decfc711746a17c4a6348c141654b60fc0
2021-03-01 16:05:08 +00:00
Jingwen Chen 37bd24a1db Merge "bp2build: add configurable attribute (select) support." 2021-03-01 13:43:55 +00:00
Jiyong Park 55549df051 APEX uses the latest version of the stub
Previously when an APEX whose min_sdk_version is set is linked to an
external library providing multiple versions of stubs, the
maximum version that is less than or equal to the min_sdk_version was
chosen. For example, if the versions of a library stubs are 28, 29, 30,
and 31, then APEX with min_sdk_version: 29 linked to the version 29 of
the stub.

This was to ensure that the APEX doesn't use any new APIs whose
existence can't be guaranteed.

This however imposes a severe restriction that the APEX can never use
new APIs even when the APIs are actually available: i.e. when the
APEX is running on a newer platform.

With the recent work about unguarded availability, using the future APIs
became much safer. When you use an API that is newer than your
min_sdk_version, the API is automatically declared as a weak symbol
(thus no link error at runtime), while the call to API is guaranteed to
be guarded with the `__builtin_available(...)` macro.

So, there really is no reason to use the old version of the stub. We can
always use the latest version of stub safely.

Bug: N/A
Test: m
Change-Id: Iaac0d8761d8929154527dc2e861a51ae31e23d49
2021-03-01 09:12:32 +00:00
Chih-hung Hsieh 1627347d0b Merge "Forbit extra quotes in tidy flag lists" am: 7e52be849e am: 7b68407ec9 am: e0e2b40599
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1600697

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3ca5feb72e08337db7824fb4333b15dc48723586
2021-03-01 08:57:02 +00:00
Chih-hung Hsieh 7e52be849e Merge "Forbit extra quotes in tidy flag lists" 2021-02-27 08:45:47 +00:00
Justin Yun 163722ae1d Define getSnapshotNameSuffix() am: 07b9f86f0c am: 1ddff5f76f am: 0a6226c014
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1607900

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I607959e437b8e3bb4b082a6cdb42a358d1c7701d
2021-02-26 11:13:51 +00:00
Jingwen Chen 5d8644990b bp2build: add configurable attribute (select) support.
This CL adds a basic framework to support configurable string_list
attributes, selecting on the Arch variant (x86, x86_64, arm, arm64).

It offers fine-grained controls to map individual configurable
properties (arch_variant) to configurable Bazel attributes, starting
with the string_list type for the copts property for cc_object.

This design is primarily motivated to have minimal boilerplate in
bp2build mutators, allowing anyone to opt-in configurable attributes,
and modify intermediate states before passing them on into the
CreateBazelTargetModule instantiator.

Fixes: 178130668

Test: go tests
Test: build/bazel/scripts/milestone-2/demo.sh

Change-Id: Id6f04d7c560312a93e193d7ca4e1b7ceb6062260
2021-02-26 05:17:54 -05:00
Treehugger Robot 4f03289e44 Merge "Remove dependency from vendor_snapshot to each module" am: a777d960ab am: 4f8fa43b99 am: 9fe8c1f482
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1607913

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ibd968597d2fee537c97f83d2b5996cf9a597e210
2021-02-26 06:07:34 +00:00
Justin Yun 07b9f86f0c Define getSnapshotNameSuffix()
By sharing a single function for generating snapshot name suffix,
make sure both the DepsMutator and the snapshot modules use the same
names.

Bug: 179666286
Test: m nothing
Change-Id: I9efa94f2981a6bd1b4128bf0e84ca44873ebf3b7
2021-02-26 14:00:03 +09:00
Chih-Hung Hsieh 217e09a784 Forbit extra quotes in tidy flag lists
* Start with clang-tidy flags;
  maybe other flags should be checked too.

Bug: 180862582
Test: make
Change-Id: I82f86a911733693a14fe56a35e28590b065e3ae7
2021-02-25 20:46:15 -08:00
Treehugger Robot a777d960ab Merge "Remove dependency from vendor_snapshot to each module" 2021-02-26 03:57:42 +00:00
Jingwen Chen b4adee5361 Merge "bp2build: add support for cc_object's objs and exclude_srcs properties." am: 1251bb5775 am: c1858d0f50 am: eb4d958cf6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1600655

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iba2011c8231a68086ff9faabc76794362300083f
2021-02-25 16:36:12 +00:00
Jingwen Chen 1251bb5775 Merge "bp2build: add support for cc_object's objs and exclude_srcs properties." 2021-02-25 14:09:08 +00:00
Justin Yun 4813867ec3 Remove dependency from vendor_snapshot to each module
The 'vendor_snapshot' module is required to every cc_library to check
if the dependencies need to be rewritten to the snapshot modules or
not. However, as the 'vendor_snapshot' module has dependencies to the
snapshot modules, the dependency to the 'vendor_snapshot' module
creates circular dependencies.
The dependency from the 'vendor_snapshot' to the snapshot modules is
required only to read the module names of the snapshot modules. We
may remove the dependency by setting the name of the snapshot modules
directly.

Bug: 179666286
Test: m nothing
Change-Id: I14abcb06c5c81ef7f8535103578747385c89ae0f
2021-02-25 09:31:12 +00:00
Stephen Hines 6e55d59b00 Merge "reverses common and external Clang flags" am: f3e0d22234 am: 4ad07ba7a3 am: 2a934fba72
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1606997

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ifc4e0c7cd537b135bf52af2d86161e65baf8cc32
2021-02-25 08:49:47 +00:00
Christopher Di Bella c28f5d97a6 reverses common and external Clang flags
Flags for external projects are specialisations of the common flags, and
need to follow the common flags, not precede them.

Bug: 181177782
Test: None

Change-Id: I19c8c2a3539573e9b2f2d9e3e1c898fa09570663
2021-02-25 01:34:08 +00:00
Paul Duffin 5951b78bbc Merge "Generated headers may not be arch specific" am: b2773e116f am: 94dad2bdb4 am: 8da901ceae
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1599159

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1a5b6b034b8e5920e51f4eb5c4971c4db01ecf31
2021-02-24 12:02:57 +00:00
Paul Duffin baf573a087 Merge "Fix the snapshot handling of generated headers" am: efa0f00706 am: 7c7d2fc156 am: 3b2020b8a3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1599158

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Icdd6da97232c36e26f0a1baefd0831cdb2aaae6e
2021-02-24 12:02:47 +00:00
Paul Duffin b2773e116f Merge "Generated headers may not be arch specific" 2021-02-24 10:10:23 +00:00
Paul Duffin efa0f00706 Merge "Fix the snapshot handling of generated headers" 2021-02-24 10:08:34 +00:00
Treehugger Robot 17d3ac9aa1 Merge "Move bazel.Properties to a BazelModuleBase" am: bbfd5ab606 am: 035b6e6882 am: 75f8de41e9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1591532

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I137929cc5eb3e20f563f7b184bf088bca913e410
2021-02-24 07:38:44 +00:00
Jingwen Chen db12024524 bp2build: add support for cc_object's objs and exclude_srcs properties.
objs contains module references to other cc_objects that will be used
for linking later. This maps to cc_library deps.

Also support exclude_srcs, and added tests.

Test: bp2build generate, sync, bazel build //bionic/...

Change-Id: I21200ff73f24bcf5357d9df8dcb5519cde532a77
2021-02-24 01:08:57 -05:00
Treehugger Robot bbfd5ab606 Merge "Move bazel.Properties to a BazelModuleBase" 2021-02-24 05:53:25 +00:00
Treehugger Robot 3b148cbc0e Merge "Refactor BazelTargetModule" am: 30899caf1f am: be2383b27d am: 501085ce55
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1596752

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0fdb016f6fa9ef9c54496feaebe0934f885c405d
2021-02-24 02:20:17 +00:00
Paul Duffin 73a7d9be76 Merge "Only export sysprop headers in exported sysprop include directory" am: 1dd5764a4e am: e2db082638 am: 28a690d283
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1596831

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I06da8ac9ac32f5a16eedc0245ec94bb45dad5d96
2021-02-24 02:17:19 +00:00
Treehugger Robot c0c4c82580 Merge "Export aidl, proto and sysprop generated headers separately" am: 2b22365c8c am: d9a7dc9b57 am: bda7188220
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1595276

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2bcc6f82743fdcdba78835c3d893dadc01ec3db7
2021-02-24 02:16:42 +00:00
Treehugger Robot 30899caf1f Merge "Refactor BazelTargetModule" 2021-02-23 20:40:23 +00:00
Liz Kammer ea6666fba9 Move bazel.Properties to a BazelModuleBase
This allows more direct access to the bazel label and whether the module
is bp2build available.

Test: go test *
Change-Id: I23375835d20fa53d7d94127b2dc2d5bb20487bfb
2021-02-23 10:58:57 -05:00
Paul Duffin 1dd5764a4e Merge "Only export sysprop headers in exported sysprop include directory" 2021-02-23 15:28:26 +00:00
Treehugger Robot 2b22365c8c Merge "Export aidl, proto and sysprop generated headers separately" 2021-02-23 14:11:24 +00:00
Liz Kammer fc46bc1ee4 Refactor BazelTargetModule
This eliminates the need to remove quotes, delete attributes, and
re-checking that name has correct prefix. Additionally, this allows
assignment directly to the BazelTargetModuleProperties struct, which
allows defaulting unused fields and clarity of which field is being set.

Test: go test soong tests
Test: ran ./build/bazel/scripts/milestone-2/demo.sh
Change-Id: Ia9bfcce76234c793a4ddd5f29a661150f83341c9
2021-02-23 08:29:40 -05:00
Paul Duffin c9ed7c652a Merge "Add tests for exported generated headers" am: bc179bc44f am: d24432aaf0 am: 16a1b25774
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1595275

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I13b1df790dde3540473b339110e448b69507b8e6
2021-02-23 01:09:27 +00:00
Treehugger Robot 277303f042 Merge "Add ctx to AndroidMkExtraEntriesFunc" 2021-02-22 22:40:31 +00:00
Paul Duffin 7a7d067c74 Generated headers may not be arch specific
Previously, it was assumed that generated headers must be arch specific
and so prevented the fields referencing the paths to those headers from
being automatically optimized by the sdk generation code. That is not
always the case, e.g. with headers generated from protos so this change
allows those fields to be optimized.

Bug: 180427921
Test: m nothing
Change-Id: Id2af419d58ae3c30ea6d9e87f71e33a9ff6ba13b
2021-02-22 18:23:22 +00:00
Paul Duffin 42dd4e6cd6 Fix the snapshot handling of generated headers
Previously, the snapshot handling code did not preserve the directory
structure of generated include directories and instead just copied the
headers into the same module specific directory and added that single
directory to the export_include_dirs (or similar) property.

That had a couple of issues:
* The include directory was repeated in the ..._include_dirs property.
* It did not work when the include directories overlapped.

In the latter case it had a couple of issues:
* Code which compiled fine against the source would not compile against
  the prebuilt.
* Header files were duplicated in the output.

e.g. assume the following generated header file structure:
  foo/
      foo.h
  bar/
      bar.h
      baz/
          baz.h

When the sdk snapshot was passed include directories of "foo", "bar" and
headers of "foo/foo.h", "bar/bar.h", "bar/baz/baz.h" it would generate a
snapshot with the structure:
  include_gen/
      foo.h
      bar.h
      baz/
         baz.h

And:
  export_include_dirs: ["include_gen", "include_gen"]

However, when the include directories overlapped and include directories
of "foo", "bar" and "bar/baz" were passed in the directory structure
would be the same and the export_include_dirs would contain 3 usages of
"include_gen".

That meant that source code which used the following would build
against the source (because it would find "baz.h" in the "bar/baz"
include directory) but would fail when built against the prebuilts
because the "include_gen" directory did not contain "baz.h":
    #include "baz.h"

This change preserves the input directory structure for generated files
in a similar way to how it does it for source files. So, the snapshot
structure looks something like this:

  include_gen/
      foo/
          foo.h
      bar/
          bar.h
          baz/
              baz.h

And:
  export_include_dirs: [
    "include_gen/foo",
    "include_gen/bar",
    "include_gen/bar/baz",
  ],

Bug: 180427921
Test: m nothing
Change-Id: Id69eef8cf5eecd033841d3b7cd0c044a697ce404
2021-02-22 18:23:22 +00:00
Paul Duffin 37e0de5004 Only export sysprop headers in exported sysprop include directory
Bug: 180712399
Test: m nothing
Change-Id: Ia93d20fe0fecf977773257fa43fe40e7fe9f024f
2021-02-22 18:05:18 +00:00
Paul Duffin 33056e8a9a Export aidl, proto and sysprop generated headers separately
Previously, a cc library that included .aidl, .proto and/or .sysprop
files and exported headers generated from at least one of those types
would actually export generated headers from all of them.

While headers generated from .sysprop files are always exported those
generated from .aidl or .proto should only be exported when explicitly
requested.

This change treats them separately as expected. It has the potential
to break the build as it could reduce the set of headers exported and
so a dependent module that needed those would break. The fix in that
case is to simply add one (or both) of the following to the module
that previously exported those headers:

  aidl: {
    export_aidl_headers: true,
  }

  proto: {
    export_proto_headers: true,
  }

Bug: 180712399
Test: m droid
Change-Id: I488182e27dd423d261443612f98d5c112dd3ef8f
2021-02-22 18:05:10 +00:00
Paul Duffin bc179bc44f Merge "Add tests for exported generated headers" 2021-02-22 18:03:00 +00:00
Justin Yun 5d090eb063 Merge "Update test_min_api_level for cc_test" am: b4697b8125 am: efb6015365 am: 0fabbdb611
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1581288

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9915d2882a1ea03a17796f74413972455c04e566
2021-02-21 07:26:45 +00:00
Justin Yun 107a4cb56c Update test_min_api_level for cc_test
By replacing MinApiLevelModuleController with
ShippingApiLevelModuleController, we don't need to define
api-level-prop option. The property name must not be a parameter but
be defined in the module controller.

test_min_sdk_version is removed as it is not used.

Bug: 178990561
Test: atest vts_core_liblp_test
Change-Id: Ib4660b91c7adb2ec8b970197dc6f65b8e6952a66
2021-02-20 00:46:21 +00:00
Elliott Hughes ca8a75e102 Merge "__ANDROID_UNGUARDED_AVAILABILITY__ is gone now." am: 272649ceb5 am: 8198c438ca am: eac2d22f6b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1596932

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I13975b59c2c7e5c4c13c1795458932e99efc2d34
2021-02-20 00:32:30 +00:00
Colin Cross aa2555387d Add ctx to AndroidMkExtraEntriesFunc
Add a ctx parameter to AndroidMkExtraEntriesFunc to allow them to
access providers.

Test: m checkbuild
Change-Id: Id6becc1e425c3c3d8519248f8c0ce80777fac7cc
Merged-In: Id6becc1e425c3c3d8519248f8c0ce80777fac7cc
2021-02-19 23:05:40 +00:00
Elliott Hughes 272649ceb5 Merge "__ANDROID_UNGUARDED_AVAILABILITY__ is gone now." 2021-02-19 22:27:11 +00:00
Julien Desprez 2e6a5548ce Merge "Switch cc_test host_supported: true to unit tests" am: 251261d01b am: fb7470923a am: c2457399a7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1576042

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Idcee697e2fe9b23e86ca171f4fbabe4d066d84ee
2021-02-19 19:01:05 +00:00
Elliott Hughes 5a8c9531e4 __ANDROID_UNGUARDED_AVAILABILITY__ is gone now.
So no need to keep `-D`ing it.

Bug: http://b/179067538
Test: treehugger
Change-Id: If5bcead40d3bb355c241e363a8f1a956cb144438
2021-02-19 10:43:19 -08:00
Paul Duffin 3cb603eb51 Add tests for exported generated headers
Improves the test coverage for exporting of generated headers. These
tests highlight the bug described in b/180712399.

Follow up changes will refactor and fix bugs in this code. Adding the
tests separately help ensure that those changes do not inadvertantly
change the behavior.

Test: m nothing
Bug: 180712399
Change-Id: I0225b0cf53259071edb99a94be5014ed0e019bde
2021-02-19 17:12:01 +00:00
Julien Desprez 251261d01b Merge "Switch cc_test host_supported: true to unit tests" 2021-02-19 16:55:04 +00:00
Jingwen Chen d82b711739 Merge "bp2build: cc_object converter." am: 4e86b6ae43 am: d178288566 am: 80939fbbe1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1580344

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib51378b26b297469e17d5495ca15b54cd021098d
2021-02-19 05:54:04 +00:00
Jingwen Chen 4e86b6ae43 Merge "bp2build: cc_object converter." 2021-02-19 03:54:43 +00:00
TreeHugger Robot bd72625520 Merge "Add ctx to AndroidMkExtraEntriesFunc" into sc-dev 2021-02-19 01:03:10 +00:00
vichang d4ce81e6eb Merge "Non-installable module should not be installed into a fuzzer .zip package" am: cd821d8283 am: 8c488d9075 am: c96569722b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1579438

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1398cb096137fa516b64b906211fddfeeb1447cc
2021-02-18 10:48:56 +00:00
vichang cd821d8283 Merge "Non-installable module should not be installed into a fuzzer .zip package" 2021-02-18 09:59:06 +00:00
Jingwen Chen 8c1b97e01b bp2build: cc_object converter.
This CL introduces a basic bp2build converter for cc_object modules.
cc_objects maps cleanly to cc_library targets, but with -fnoaddrsig.

This CL also demonstrates generating include deps within a macro to
allow the cc_object compilation to depend on a relative-include header
within an include dir.

e.g. if "foo.cc" includes "android/log.h" and the latter is located at
"include/android/log.h", the autogenerated header deps would export
"android/log.h" correctly to the foo.cc upstream target.

Test: GENERATE_BAZEL_FILES=true m nothing && bp2build-sync write && bazel build //bionic/libc:crtbegin_so1

Change-Id: Ifd9e097051ec184ab0a1929d07918f0ff4f24d98
2021-02-18 03:27:28 -05:00
Colin Cross f79fee864c Add ctx to AndroidMkExtraEntriesFunc
Add a ctx parameter to AndroidMkExtraEntriesFunc to allow them to
access providers.

Bug: 180540739
Test: m checkbuild
Change-Id: Id6becc1e425c3c3d8519248f8c0ce80777fac7cc
2021-02-17 15:24:43 -08:00
Dan Albert 4c3b3c7c50 Merge "[arm64] Build NDK with PAuth and BTI" am: a175126009 am: bfe770d03f am: bb4c44e0c2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1558552

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I44a54ab4900ae02bf0650cb86545a847f508cd5f
2021-02-17 23:18:46 +00:00
Dan Albert a175126009 Merge "[arm64] Build NDK with PAuth and BTI" 2021-02-17 21:37:41 +00:00
Chih-hung Hsieh fa762e7121 Merge "Change default DEFAULT_TIDY_HEADER_DIRS to empty" am: 6e304f5a88 am: 030f75fa56 am: 39e4767dcb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1584224

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I6eb28309d7655b7cc75f80335e52391df478f228
2021-02-17 19:48:45 +00:00
Chih-hung Hsieh 6e304f5a88 Merge "Change default DEFAULT_TIDY_HEADER_DIRS to empty" 2021-02-17 18:34:48 +00:00
Victor Chang 00c144f930 Non-installable module should not be installed into a fuzzer .zip package
libicu_* fuzzer depends on installable cc modules and non-installable
cc modules with the same name, because the non-installable modules are
stubs used in the compile-time, and shouldn't be used in runtime.

Bug: 175583039
Test: make haiku dist
Test: Run 2 arbitrary binaries from out/dist/fuzz-target-x86_64.zip on device
Test: Run 2 arbitrary binaries from out/dist/fuzz-host-x86_64.zip on host
Change-Id: I0ecf24bb83e3985da3b8f393adab8c87ab7400c6
2021-02-17 16:40:25 +00:00
Rupert Shuttleworth a68296e063 Merge "Add cc_library_headers support to bp2build." am: a0516f76ab am: 9632827e78 am: 90fc4c976c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1589371

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I511571b268dc12107f6eae8d06af0443f765227a
2021-02-17 10:50:50 +00:00
Rupert Shuttleworth a0516f76ab Merge "Add cc_library_headers support to bp2build." 2021-02-17 08:57:19 +00:00
Chih-hung Hsieh 3fd84d16cf Merge "Switch to clang-r412851 (build 7141649)" am: 296b7b8440 am: 691531855f am: 59ce34ec85
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1587546

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I76993c683386449fe64675a8490fbb70bd2d5041
2021-02-17 02:08:49 +00:00
Chih-hung Hsieh 296b7b8440 Merge "Switch to clang-r412851 (build 7141649)" 2021-02-17 00:17:14 +00:00
Elliott Hughes 0beaf98c71 Merge "Rename __ANDROID_UNGUARDED_AVAILABILITY__ -> __ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__." am: 9f53de289e am: 9be8ed2681 am: 486450a014
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1584291

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I553ed1a322abb18ee8777c722530ff323b6742d9
2021-02-16 23:18:03 +00:00
Rupert Shuttleworth 54e7841b90 Add cc_library_headers support to bp2build.
Test: Added cc_conversion_test.go.
Change-Id: Id4459d2c2fa02687a374cd9fb25d687e9678218c
2021-02-16 23:07:01 +00:00
Chih-Hung Hsieh 6338deba1d Switch to clang-r412851 (build 7141649)
Bug: 179065588
Test: presubmit
Change-Id: Ifb9399e9f4ec0968b174b90c1a1f4f78f903d39d
2021-02-12 13:53:10 -08:00
Chih-Hung Hsieh 9f94c362ea Change default DEFAULT_TIDY_HEADER_DIRS to empty
* Default -header-filter will now contain only module directory.
  * In a clean build of aosp_x86_64-eng, this change can reduce
    the number of (duplicated) clang-tidy warnings by 77% or more.
* When compiled with WITH_TIDY=1, if DEFAULT_TIDY_HEADER_DIRS is
  not set, warnings from a header file will be shown only if
  the file is in a module's (sub)directory.
* Set DEFAULT_TIDY_HEADER_DIRS="bionic/|bootable/|build/|cts/|\
  dalvik/|developers/|development/|frameworks/|\
  libcore/|libnativehelper/|system/"
  will get before this change's -header-filter.
* Fix a bug: Default header-filter was not added when
  tidy_flags was defined in a module.
  With this fix, some incorrectly hidden header file tidy warnings
  will now show up.

Bug: 179530304
Test: make with WITH_TIDY=1 and various setting of DEFAULT_TIDY_HEADER_DIRS
Change-Id: Ia0c05349908a730862dae36be9a2dbe4f44fb6da
2021-02-12 13:50:38 -08:00
Elliott Hughes 5add0c61d6 Rename __ANDROID_UNGUARDED_AVAILABILITY__ -> __ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__.
Bug: http://b/179067538
Test: treehugger
Change-Id: I5945ca6e767212280a1981e6f78ec3c50acfb3f3
2021-02-11 14:21:59 -08:00
Treehugger Robot fbc7b966a2 Merge "Add LOCAL_LICENSE_KINDS to build/soong" am: b68036f44b am: 0a1087f291 am: 66a854d585
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1575543

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Icb7ac70ed37be73b84da59f8e1ad88daea3bfa80
2021-02-10 09:28:19 +00:00
Treehugger Robot b68036f44b Merge "Add LOCAL_LICENSE_KINDS to build/soong" 2021-02-10 07:18:29 +00:00
Treehugger Robot 709a2ab213 Merge "Ensure that stubs.symbol_file has ".map.txt" suffix" am: 509ab03f12 am: 1950b77215 am: f2db4bc32c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1574808

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I08d432f551eb509cd847c6f9c27edc5067d9b73c
2021-02-10 01:47:07 +00:00
Jose "Pepe" Galmes c7566be823 Merge "Implement directed recovery snapshot." am: ee4dcdc0ad am: ab1e7cc897 am: 34c5caff4e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1581563

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If8c598d817ea88980bc734afe469acc72984470d
2021-02-10 01:45:57 +00:00
Treehugger Robot 1950b77215 Merge "Ensure that stubs.symbol_file has ".map.txt" suffix" am: 509ab03f12
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1574808

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic8a69aef4b1fc5a2518460224707e724519c1ec0
2021-02-10 01:21:41 +00:00
Treehugger Robot 509ab03f12 Merge "Ensure that stubs.symbol_file has ".map.txt" suffix" 2021-02-10 01:07:30 +00:00
Jose "Pepe" Galmes ab1e7cc897 Merge "Implement directed recovery snapshot." am: ee4dcdc0ad
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1581563

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If399d2d14df5a163662e857430a449c8be02503b
2021-02-10 00:28:34 +00:00
Jose "Pepe" Galmes ee4dcdc0ad Merge "Implement directed recovery snapshot." 2021-02-10 00:02:34 +00:00
Benjamin Schwartz aeda6e49f4 powerstats: PowerStats HAL has been renamed am: 71dfb344e4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1576505

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I755bd9fc0a79730c95ab1d7596e868f156d492fb
2021-02-09 22:21:30 +00:00
Benjamin Schwartz 725482b4ab Create Power Stats AIDL interface am: 1057ccb75a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1576504

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I89b2061a22bfe2bd449917066354937277085846
2021-02-09 22:20:58 +00:00
Treehugger Robot 609b124e5e Merge changes from topic "ps 2.0 cp"
* changes:
  Update VndkMustUseVendorVariantList
  powerstats: PowerStats HAL has been renamed
  Create Power Stats AIDL interface
2021-02-09 19:20:10 +00:00
Jose Galmes 4c6895e5a3 Implement directed recovery snapshot.
Bug: 177451657
Test: m -j nothing
Change-Id: I0b84c34fb2e9e9340d9f9e7405428cd2cc4d43b5
2021-02-09 08:25:34 -08:00
Ivan Lozano f5de1a6146 Merge "rust: Add rust_ffi_static vendor ramdisk Support" am: 4ccfcc2ee4 am: 86af4b576f am: 325c8526b5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1578523

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I89309e092a56bd53a5ae7bbe999a91a7c5f0a8e8
2021-02-09 15:44:32 +00:00
Ivan Lozano 4ccfcc2ee4 Merge "rust: Add rust_ffi_static vendor ramdisk Support" 2021-02-09 13:49:28 +00:00
Ivan Lozano e6d3098c1b rust: Add rust_ffi_static vendor ramdisk Support
Similar to our vendor support, this adds support for linking rust static
libraries to vendor ramdisk cc modules.

A bug fix is also included where a restriction against setting rust_ffi
vendor-specific was not being enforced.

Bug: 179397942
Test: Example modules link, Soong tests pass.
Change-Id: I737cdf0c2f49ab349bcea2a0429e6298ebc1313e
2021-02-08 09:36:26 -05:00
Bob Badour 02040de891 Add LOCAL_LICENSE_KINDS to build/soong
Added SPDX-license-identifier-Apache-2.0 to:
  Android.bp
  android/Android.bp
  android/soongconfig/Android.bp
  androidmk/Android.bp
  apex/Android.bp
  bazel/Android.bp
  bp2build/Android.bp
  bpf/Android.bp
  bpfix/Android.bp
  cc/Android.bp
  cc/config/Android.bp
  cc/libbuildversion/Android.bp
  cc/libbuildversion/tests/Android.bp
  cc/ndk_api_coverage_parser/Android.bp
  cc/ndkstubgen/Android.bp
  cc/symbolfile/Android.bp
  cmd/dep_fixer/Android.bp
  cmd/diff_target_files/Android.bp
  cmd/extract_apks/Android.bp
  cmd/extract_jar_packages/Android.bp
  cmd/extract_linker/Android.bp
  cmd/fileslist/Android.bp
  cmd/host_bionic_inject/Android.bp
  cmd/javac_wrapper/Android.bp
  cmd/merge_zips/Android.bp
  cmd/multiproduct_kati/Android.bp
  cmd/path_interposer/Android.bp
  cmd/pom2bp/Android.bp
  cmd/pom2mk/Android.bp
  cmd/sbox/Android.bp
  cmd/soong_build/Android.bp
  cmd/soong_env/Android.bp
  cmd/soong_ui/Android.bp
  cmd/zip2zip/Android.bp
  cmd/zipsync/Android.bp
  cuj/Android.bp
  dexpreopt/Android.bp
  dexpreopt/dexpreopt_gen/Android.bp
  env/Android.bp
  etc/Android.bp
  filesystem/Android.bp
  finder/Android.bp
  finder/cmd/Android.bp
  genrule/Android.bp
  jar/Android.bp
  java/Android.bp
  java/config/Android.bp
  kernel/Android.bp
  linkerconfig/Android.bp
  linkerconfig/proto/Android.bp
  makedeps/Android.bp
  partner/Android.bp
  phony/Android.bp
  python/Android.bp
  python/tests/Android.bp
  remoteexec/Android.bp
  rust/Android.bp
  rust/config/Android.bp
  scripts/Android.bp
  sdk/Android.bp
  sh/Android.bp
  shared/Android.bp
  symbol_inject/Android.bp
  symbol_inject/cmd/Android.bp
  sysprop/Android.bp
  tradefed/Android.bp
  ui/build/Android.bp
  ui/logger/Android.bp
  ui/metrics/Android.bp
  ui/metrics/proc/Android.bp
  ui/status/Android.bp
  ui/terminal/Android.bp
  ui/tracer/Android.bp
  xml/Android.bp
  zip/Android.bp
  zip/cmd/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to:
  finder/fs/Android.bp
  third_party/zip/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work

Change-Id: Ia47ca14f16b8c9f84f9d533a07e5b00e2c04e8d4
2021-02-06 04:23:21 +00:00
Jooyung Han 42fe5a7251 Merge "cc: fix version macro for stubs" am: 7701309889 am: 1a90279656 am: ec3a7c5db0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1574812

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I607d6dd16636e367c43f491eed4e3461e7c48004
2021-02-06 03:06:35 +00:00
Jooyung Han 7701309889 Merge "cc: fix version macro for stubs" 2021-02-06 01:41:31 +00:00
Jose "Pepe" Galmes 9e2ea6ab6d Merge "Generate fake versions of modules excluded in directed vendor snapshot." am: c64b961708 am: 504904f063 am: a05d6919cf
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1572856

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I106e382c504c59c7028c2b7a3e32b11a93d01822
2021-02-05 19:28:43 +00:00
Jose "Pepe" Galmes c64b961708 Merge "Generate fake versions of modules excluded in directed vendor snapshot." 2021-02-05 17:54:48 +00:00
Jose Galmes 0a942a0368 Generate fake versions of modules excluded in directed vendor snapshot.
When using the directed vendor snapshot, the build fails because soong
fails to find some variants of the modules that have been excluded
from VENDOR_SNAPSHOT_MODULES, even though those modules are not going
to be used by the build.

The solution implemented here is to generate fake versions of those
modules (empty files) and include them in the generated Android.bp,
so that soong finds the modules, even though trying to use them would
fail.

Bug: 171821997
Bug: 179275601

Test: source build/envsetup.sh
Test: m -j nothing

Change-Id: Ibd3e963ab3e5504c0ac817f7cabbd241bf47a5cb
2021-02-05 17:53:53 +00:00
Liz Kammer 73f2874a87 Merge "bp2build: convert paths/module refs to Bazel label" am: b7eab01167 am: 6d5454d0f9 am: 595abf120a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1564272

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I51fd926cdae810906a75ed132dc70fa2f2c74240
2021-02-05 15:40:11 +00:00
Liz Kammer b7eab01167 Merge "bp2build: convert paths/module refs to Bazel label" 2021-02-05 13:39:08 +00:00
Treehugger Robot 3ddf0d105d Merge changes I904b4374,I6b4ea062 am: 4f67b03e8b am: 4cc87fe37b am: c8165f662f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1571886

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I7f8aab297d1ceb4dc5b7da89c35f550524c7855c
2021-02-05 04:36:27 +00:00
Jooyung Han 11b0fbdbf6 cc: fix version macro for stubs
When a cc module is built against a stub, compiler passes version macro
of the stub lib. Version macro should be numeric, so codenames or
"current" should be mapped to numbers just like how ndkstubgen maps to.

* "current" -> future (10000)
* codenames -> look up api_level.json
* otherwise -> cast to int

Bug: 179329813
Test: m / soong test / manually check the output build.ninja
Change-Id: Ic0e1dd904984e161694a0b77fad5559c06a4462f
2021-02-05 11:27:57 +09:00
Chih-hung Hsieh adb8e2869a Merge "Disable gnu-folding-constant warning." am: adeb44b112 am: 7bca661e9a am: e2df322a97
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1573787

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I6a340942ffda731970021c2f618f84c876a26127
2021-02-05 01:54:41 +00:00
Treehugger Robot 4f67b03e8b Merge changes I904b4374,I6b4ea062
* changes:
  Do not add '.product' suffix for product_specific module
  Use target dependent module to update the name suffix
2021-02-05 01:52:04 +00:00
Benjamin Schwartz 6ff77eace0 Update VndkMustUseVendorVariantList
Bug: 150578172
Test: m
Change-Id: I68635557faff1bd8daa4964af7946a54a8dee60d
Merged-In: I3e82b2c01f1fca75ac97985053b4a5826d151340
2021-02-04 17:13:11 -08:00
Benjamin Schwartz 71dfb344e4 powerstats: PowerStats HAL has been renamed
Bug: 169864180
Test: m
Change-Id: I0db7d731c3aa81b2c9331570c93ec23038bd743c
(cherry picked from commit 399394b702)
Merged-In: I0db7d731c3aa81b2c9331570c93ec23038bd743c
2021-02-04 16:10:44 -08:00
Benjamin Schwartz 1057ccb75a Create Power Stats AIDL interface
Bug: 162472196
Test: m
Change-Id: I44ffdf07c181cb4a119ec5de73bcb9ffaf485504
(cherry picked from commit 5ec7024911)
Merged-In: I44ffdf07c181cb4a119ec5de73bcb9ffaf485504
2021-02-04 16:09:20 -08:00
Chih-hung Hsieh adeb44b112 Merge "Disable gnu-folding-constant warning." 2021-02-04 23:59:27 +00:00
Chih-Hung Hsieh 72e88767dc Disable gnu-folding-constant warning.
New clang compiler issue too many such warnings.

Bug: 179065588
Bug: 179309338
Bug: 179278370
Test: make, presubmit
Change-Id: I9948a4b34ec75a01aa24c2fd753722b072ae5202
2021-02-04 11:46:40 -08:00
Liz Kammer 356f7d45c1 bp2build: convert paths/module refs to Bazel label
This currently expands all globs, still need to support converting glob
syntax.

Test: go build_conversion_test
Test: GENERATE_BAZEL_FILES=true m nothing
Test: m nothing
Bug: 165114590
Change-Id: If7b26e8e663d17566fad9614ca87a8da1f095284
2021-02-04 13:45:56 -05:00
Julien Desprez 8908b37a14 Switch cc_test host_supported: true to unit tests
Test: presubmit
Bug: 179092189
Change-Id: Ic5c3ca6de44732f6299ad9a35d1aaef622f3ff7f
2021-02-04 10:10:16 -08:00
Jiyong Park a417557f80 Ensure that stubs.symbol_file has ".map.txt" suffix
The property refers to the symbol file that describes APIs across
updatable components like APEXes and system/vendor. Since it's important
to keep the APIs backwards incompatible, any change to the APIs should
be reviewed/gated by the NDK API council. The map.txt suffix is the key
for trigging the NDK API review by gerrit.

Bug: N/A
Test: m nothing
Change-Id: I01eae9c6a106d301863ec86e169111712af74d3f
2021-02-04 21:05:47 +09:00
Julien Desprez 4e153fe708 Merge "Test changing default of cc_test_host" am: 23c38fa9a7 am: 042adabd94 am: 9dfb08197a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1549529

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ice73eacf0e8061510116f58cbb31615b9846a1e1
2021-02-04 02:25:56 +00:00
Justin Yun d00f5ca1df Do not add '.product' suffix for product_specific module
When a module has both 'product_specific: true' and
'vendor_available: true', the module does not have core variant but
have product and vendor variant modules. As the module generated
multiple variants, the names of the modules have the variant name
suffix. However, it did not create the module with the base module
name because it does not have core variant.

As the base module, in this case, is the product variant, use the
base module name for the product variant without adding the
'.product' suffix to it.

Bug: 161913599
Test: m hidl_test_product@2.0-adapter-helper
Change-Id: I904b43744579a6e89cecbc2e529122eaa8b14cae
2021-02-03 19:43:02 +09:00
Justin Yun cbca373efa Use target dependent module to update the name suffix
The module names for vendor and product variants have the image
variant suffix to avoid conflict with the core modules. It requires
updating the module names in the dependency tree with the suffixes.

We had a hidden bug that used the original module properties to
update the names of its dependent modules.
Also, it must cover the product variants modules.

Test: updated cc_test.go and build
Change-Id: I6b4ea062d13c8fac1e699138d44376e52e0d7852
2021-02-03 19:42:29 +09:00
Inseob Kim 88796ab3d8 Merge changes from topics "snapshot_androidmk_suffix", "snapshot_list_module" am: 38ce066d3b am: de6f9afbed am: eb313b0574
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1558812

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I89a122a4ad3007bd223407f8a7fd13629b3c4717
2021-02-02 01:55:24 +00:00
Colin Cross 9bd4560e0a Remove some global state from vendor and recovery snapshots am: e0edaf9d49 am: cdab9928d0 am: ba1e014129
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1558811

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If45399cab752d0f91c640735a74f73d4a01fba00
2021-02-02 01:55:21 +00:00
Julien Desprez 3b933d3165 Test changing default of cc_test_host
Switching all cc_test_host to unit_tests: true by default.
Resolved all the failures (passing presubmit) to enable this.

Test: presubmit trigger
Bug: 177450457
Change-Id: I815e40786c0b62cf0aadd9b837d35c48332639da
2021-02-01 17:34:44 -08:00
Colin Cross a889080aba Remove global state on module suffixes from vendor and recovery snapshots
Propgate the Android.mk suffix from source modules into the snapshot so
that it can be used for the prebuilt modules.

Bug: 177098205
Test: vendor_snapshot_test.go
Change-Id: Iea151dc91395f714fbcad1df3a6fd0874e5455d9
2021-02-01 20:06:29 +09:00
Colin Cross e0edaf9d49 Remove some global state from vendor and recovery snapshots
Snapshots storead global sets of modules that should be replaced with
vendor snapshot modules.  Move the data instead to a vendor_snapshot
or recovery_snapshot module type that depends on all the modules in
the snapshot, and then have modules that should use the snaphsot
depend on it to query for the set of modules that should be replaced.

Bug: 177098205
Test: vendor_snapshot_test.go
Change-Id: I2826adacfb473e9139b5ea93ba83b8a54cc1a56b
2021-02-01 20:02:39 +09:00
Ivan Lozano d8ff4daa91 rust: Allow rust_tests to include data files. am: 9da4aa8166 am: bf557705c1 am: 6604580d74
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1565177

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib1a8d5a5cb175598a783c686a9055300338ebf59
2021-01-30 00:56:04 +00:00
Ivan Lozano 9da4aa8166 rust: Allow rust_tests to include data files.
Adds the ability to define data files that should be installed alongside
the test.

This also fixes a bug wherein rust_test properties were duplicated.

Bug: 171710847
Test: rust_test module with "data" property installs files to device.
Change-Id: I091489afaf7e76b751a33a28049590d9fb39fe5f
2021-01-29 14:31:32 -05:00
Colin Cross 2df8177575 Add Target to cc.SharedLibraryInfo
Dependencies from common arch modules like java libraires to cc modules
may need to retrieve the Target of the library, add it to
SharedLibraryInfo.

Bug: 176593487
Test: cc_test.go
Change-Id: I93ab9da5fab2ccc42c6b483a6d83c071b541d1e6
2021-01-26 11:02:53 -08:00
Treehugger Robot aad56c2567 Merge "Define odm_available property to install a vendor variant to odm" am: 65490b8cf3 am: cae1637ce5 am: 6b2fbaf2a4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1542687

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I975f350b63d1b1796bc623205555033a65a4d02e
2021-01-26 13:36:57 +00:00
Treehugger Robot 65490b8cf3 Merge "Define odm_available property to install a vendor variant to odm" 2021-01-26 11:32:18 +00:00
Tamas Petz bca786d742 [arm64] Build NDK with PAuth and BTI
This change adds a new arch named "armv8-a-branchprot". The new target
is no different from the usual "armv8-a" variant except it has the
compiler flag "-mbranch-protection=standard" set.

With this flag compiler emits Armv8.3-A Pointer Authentication and
Armv8.5-A Branch Target Identification instructions. All of these
instructions are in the hint space; therefore devices which do not
support any of these extensions would execute them as NOPs.

In terms of directory structure there is no change in the output of
build/soong/scripts/build-ndk-prebuilts.sh script.

Test: build NDK prebuilts

Change-Id: Ie52ccba5653fbf567f0b7ca312d8a8e71602ad06
2021-01-26 08:15:07 +01:00
Jeongik Cha 57272380ff Update VndkMustUseVendorVariantList
As AIDL version rule is changed, change VNDK list accordingly.
'unstable' and non-versioned aidl module will be cleaned up

Bug: 150578172
Test: m
Change-Id: I3e82b2c01f1fca75ac97985053b4a5826d151340
Merged-In: I3e82b2c01f1fca75ac97985053b4a5826d151340
2021-01-26 10:20:49 +09:00
Treehugger Robot b30b0884fa Merge "Enable clang-analyzer-optin.performance.* checks" am: 7328c25275 am: 45e98eb600 am: bbdf4b38ed
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1559878

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4288232390fe305737adbb1b27dc3faef6fc727d
2021-01-26 01:08:05 +00:00
Jeongik Cha e6b5399da3 Merge changes from topic "b/150578172-2"
* changes:
  Update VndkMustUseVendorVariantList
  update apex allowed deps
2021-01-26 00:16:58 +00:00
Chih-Hung Hsieh e9dca0aa0e Enable clang-analyzer-optin.performance.* checks
* Now CLANG_ANALYZER_CHECKS=1 simply enable all clang-analyzer-* checks.

Test: make with WITH_TIDY=1 CLANG_ANALYZER_CHECKS=1
Change-Id: Ib97a2c491df66088197805e979e4bec28f2f433c
2021-01-25 14:00:51 -08:00
Colin Cross 25bb7fdf93 Merge changes I0c9b81d6,Ib1120f98 am: c203ed422a am: 4b44975ad0 am: b4d93cc692
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1558810

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ica6e5c2a66a699503c87cace284da409b088f72a
2021-01-25 19:47:02 +00:00
Yabin Cui 217c8eec1b Merge "Switch to clang-r407598b (12.0.2)." am: 824e5ac072 am: 17c79160c2 am: da6c37dd22
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1557054

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Idbf24aa0134ea732a1b5fe25454b472345283421
2021-01-25 19:46:49 +00:00
Colin Cross c203ed422a Merge changes I0c9b81d6,Ib1120f98
* changes:
  Add vendor_available coverage to TestVendorSnapshotUse
  Move vendor snapshot tests into vendor_snapshot_test.go
2021-01-25 19:10:52 +00:00
Yabin Cui 824e5ac072 Merge "Switch to clang-r407598b (12.0.2)." 2021-01-25 17:41:31 +00:00
Colin Cross 49d9f605d7 Merge changes from topic "revert_vendor" am: c21e30bb56 am: 0ba23c1903 am: ff381094c1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1557798

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If26691d346e45f377307188cd92b0ffa07756703
2021-01-25 16:46:02 +00:00
Colin Cross c21e30bb56 Merge changes from topic "revert_vendor"
* changes:
  Revert "Revert "Truncate vendor snapshot header glob list after filtering it""
  Revert "Revert "Speed up vendor snapshot header globs""
2021-01-25 16:07:51 +00:00
Justin Yun ebcf0c5e15 Define odm_available property to install a vendor variant to odm
'vendor_available: true' creates a vendor variant from a system
module. The vendor variant of the module is installed to /vendor.
However, we may want to install the vendor variant to /odm, instead.

'device_specific: true' does not work for this purpose because
'vendor_available: true' is allowed only for the system or product
modules to create a vendor variant. But 'device_specific: true'
itself creates a vendor variant that may not work with
'vendor_available: true'.

To install the vendor variant to /odm, we define a new property
'odm_available'. 'odm_available' is exactly the same as the
'vendor_available' except the install path of the vendor variant.
By defining 'odm_available: true', the vendor variant of the module
will be installed to /odm or /vendor/odm instead of /vendor.

Bug: 176147321
Bug: 176079978
Test: check if a module with 'odm_available: true' is installed to
      /vendor/odm
Change-Id: I2d16bd2c515796597b2fbd1eb66f7c2736434697
2021-01-25 17:08:44 +09:00
Justin Yun 5bb120fe70 Check vndk-private with the IsVndkPrivate() am: e09ac17466 am: 9f900373d7 am: 24ee8579e9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1554987

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9edbfdaa1ba40c1460f728ad0fee44625fbd0038
2021-01-23 02:43:37 +00:00
Colin Cross 2e577f3657 Add vendor_available coverage to TestVendorSnapshotUse
Test that the correct suffix is added to the Make references to a
vendor_available library in a vendor snapshot.

Bug: 177098205
Test: vendor_snapshot_test.go
Change-Id: I0c9b81d63798e221db856fa0e4742a467c356fcb
2021-01-22 17:42:31 -08:00
Colin Cross 0fce0bab12 Move vendor snapshot tests into vendor_snapshot_test.go
Move the vendor snapshot tests into vendor_snapshot_test.go to
reduce the size of cc_test.go

Bug: 177098205
Test: go test ./build/soong/cc/...
Change-Id: Ib1120f986fc0111a9487fce00539a4c5ae7e2e87
2021-01-22 17:42:28 -08:00
Justin Yun e09ac17466 Check vndk-private with the IsVndkPrivate()
*_available will not provide if a module is VNDK-private or not.
Fixed it by using IsVndkPrivate() with private() interface.

By allowing exclude_from_vendor_snapshot for vendor_available
modules, available() interface is no longer required. Tests are
updated for exclude_from_vendor_snapshot on vendor_available modules.

Bug: 175768895
Test: m nothing
Change-Id: I9ff85256170d59b378a4c354d5c007cfbeacabc5
2021-01-23 01:11:58 +00:00
Colin Cross 75862ebcb2 Merge "Fix mismatch between cc and python for windows prefer32" am: 9b564c5a22 am: 0448d58125 am: a5085a5fd1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1554549

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I78510184ca457855b032d54c5f5613c438b2257f
2021-01-23 00:45:56 +00:00
Colin Cross 9b564c5a22 Merge "Fix mismatch between cc and python for windows prefer32" 2021-01-22 23:34:00 +00:00
Dan Willemsen da37007955 Merge "Add Mac 11.1 SDK to the allowlist" am: ba680de96e am: 21a794a0d8 am: 332fd96a00
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1556740

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib511f0fbd3b5f38ce9f00bb489919cfcc12b045e
2021-01-22 21:28:40 +00:00
Dan Willemsen ba680de96e Merge "Add Mac 11.1 SDK to the allowlist" 2021-01-22 19:05:09 +00:00
Colin Cross 1f2f4eb07d Revert "Revert "Truncate vendor snapshot header glob list after filtering it""
This reverts commit 758140ceae.

Reason for revert: modifying glob results no longer corrupts cache after aosp/1557261

Change-Id: Id94f1f5835a93e83dc9f465627913b91908d3560
2021-01-22 18:06:57 +00:00
Colin Cross ec118d0734 Revert "Revert "Speed up vendor snapshot header globs""
This reverts commit c2aff9e9fd.

Reason for revert: modifying glob results no longer corrupts cache after aosp/1557261

Change-Id: I682b92ad08c82ac4fa5482497cb587bd0223d21b
2021-01-22 18:05:59 +00:00
Jeongik Cha f5c418cedf Update VndkMustUseVendorVariantList
As AIDL version rule is changed, change VNDK list accordingly.
'unstable' and non-versioned aidl module will be cleaned up

Bug: 150578172
Test: m
Change-Id: I3e82b2c01f1fca75ac97985053b4a5826d151340
2021-01-22 20:32:02 +09:00
ChengYou Ho 262adc3e41 Create Weaver aidl interface am: 4b197e110b am: 1ba735ada4 am: 56a957fa9a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1554279

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I85131d81820b53a852633ec758510a580503bcf1
2021-01-22 07:44:07 +00:00
ChengYou Ho 4b197e110b Create Weaver aidl interface
Bug: 176107318
Change-Id: Ia4b628edf1ef51c71af7078818c0adf2a4183d03
2021-01-22 06:34:22 +00:00
Daniel Cardenas 915ee01fef Merge changes from topic "revert_vendor" am: 3e2760a539 am: 7868fe0c6f am: f1d2946eaa
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1556737

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2c3629d513298a21f25335d203964c8a2cac3222
2021-01-22 06:01:46 +00:00
Yabin Cui 5e3d82ebdb Switch to clang-r407598b (12.0.2).
Bug: 178106097
Test: build.
Change-Id: I1ce256547fc395a6b440950b4c88f7fe777c86ee
2021-01-21 21:30:45 -08:00
Daniel Cardenas 3e2760a539 Merge changes from topic "revert_vendor"
* changes:
  Revert "Speed up vendor snapshot header globs"
  Revert "Truncate vendor snapshot header glob list after filtering it"
2021-01-22 05:12:51 +00:00
Christopher Di Bella 81bc3b130d Merge "adds new warnings to Android build (1/2)" am: 490b9d7931 am: 3cab1ce6f5 am: d19b58ada9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1497076

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I6159e650973c49c6b768a109e32ac6f2199fe967
2021-01-21 23:55:11 +00:00
Evgenii Stepanov e0ea5943fc Merge "Support memtag_heap in SANITIZE_TARGET_DIAG, fix cc_test interation." am: 298bafdde9 am: d1926575a7 am: f22bbf2d8c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1550323

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I5922cb4bdc7e722992ca7c435abff4255d13f330
2021-01-21 23:53:35 +00:00
Dan Willemsen 5191b00369 Add Mac 11.1 SDK to the allowlist
Historically we've only had to add one major release a year to the Mac
SDK allowlist, but this year the versioning scheme changed and 11.1 is a
minor update to 11 (instead of 10.x.1 like in years past). Unfortunately
the Xcode tools don't let you just specify '11' like they did with
'10.x', so this is more complicated to fix in a scalable way.

Test: build with xcode 12.3 and macOS SDK 11.1
Change-Id: I2e88e9289727261389a863e7147a0b146ec5148a
2021-01-21 14:56:39 -08:00
Christopher Di Bella 490b9d7931 Merge "adds new warnings to Android build (1/2)" 2021-01-21 22:24:51 +00:00