Commit Graph

5788 Commits

Author SHA1 Message Date
Treehugger Robot c8c4bf4c98 Merge "Add test for building cc_object with Bazel." 2021-04-12 19:40:47 +00:00
Treehugger Robot be66aca8e1 Merge "bp2build: refactor compiler/linker prop function." am: 02e40d0589 am: 39c14f4112 am: e865be2ee1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1671525

Change-Id: I7021083f52dcfec26408a036028d079dab7e5bac
2021-04-12 10:38:46 +00:00
Treehugger Robot 02e40d0589 Merge "bp2build: refactor compiler/linker prop function." 2021-04-12 09:22:30 +00:00
Jingwen Chen cbb95c8c3c Merge "bp2build: cc_library converter for //bionic/libdl:libdl_android" am: a42c707572 am: 361061f817 am: b0441fb8ed
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652408

Change-Id: I2ff24f1aa862cbd9e84e9d2b7a8f69681d032b94
2021-04-12 06:18:01 +00:00
Jingwen Chen a42c707572 Merge "bp2build: cc_library converter for //bionic/libdl:libdl_android" 2021-04-12 04:30:27 +00:00
Justin Yun 7f99ec7c1f Add a test to check the intall partitions
cc modules have complex image variant settings. To avoid setting
wrong partitions to modules, add a test to check the install
partition.

Bug: 184885453
Test: m nothing
Change-Id: I080661335f2da7281d6e6a0d2fedd1fcecb4b2cb
2021-04-12 13:19:28 +09:00
Robin Lee 33db5cbf6e Install device_specific cc_prebuilt to ODM
In aosp/531337 support for installing prebuilts to vendor and odm
partitions was introduced.

Since aosp/1542687 allowed installing vendor variants to odm, we
started to see device_specific cc_prebuilts not installed to odm
at all.

The reason for this is the InVendor condition is true for the
device_specific module and VendorVariantToOdm is false in cases
outside the one it was designed for, so SocSpecific returns true and
the module gets installed to vendor instead of odm.

We need to check if we're specifically building a vendor variant
before triggering this VendorVariantToOdm logic.

Bug: 184885453
Change-Id: I05be06a61c5fc3f2f72599eb4746c9c0523b956e
2021-04-12 13:12:45 +09:00
Tri Vo 481890dbe2 Merge changes I46e851c8,I2c9eb248 am: eed4716def am: 77bf9bd71a am: ec0d17a613
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1662661

Change-Id: I20d8ee08433e88ec2b55fc59a170e9f48a54fd9c
2021-04-10 01:19:53 +00:00
Tri Vo eed4716def Merge changes I46e851c8,I2c9eb248
* changes:
  rust: Add HWASan build support
  Export CC HWASan sanitizer type
2021-04-09 22:31:09 +00:00
Liz Kammer 07bc5f9c4e Add test for building cc_object with Bazel.
Test: go test cc tests
Change-Id: I45a341d09c92f57769d1c3b686f8abac113b3548
2021-04-09 11:50:38 -04:00
Treehugger Robot 2a35da912e Merge "Handle simple prebuilt static libraries from bazel" am: 76579e0e9a am: 70a88424ba am: 8d77e0b2fd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1664542

Change-Id: Ib330bfb45d699a0541c12362939ad780f4057a01
2021-04-09 15:23:32 +00:00
David Srbecky 2211320bf8 Merge "Revert^2 "[strip.sh] Move remaining GNU binutils usage to llvm binutils"" am: 2af7a1b5ff am: dadf9c4fc7 am: c842453fa5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1670068

Change-Id: I254f26a009ee3f54445b2ecaa9e9229d0f47ade3
2021-04-09 13:55:18 +00:00
Treehugger Robot 76579e0e9a Merge "Handle simple prebuilt static libraries from bazel" 2021-04-09 13:38:59 +00:00
David Srbecky 2af7a1b5ff Merge "Revert^2 "[strip.sh] Move remaining GNU binutils usage to llvm binutils"" 2021-04-09 11:58:00 +00:00
Jingwen Chen 107c0de80e bp2build: refactor compiler/linker prop function.
This changes the return value into a compiler/linker attr struct to
standardize callsites and make it easier to retrieve the parsed attrs.

Test: TH
Change-Id: I1e3956e7cb5d924ce8472ece940faea459beef37
2021-04-09 10:45:48 +00:00
Jingwen Chen 6393098ecf bp2build: cc_library converter for //bionic/libdl:libdl_android
This CL contains the converter for libdl_android, a cc_library that
expands into a cc_shared_library and a regular cc_library.

Test: TH
Test: bp2build; bazel test //build/bazel/tests/...

Change-Id: If70641a538211b0d6b2aac0e4d0d06912318304d
2021-04-09 09:42:53 +00:00
Treehugger Robot ab11387b28 Merge changes I86d0600b,Id77f1ce9 am: 2198adce8f am: 4808948409 am: ac244e2b14
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1669726

Change-Id: I40a338803f4afe9f9138a905bc076092ae291502
2021-04-09 01:30:42 +00:00
Treehugger Robot 2198adce8f Merge changes I86d0600b,Id77f1ce9
* changes:
  Use old unwinder for R cc modules
  Redirect memtag libraries to snapshot
2021-04-09 01:12:12 +00:00
Tri Vo 6eafc36e60 Export CC HWASan sanitizer type
We need this so that HWASan sanitizer mutator in CC can sanitize Rust.

Bug: 180495975
Test: m nothing
Change-Id: I2c9eb248df4e55a33f5d45083e91588f4c8e3e94
2021-04-08 14:24:06 -07:00
Rupert Shuttleworth 99f726e28b Merge "Be more explicit about headers in cc_library_static targets." am: a18b3b66cd am: d970597f59 am: fd415679bf
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1664504

Change-Id: I4e5ab5575583bb869f790d447190d939fb07183d
2021-04-08 18:43:24 +00:00
David Srbecky 789fe0fdeb Revert^2 "[strip.sh] Move remaining GNU binutils usage to llvm binutils"
This reverts commit 33dfba1d9c.

Bug: 141010852
Test: art/test.py -t 137-cfi
Test: llvm-objcopy --dump-section=.gnu_debugdata=mdi.xz libhwui.so && \
      unxz -fk mdi.xz && readelf -a mdi | less
Change-Id: I751b51274a961194647ec11fd3fd49886df1e1b3
2021-04-08 18:31:46 +01:00
Inseob Kim d4c9f55468 Use old unwinder for R cc modules
Modules linking against VNDK R have been using libgcc_stripped and
libunwind_llvm as their unwinder. This change uses those old unwinder
libraries if current module's VNDK version is R.

Bug: 178470649
Test: soong test
Change-Id: I86d0600b2fb09cd9828c0a5b1157558711b0ec86
2021-04-08 19:28:28 +09:00
Rupert Shuttleworth c58d3d214e Be more explicit about headers in cc_library_static targets.
Test: bp2build-sync.py write; bazel build //bionic/...
Change-Id: I253b55f4d3cbe76805691b32e761016950871601
2021-04-08 09:43:04 +00:00
Inseob Kim 253f521dbc Redirect memtag libraries to snapshot
memtag sanitizer libraries are vendor available and can be captured as
snapshots. This change adds a redirection logic for memtag libraries.

This is just a workaround, just like other SnapshotInfoProvider calls.
In the future we need to refactor these codes. So TODO is added to
remind refactoring.

Bug: 178470649
Test: soong test
Change-Id: Id77f1ce94255b56a68f3e1d7446a68189c45ac54
2021-04-08 17:10:31 +09:00
Rupert Shuttleworth 2e845e53af Merge "Support arch variations for export_system_include_dirs in cc_library_headers bp2build converter." am: 64a90286c4 am: 197a03958b am: 4f95eb9f95
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1665920

Change-Id: I81dd1f49fabd9ca42fd0faaa4aef213551c052e5
2021-04-08 07:46:05 +00:00
Jose "Pepe" Galmes 93362b658e Merge changes from topic "vendor_snapshot_remove_suffix" am: 37ab310920 am: a490d18c10 am: d8440291d4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1666002

Change-Id: I1536b75d199114c3ff8c5971bd8a41e221aeeb8f
2021-04-08 07:45:57 +00:00
Inseob Kim e06620c33a Automatically set Androidmk suffix of snapshot am: 1b6fb87654 am: 12cdfcba72 am: defa512778
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1664300

Change-Id: I79fd78a8ac7903295ea6fe731a3a25f8c7699078
2021-04-08 07:45:56 +00:00
Rupert Shuttleworth 64a90286c4 Merge "Support arch variations for export_system_include_dirs in cc_library_headers bp2build converter." 2021-04-08 00:54:47 +00:00
Rupert Shuttleworth b815168474 Support arch variations for export_system_include_dirs in cc_library_headers bp2build converter.
Test: Added unit test
Test: bp2build-sync.py write; bazel build //bionic/... works for more cc_library_static targets (in a parent CL)
Change-Id: Ib487216a4bcbc52958ff948722dae347b0d8b606
2021-04-07 16:05:44 +00:00
Liz Kammer 3f9e155f83 Handle simple prebuilt static libraries from bazel
Test: generate & sync BUILD files via bp2build && mixed build droid
Bug: 184192619
Change-Id: I27f0d76c88cbff25f3c7a805f3dfbb1eeaf8e771
2021-04-07 11:07:36 -04:00
Jiyong Park c7e592cdef cpp output of an AIDL file is together with the headers
For an AIDL file, five files are generated for the CPP backend: cpp
output, depfile, and three headers. Previously, the cpp output and the
dep file were created at <module_out>/gen/<abs_path_to_input_aidl>.cpp,
while the headers were at <module_out>/gen/aidl/<package_name>/*.h.

This not only looks inconsistent, but more critically makes it difficult
for the aidl compiler to infer the path to the headers that the build
system registered as implicit outputs. Inferring the implicit outputs
by the aidl compiler is needed because otherwise users will see the
error message from sbox just saying that some of the expected files are
not created. This can happen when the input AIDL file is put directly
into the srcs property without specifying the base directory, e.g.
some/subdir/android/foo/IFoo.aidl where the pacakge is actually
android.foo.

In order to make it easy for developers to fix such an error,
I0f23b6027ba3a4755cc2901f4a7f7fc70bffd0ef introduces a check in the aidl
compiler which is triggered earlier than the sbox error. The compiler
now enforces that the cpp output is at
<out_dir>/<package_name>/<type>.app. When the check fails, it suggests
to fix that by correctly feeding the AIDL file via filegroup and the
path property.

This change in Soong is required to satisfy aidl compiler when the base
directory is correctly set. The cpp output is now at
<module_out>/gen/aidl/<pacakge_name>/<type>.cpp.

Bug: 184586092
Test: aidl_unittests
Change-Id: I172180a40bded4f6c08679a2d862b086998be1e1
2021-04-07 21:49:34 +09:00
Jose Galmes f9523ed579 Fix arch in snapshot DepsMutator.
Suffixes attached to snapshot modules are based on the main architecture
(e.g. "arm64" for aosp_cf_x86_64_phone-userdebug), not the architecture
of arch variants.

Bug: 184588077
Bug: 184695066
Test: Run unit tests using:
Test: source build/envsetup.sh
Test: m -j nothing
Change-Id: Id8d002d45864a6fb12d642b60011e7a9eaf29e07
2021-04-07 11:45:25 +00:00
Inseob Kim 1b6fb87654 Automatically set Androidmk suffix of snapshot
Androidmk_suffix has been captured with "m vendor-snapshot". But the
suffix is to avoid collision with core variants, so the suffix should be
based on the existence of core variants. This change sets the suffix by
using OtherModuleDependencyVariantExists. This way we can also avoid
mutators and global states.

Bug: 179665538
Test: m nothing (soong test)
Change-Id: I35343aa2c4c07782057b82e6dd0e705a786e55fc
2021-04-07 17:24:08 +09:00
Ryan Prichard a467ea4870 Merge "Remove libgcc toolchain libs for Android" am: 3f3bb83f81 am: f72c6f2e44 am: a5934e3408
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1663859

Change-Id: Ia4b0f7de3bac88ab90a3ca0a6dd647117275aa7c
2021-04-07 00:15:50 +00:00
Ryan Prichard 3f3bb83f81 Merge "Remove libgcc toolchain libs for Android" 2021-04-06 21:43:33 +00:00
Christopher Parsons 6c025c3929 Merge "Fix note_memtag bionic libraries in mixed builds" am: b7c6a7ef36 am: 27798cb5d6 am: ff2a9c6ada
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1663541

Change-Id: I0d248d953a3a9463c5eb87ed37e5c9e4dd156c7b
2021-04-06 19:54:54 +00:00
Christopher Parsons b7c6a7ef36 Merge "Fix note_memtag bionic libraries in mixed builds" 2021-04-06 17:57:59 +00:00
Jingwen Chen 14ac490b34 Merge "Add target/os configurable string_list attrs." am: 8f8029a92b am: 695b00f3fc am: c72347401b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1664303

Change-Id: I6775cb20a8e62c98591ba18fb8c2870236eef9b5
2021-04-06 11:48:35 +00:00
Jingwen Chen 8f8029a92b Merge "Add target/os configurable string_list attrs." 2021-04-06 09:47:24 +00:00
Treehugger Robot dd62393313 Merge changes Id33bf640,I4d67b9b9 am: 8c56183fb7 am: b17e061ae9 am: a7fe23c458
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1663139

Change-Id: Ic1434fc150e802f3a6e8b58a9a6f3e16e93da146
2021-04-06 05:29:49 +00:00
Treehugger Robot 8c56183fb7 Merge changes Id33bf640,I4d67b9b9
* changes:
  Don't use incorrect version names like VER or BOARD even in tests
  SdkSpec = Scope + ApiLevel
2021-04-06 03:18:16 +00:00
Chris Parsons eefc9e6a62 Fix note_memtag bionic libraries in mixed builds
Required fixes:
  - Set MakeLinkType for libraries, even in mixed build mode.
  - Set snapshot header information to empty list, which passes
        validation logic for depending modules

Fixing these libraries also requires a Starlark change to
cc_library_static.bzl, which will be submitted separately.

Additionally, this adds better error messaging in the event that
output files are missing from a mixed-build library.

Test: USE_BAZEL_ANALYSIS=1 m libc
Test: USE_BAZEL_ANALYSIS=1 m runtime-module-sdk
Change-Id: Iad2c4d46359986fb0a43263292a15ed45fabbac7
2021-04-05 15:27:55 -04:00
Liz Kammer fe562e4749 Merge "Add bazel_module properties to cc_defaults" am: 9962daec01 am: b54a6c4457 am: 2fde0e00cf
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1660764

Change-Id: If1a59dfce1534d3de561c7f6aea136dbf43fa4c4
2021-04-05 14:27:58 +00:00
Liz Kammer 9962daec01 Merge "Add bazel_module properties to cc_defaults" 2021-04-05 12:33:21 +00:00
Jingwen Chen c1c2650532 Add target/os configurable string_list attrs.
Starting with copts for cc_object, with an extracted function that can
be shared with other cc_* module types.

Test: TH
Change-Id: I9025232e83a3dcd0ca243387486fafbdbd3e2d9b
2021-04-05 11:27:19 +00:00
Jingwen Chen f69daeccb5 Merge "Add os/target configurable selects for label list attributes." am: 1a6bbbd990 am: 16795963e9 am: 13c099f82d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652048

Change-Id: I1ad467167b89e94aacb82db3acfa044135743b62
2021-04-05 09:09:58 +00:00
Jingwen Chen 1a6bbbd990 Merge "Add os/target configurable selects for label list attributes." 2021-04-05 07:09:48 +00:00
Jiyong Park f58c46e36f Don't use incorrect version names like VER or BOARD even in tests
All version names will go through ApiLevelFromUser which triggers an
error when the name is not a valid one.

Bug: 175678607
Test: m
Change-Id: Id33bf64085603914d45ad7942cb8908a4734493f
2021-04-05 09:32:06 +09:00
Ryan Prichard c2018e2ed4 Remove libgcc toolchain libs for Android
Remove Android-targeting gcc toolchain libraries -- libgcc,
libgcc_stripped, libatomic, and libgcov. Also remove libunwind_llvm,
which is replaced with a libunwind toolchain prebuilt.

The __atomic_* library functions are now part of the compiler-rt
builtins library:

https://android-review.googlesource.com/c/toolchain/llvm_android/+/1625025

Bug: http://b/153025717
Test: treehugger
Change-Id: I971d0a4a49f1aaeb3546e80b6d94208277a171ac
2021-04-02 21:07:35 -07:00
Steven Moreland 889dc32103 Merge "Export header check allows WholeStaticLibs" am: f42daa716c am: 3f34589233 am: ed06f3b55e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1662670

Change-Id: I74ff6ad6a2b4aaff4fb1e01dcd896a9b543c8a76
2021-04-02 17:37:44 +00:00
Steven Moreland f42daa716c Merge "Export header check allows WholeStaticLibs" 2021-04-02 16:03:59 +00:00
Liz Kammer 3cf5211890 Add bazel_module properties to cc_defaults
Test: go soong tests
Test: add bazel_module to Android.bp file and m nothing
Change-Id: I13c3e8d59536dbea88f3495309f4f64e849ede9f
2021-04-02 08:44:31 -04:00
Jingwen Chen 91220d7334 Add os/target configurable selects for label list attributes.
This CL is pretty large, so I recommend starting with reading the newly
added tests for the expected behavior.

This change works in conjunction with the linked CLs in the Gerrit topic.
Those CLs add support for new platform() definitions for OS targets
specified in Soong's arch.go, which are configurable through
Android.bp's `target {}` property. It works similary to previous CLs
adding support for the `arch {}` property.

These configurable props are keyed by the OS: android, linux_bionic,
windows, and so on. They map to `select` statements in label list
attributes, which this CL enables for cc_library_headers' header_libs
and export_header_lib_headers props.

This enables //bionic/libc:libc_headers to be generated correctly, from:

    cc_library_headers {
        name: "libc_headers",
        target: {
            android: {
                header_libs: ["libc_headers_arch"],
                export_header_lib_headers: ["libc_headers_arch"],
            },
            linux_bionic: {
                header_libs: ["libc_headers_arch"],
                export_header_lib_headers: ["libc_headers_arch"],
            },
        },
        // omitted props
    }

to:

    cc_library_headers(
        name = "libc_headers",
        deps = [] + select({
            "//build/bazel/platforms/os:android": [
                ":libc_headers_arch",
            ],
            "//build/bazel/platforms/os:linux_bionic": [
                ":libc_headers_arch",
            ],
            "//conditions:default": [],
        }),
    )

Test: TH
Test: Verify generated //bionic/libc:libc_headers
Fixes: 183597786

Change-Id: I01016cc2cc9a71449f02300d747f01decebf3f6e
2021-04-02 08:17:34 +00:00
Yi Kong fc31228715 Merge "Move toc.sh to use LLVM binutils" am: 948205699b am: 115fc28122 am: 84c6d3c48d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1661823

Change-Id: Ic6df699e0f25b1ce952317b0b8e6520f01cd24bb
2021-04-02 04:50:08 +00:00
Yi Kong 948205699b Merge "Move toc.sh to use LLVM binutils" 2021-04-02 02:38:16 +00:00
Ryan Prichard 9110bde59d Merge "Revert^2 "Switch platform-NDK unwinder to LLVM libunwind.a prebuilt"" am: 252831b03a am: a9cf131c22 am: 81d7a5336d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1661300

Change-Id: I1cd443d4fb6715458477a130803c4f94e5fbeb40
2021-04-02 00:58:03 +00:00
Steven Moreland ba407c8afa Export header check allows WholeStaticLibs
cc/linker.go code assumes that export_static_lib_headers can apply
regardless of whether a library is a regular or 'whole' static lib.
However, this check prevents that code from working.

Bug: 183654927
Test: use export_static_lib_headers like this
Change-Id: I680f90514e41224a7077630167ab4e481909d89c
2021-04-02 00:03:44 +00:00
Ryan Prichard 252831b03a Merge "Revert^2 "Switch platform-NDK unwinder to LLVM libunwind.a prebuilt"" 2021-04-01 22:42:33 +00:00
Yi Kong 4ad44e713b Move toc.sh to use LLVM binutils
Test: build
Change-Id: Ib965b6ea3fba6ae007135ac7e167cc50f0f6e3de
2021-04-01 17:45:42 +08:00
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