MTE globals needs four pieces:
1. (done) clang/llvm to produce objfiles with MTE globals metadata
2. (in flight, https://reviews.llvm.org/D152921) lld to process the metadata in the objfiles, and produce information in each DSO describing the global variables that need to be tagged (alongside some other stuff).
3. (this patch) android to handle the new sanitizer
4. (not yet sent) bionic's libc/linker to interpret the information in each DSO, and tag the global variables.
Because #2 will take some time to come through the toolchain rolls, and #3 and #4 can be landed asynchronously, we can land this ahead of time. Should make my life easier by preventing constant rebases.
Bug: N/A
Test: Build {libc, libm, libc++, libm, and libnetd} in internal master
with these patches and an experimental compiler with the lld support.
Also, `SANITIZE_TARGET=memtag_globals m` here with in-tree compiler
without lld support.
Change-Id: Ie7882d474d4d776232de3a3d571a82274df14bf0
Use Go's generics for DepSets so they don't require a type-specific
wrapper and reflection.
Test: depsets_test.go
Change-Id: I22ba0b7d680d37d2cd05230b0f560d166c4dd20b
Bazel does not support using .rscrip/.fs files as cc srcs.
For a module foo with foo srcs, Bp2build will create a bazel
target of rule class rscript_to_cpp with name foo_renderscript
which will have only the renderscript files as srcs.
Bp2build will also create a target foo with the expected cc rule class.
The foo target will have all other src files as srcs and will also
have the target foo_renderscript as another src.
Bug: 210509914
Test: bp2build testing & b build target rstest-latency
Change-Id: Ifdc55051a3595f5fcf54eab8b59e11e9351e141c
We pass mcpu=cortex-a55 for our build, which increases BB to the point
where the LLVM default of 32 is not enough. This caused worse coverage
for use-after-scope detection, and increased stack usage.
Test: build oriole_hwasan
Bug: 229654778
Change-Id: I6ddb47d7224a9c6ddbf2641c043e3430d330c5a9
In Soong, CFI being explicitly set to false overrides presence in
CFI_INCLUDE_PATHS, so this change causes Bazel to mimic the same
precedence.
Bug: 278789968
Test: Unit tests
Change-Id: I827b3d4272eac2002031970f1e67c9321979b14b
This also changes the expectation of ConvertWithBp2build. Each
implementation must either create one or more Bazel target modules, or
mark the module as unconvertible (with a specific reason).
Manually verified no runtime hit in AOSP
In AOSP, the metrics file size increases from 252K to 1.6M
This changes some effective module counts in bp2build metrics:
- Removes "package" modules from the module count list in
metrics, as these will not be converted like regular modules.
- Counts Handcrafted modules as being "unconverted", as bp2build is not
responsible for them.
Bug: 285631638
Test: Verified generated BUILD.bazel files are bit-for-bit identical
with this change
Test: Manually verified one case of each implemented reasonType
Change-Id: I308dd451d8f28379b15671dae9f931bd0446f5c1
...as regular whole archive deps because binaries don't have
implementation whole archive deps.
Also allowlist checkpolicy which requires this change.
Test: bp2build presubmits should now build checkpolicy
Change-Id: I1f98312da249ea1f37004ccba8799449bdbc4718
Cuttlefish still boots to homescreen, all instructions in the extension
are actually seen to be in use, and the bionic tests still pass.
Test: see above
Change-Id: I429729a722cdd7b3bdf257cb7329ee151ec998a0
This reverts commit c1fd399ccd.
Reason for revert: build break for prebuilt host binary in read-only source tree
Change-Id: I9f1792f324acbfbaf53254a972cb0894140efabe
Test: m BUILD_BROKEN_SRC_DIR_IS_WRITABLE=false mkimage-host
Bug: 287168966
lto has different behaviour depending on the GLOBAL_THINLTO env var
value.
Tests for GLOBAL_THINLTO=true will be added in a follow up CL.
Test: presubmit
Bug: 169004486
Change-Id: I45f6a35eb26bdb1beeb3ff5f2c0c0cdc8fd8c41f
Cuttlefish still boots to homescreen, all instructions in the extension
are actually seen to be in use, and the bionic tests still pass.
Test: see above
Change-Id: I6373fa6245115b9b6c845db03ee73b321c07e02a
Rust shared library dependencies are not always bundled in cc_fuzz or
rust_fuzz modules, which can lead to difficult to debug runtime errors
when running these fuzzers. It can also be hard to determine which
dependencies need to be explicitly declared.
This CL makes sure that we bundle the appropriate transitive
dependencies for our fuzzers.
Bug: 249551848
Test: Soong tests
Test: m <fuzzer> # check data/fuzz/<arch>/lib dir contents
Change-Id: I957ca8898079b61e2ff20d750f8c92bf61ac394f
We removed Full LTO support, now LTO is a binary choice. This allows us
to greatly simplify the LTO propagation logic.
Test: m
Test: GLBOAL_THINLTO=true m
Bug: 169004486
Change-Id: Ie4e453d7518c7069a7c755734dab1e776c16e656
-fprofile-sample-accurate allows the compiler to de-optimize cold code
paths according to the profile. However we have a number of micro-
benchmarks that tests these paths and we often trigger regression
reports from those benchmarks.
Turning off the flag mitigates the issue at a cost of ~2MB increase in
system image size. But the more deterministic codegen could reduce the
differential OTA size.
Test: presubmit
Bug: 283235002
Change-Id: I1016f573f21a60223a97c64f5818f0e7e66e41e3
By default, the artifacts generated by cc_binary and cc_library in Soong
track the module name. But Soong supports overidding this using the stem
property. e.g.
```
cc_library {
name: "foo.1.2",
stem: "foo",
}
```
will generate foo.so
This CL adds this property to bp2build
Test: bp2build unit tests
Bug: 240563612
Change-Id: I1dfed870d5bad450511b72c397d2355c01fa3b60