Commit graph

8185 commits

Author SHA1 Message Date
Treehugger Robot
7376815e21 Merge "Handle no generated headers and exporting for xsd" 2023-06-26 21:20:46 +00:00
Mitch Phillips
03d510404c Merge "[MTE] Add memtag_globals as a sanitizer target." 2023-06-26 05:50:11 +00:00
Alix Espino
8131290360 Merge "bp2build conversion for rscript srcs in cc modules" 2023-06-23 20:29:09 +00:00
Liz Kammer
084d6a908f Handle no generated headers and exporting for xsd
Test: new bp2build unit tests
Test: build libvintf
Change-Id: I2c7bf409b30d78fcf6762d69139e3249a2b0d368
2023-06-23 15:48:16 -04:00
Treehugger Robot
cc1a519b86 Merge "Disable mixed builds for unsupported variants" 2023-06-23 18:25:01 +00:00
Liz Kammer
1cec9d1c51 Disable mixed builds for unsupported variants
Test: CI
Change-Id: Icdaef8b2955a88dc94348c85c5aa6bb9b3c91148
2023-06-23 08:53:13 -04:00
Colin Cross
313d32f730 Merge "Use generics for DepSets" 2023-06-22 20:57:01 +00:00
Florian Mayer
c3adf443e7 Merge "Reland "Re-enable stack frame size errors"" 2023-06-22 20:55:48 +00:00
Mitch Phillips
92d19fa306 [MTE] Add memtag_globals as a sanitizer target.
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
2023-06-22 17:04:40 +00:00
Colin Cross
c85750bfe3 Use generics for DepSets
Use Go's generics for DepSets so they don't require a type-specific
wrapper and reflection.

Test: depsets_test.go
Change-Id: I22ba0b7d680d37d2cd05230b0f560d166c4dd20b
2023-06-22 08:18:33 -07:00
Treehugger Robot
f44ac9efc1 Merge changes I6ddb47d7,I3df3d304
* changes:
  [hwasan] Increase BB to explore for reachability
  [hwasan] Also pass use-after-scope flag in LTO
2023-06-21 21:14:52 +00:00
Alix
e266787aed bp2build conversion for rscript srcs in cc modules
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
2023-06-21 14:58:10 +00:00
Trevor Radcliffe
8bd06008dc Merge "Explicitly disable CFI in bp2build when false" 2023-06-20 19:52:17 +00:00
Elliott Hughes
1b2a65783d Merge "Bump the platform default up to C17." 2023-06-20 16:56:51 +00:00
Florian Mayer
c746619feb [hwasan] Increase BB to explore for reachability
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
2023-06-16 17:34:59 -07:00
Florian Mayer
a998446d3e [hwasan] Also pass use-after-scope flag in LTO
Change-Id: I3df3d3047fd5aaa93e6c4b68885d39e20b12ccdb
2023-06-16 17:34:57 -07:00
Florian Mayer
2bddccd837 Reland "Re-enable stack frame size errors"
This reverts commit 25cd981362.

Reason for revert: b/274474681 is fixed.

Bug: 229654778
Change-Id: I4b975ced02ffe0d5a432a3033f05bb61868bec45
2023-06-16 22:34:41 +00:00
Trevor Radcliffe
523c5c6597 Explicitly disable CFI in bp2build when false
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
2023-06-16 20:15:45 +00:00
Christopher Parsons
df9c3441aa Merge "Provide reason for unconverted bp2build modules" 2023-06-16 13:49:49 +00:00
Chris Parsons
39a169721c Provide reason for unconverted bp2build modules
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
2023-06-16 13:45:17 +00:00
Cole Faust
6cac8cbb26 Add implementation whole archive deps to binaries
...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
2023-06-15 15:01:30 -07:00
Elliott Hughes
7225dd87f3 Merge "riscv64: enable Zbs." 2023-06-15 14:28:46 +00:00
Treehugger Robot
e3056e0d78 Merge "Revert "Use installExecutable for cc binaries"" 2023-06-15 01:39:25 +00:00
Trevor Radcliffe
cbaa0d6eb9 Merge "Bp2build Sanitizer Blocklist" 2023-06-14 18:05:30 +00:00
Elliott Hughes
fb294e39bf Bump the platform default up to C17.
This is already the "default default" for gcc and clang.

Bug: http://b/232413369
Test: treehugger
Change-Id: I3c0df7c63e8fca1b7692ad867d349a645559c209
2023-06-14 10:42:45 -07:00
Elliott Hughes
121483bbbc riscv64: enable Zbs.
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
2023-06-14 08:33:38 -07:00
Elliott Hughes
03520eb2f9 Merge "riscv64: enable Zba." 2023-06-14 14:24:33 +00:00
Yi Kong
c938bec49b Merge "Add GLOBAL_THINLTO env fixture to lto_test" 2023-06-14 11:21:41 +00:00
胡泊
6fe07a5017 Revert "Use installExecutable for cc binaries"
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
2023-06-14 07:38:44 +00:00
Yi Kong
f1d0ba411d Add GLOBAL_THINLTO env fixture to lto_test
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
2023-06-14 14:28:30 +08:00
Trevor Radcliffe
ded095ce45 Bp2build Sanitizer Blocklist
Bug: 286894426
Test: Unit tests
Change-Id: I382e028410a185a5017dba1fc47c83ad5b2432cf
2023-06-13 20:46:27 +00:00
Ivan Lozano
c72d4a78bf Merge "rust: Bundle Rust shared dependencies in fuzzers" 2023-06-13 17:39:48 +00:00
Elliott Hughes
1d1d90b552 riscv64: enable Zba.
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
2023-06-13 07:27:12 -07:00
Ivan Lozano
61c02cc537 rust: Bundle Rust shared dependencies in fuzzers
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
2023-06-09 14:17:49 -04:00
Yi Kong
f1d37b3511 Merge "Refactor LTO" 2023-06-09 03:16:22 +00:00
Yi Kong
895d241013 Refactor LTO
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
2023-06-09 03:15:49 +00:00
Treehugger Robot
f253d23e95 Merge changes from topic "cc_stem"
* changes:
  Remove modules from denylist
  Update runpath for jni libs
  bp2build support for stem
2023-06-08 22:38:34 +00:00
Aditya Kumar
9d1a17d18a Merge "[RISC-V] rv64gc_zbb for Android" 2023-06-08 17:12:26 +00:00
Yu Liu
8860c6c114 Only allowlist cfi enabled modules for apex variant.
Bug: 286224058
Test: lunch aosp_bramble-userdebug && m --skip-soong-tests nothing --bazel-mode-staging
Change-Id: Ida3287ee718dc868a46b625f82c352029734a724
2023-06-07 13:22:54 -07:00
Aditya Kumar
55ceae9e61 [RISC-V] rv64gc_zbb for Android
This reverts commit cc75089229.

Reason for revert: Retry

Change-Id: I957ef442a4988046eeb9771b7ce1acaf4cb6ef8d
2023-06-07 11:19:24 -07:00
Yu Liu
d31098e6c2 Merge "Allow cfi enabled modules in mixed build." 2023-06-06 17:41:18 +00:00
Yi Kong
eb7f45ca9c Merge "afdo: Remove -fprofile-sample-accurate flag" 2023-06-06 17:18:31 +00:00
Treehugger Robot
2976fa1185 Merge "Use a less hacky way to detect if a module is Fuzzer enabled" 2023-06-06 17:13:20 +00:00
Yi Kong
febf8b9bdf afdo: Remove -fprofile-sample-accurate flag
-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
2023-06-06 08:27:47 +00:00
Yu Liu
95497dc89b Allow cfi enabled modules in mixed build.
Bug: None
Test: Locally tested
Change-Id: I53c4ad8428cf05ceee3d73b4f97c2b9db2285c38
2023-06-05 17:10:14 -07:00
Spandan Das
39ccf93c65 bp2build support for stem
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
2023-06-06 00:07:37 +00:00
Yu Liu
e0a7318331 Merge "Add CFI flags to Compile Action" 2023-06-05 22:47:52 +00:00
Yu Liu
89575db9c6 Merge "CFI Bp2Build" 2023-06-05 22:47:52 +00:00
Spandan Das
91a8820688 Merge changes from topics "xsd_config_bp2build_cc_rdeps", "xsd_config_bp2build_java_rdeps"
* changes:
  bp2build for cc libraries that use xsd_config as gen srcs
  bp2build for java libraries using xsd_config srcs
2023-06-05 22:23:37 +00:00
Trevor Radcliffe
f1836e4728 Add CFI flags to Compile Action
Bug: 261733820
Test: Unit Tests
Change-Id: I7c7cb8ab07da2c66df5d69e1e4af3337e3b24e6d
2023-06-05 18:09:21 +00:00