Commit Graph

7027 Commits

Author SHA1 Message Date
Evgenii Stepanov
171454d569 Merge "Revert "Disable ubsan diagnostics under HWASan."" am: d30fcb15a9 am: 3eab590303 am: aca699e608 am: 44f92fdda8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1931386

Change-Id: Ib2de9428b0dd177e0b306f3016b0673d07e48062
2021-12-22 23:38:09 +00:00
Evgenii Stepanov
d30fcb15a9 Merge "Revert "Disable ubsan diagnostics under HWASan."" 2021-12-22 22:29:43 +00:00
Liz Kammer
d8a72d7dc9 bp2build: convert host & prebuilt header libraries
Test: bp2build.sh
Change-Id: If8165eac7c17c4eef3686067257aa792121db59d
2021-12-22 16:34:27 -05:00
Liz Kammer
5430953c82 bp2build: Remove duplicate system shared libs
If a system shared lib is specified in shared_libs, this results in
duplicate values appearing, causing a failure in Bazel. This change
removes any system shared libraries that appear in shared libraries from
bionic OS axes where system_shared_libraries takes the default value.

Test: go soong tests
Test: temporarily allowlist directory with this issue, no longer hits
      duplicate library failure.
Change-Id: I9dce570b73c24973f695b815bce8d50f7259798d
2021-12-22 15:53:13 -05:00
Christopher Parsons
f797682282 Merge "Handle the 'enabled' property in bp2build" am: 948e851b83 am: fdb30910fc am: e40c2f5076 am: 5f81eb4dd6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1917398

Change-Id: Id21d61970bc1a6bf78d19dd7ddee4634b255589d
2021-12-22 16:59:24 +00:00
Christopher Parsons
948e851b83 Merge "Handle the 'enabled' property in bp2build" 2021-12-22 15:50:10 +00:00
Evgenii Stepanov
4f41536076 Revert "Disable ubsan diagnostics under HWASan."
The original problem has been fixed in LLVM:
https://reviews.llvm.org/rG78f7e6d8d7956cb96d0fa0fd606192ca0218eee1

Bug: 191808836
Bug: 209991446
Test: m net_test_btm_iso with SANITIZE_TARGET=hwaddress

This reverts commit b15a564869.

Change-Id: Ie99a9a204e0a3f7c3ddf3efd74ac7f19db90215a
2021-12-21 16:31:31 -08:00
Treehugger Robot
531e610d18 Merge "Add -std user flags to cc test to ensure order" am: fac51eb8fd am: 215682ac05 am: 376070fbc3 am: 9bbd5746b2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1925818

Change-Id: I792f7af6a876938f8fe998186908c2012d93a144
2021-12-21 23:14:11 +00:00
Treehugger Robot
fac51eb8fd Merge "Add -std user flags to cc test to ensure order" 2021-12-21 21:57:42 +00:00
Chris Parsons
58852a05f3 Handle the 'enabled' property in bp2build
Also fix some bugs pertaining to configurable attribute handling of bool
attributes and label sttributes, so that they may support values across
multiple different axes at the same time.

Test: unit tests for bp2build
Test: mixed_droid

Change-Id: I411efcfddf02d55dbc0775962068a11348a8bb2c
2021-12-21 16:37:32 -05:00
Liz Kammer
0436c6a2e9 bp2build remove "-std" from cflags am: cac7f690eb am: 547bdc5207 am: 7b901cb0fb am: 091e30666e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1927501

Change-Id: I169b195e9b38333a9184d9df0510510830032277
2021-12-21 19:40:29 +00:00
Liz Kammer
cac7f690eb bp2build remove "-std" from cflags
Soong overrides "-std" flags when provided via cppflags or conlyflags;
however, any user-provided "-std=" cflag will be overridden by Soong's
std flag handling.

For Bazel, we _always_ allow user to override via user provided flags.
To prevent conflicts, we remove the silently ignored values from
Android.bp files in the bp2build conversion.

Test: build/bazel/ci/bp2build.sh
Test: build/bazel/ci/mixed_droid.sh
Change-Id: I4c33b2ae593a7ff3ff8e3ad15ef3461354fc0c83
2021-12-21 11:49:01 -05:00
Yi Kong
eb8efc902d Introduce afdo
A new configuration rule for sampling PGO. This differs from the
original pgo.go rule in the following ways:
 * Automatic propagation to static dependencies
 * Simpler configuration (just put `afdo: true` to optimsation targets)

http://go/android-afdo

Test: build
Bug: 79161490
Change-Id: Ie194824cd523bca19e10ced41d2078fc598f13b3
2021-12-21 16:09:23 +08:00
Treehugger Robot
dbd3553d83 Merge "Remove InstallBypassMake and ToMakePath" am: f1228f570a am: a9f335cf5a am: fd865c6688 am: 8ef2179a6e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1889722

Change-Id: If49c894804c5ca0dfd197ca848ff1c9ac79556f4
2021-12-17 07:36:53 +00:00
Treehugger Robot
f1228f570a Merge "Remove InstallBypassMake and ToMakePath" 2021-12-17 06:15:16 +00:00
Yi Kong
126fc68a92 Merge "Turn on -Wstring-concatenation" am: 53fc7705ec am: 28a933cf8c am: 0b7fccbb5f am: 64c00f2209
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1922284

Change-Id: I5e7038f84ac6da2144ce097095066557514b5145
2021-12-17 05:36:55 +00:00
Yi Kong
53fc7705ec Merge "Turn on -Wstring-concatenation" 2021-12-17 04:05:37 +00:00
Treehugger Robot
b511584da9 Merge "Make all defaults modules bazelable" am: 3eed7f9a8b am: 3434f3734f am: 1cff15e0b1 am: cec672ffa9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1924162

Change-Id: I679379193a8e969fe90045de82aa8fd2593f0b83
2021-12-16 21:02:35 +00:00
Treehugger Robot
572334fe5b Merge "Add noOverrideExternalGlobalCflags support to Soong" am: cde46d7d98 am: 1f337626d2 am: 4e4352352c am: 3e28e343cd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1924200

Change-Id: I2dde5ba90dcf67897b87f5d68c7bd4780570fd8a
2021-12-16 21:01:56 +00:00
Liz Kammer
9dc6577d55 Add -std user flags to cc test to ensure order
Test: go test soong tests
Change-Id: Iff2b82f59e138089d1c1726d9b51e040b00340ba
2021-12-16 11:38:50 -05:00
Treehugger Robot
3eed7f9a8b Merge "Make all defaults modules bazelable" 2021-12-16 01:36:47 +00:00
Treehugger Robot
cde46d7d98 Merge "Add noOverrideExternalGlobalCflags support to Soong" 2021-12-16 00:26:57 +00:00
Colin Cross
c68db4b305 Remove InstallBypassMake and ToMakePath
InstallBypassMake and ToMakePath are obsolete, remove them.

Bug: 204136549
Test: m checkbuild
Change-Id: Ie5a6f7254b3d317ed6039e114ed6aec35e1ce273
2021-12-15 15:22:53 -08:00
Liz Kammer
450acfdd42 Merge "bp2build: Expand check if filegroup contains proto" am: b849d4a6d5 am: ccdd5a8de4 am: 774e8930d5 am: 6fb30b62e0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1916846

Change-Id: I4e063cbb5e993d661bdcf40e464aa36a9d47fc44
2021-12-15 21:42:43 +00:00
Liz Kammer
416201d081 Make all defaults modules bazelable
Since these are not being converted directly, this has two primary
impacts:
* defaults modules will no longer appear as unconverted deps.
* defaults modules do not have to be marked individually, which should
  allow all defaults-based soong-config-modules to just convert as
  necessary.

Test: bp2build.sh
Change-Id: I44c99d5a51d1887a95c17dfdf956f91af671b2ea
2021-12-15 13:18:42 -05:00
Liz Kammer
aabfb5dc47 bp2build: Expand check if filegroup contains proto
Previously we looked for proto as suffix, however, some filegroups use
"<foo>-proto-srcs" or "<bar>-proto-sources", instead we look for proto
as a distinct word in a filegroup name.

Test: go test soong tests
Change-Id: Icf916a84304a02617efff9768e5b82d5ffe658bd
2021-12-15 13:07:58 -05:00
Liz Kammer
487610a623 Merge "bp2build: do not convert prebuilt cc binaries" am: b29852a3da am: cf754196a8 am: fe0a45aa7b am: 59a2ef5a68
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1922861

Change-Id: I8da0d3964cd80e301529fc5e0631b65e9b2e20f0
2021-12-15 16:11:51 +00:00
Liz Kammer
b29852a3da Merge "bp2build: do not convert prebuilt cc binaries" 2021-12-15 15:07:58 +00:00
Stephen Hines
e24303f71a Add noOverrideExternalGlobalCflags support to Soong
noOverrideExternalGlobalCflags is a new set of flags intended to be
added at the end of the command line for 3rd party projects like
external/, hardware/, vendor/, and more. Our previous flags for external
projects occur way too early on the command line, leading to issues with
use for suppressing diagnostics. Note that support for this variable in
build/make is currently unimplemented, as there are no projects that
would depend on it. It could be added in the future, if it turns out to
be useful.

This change initially applies `-Wno-unused-but-set-variable` and
`-Wno-unused-but-set-parameter` to external projects because these
upstream projects aren't easily fixed, and the risk of actual bugs is
low.

Bug: http://b/197240255
Test: Build and check warnings
Change-Id: I26f56c5c52725dddb70dd8130ad61270eac7a9aa
2021-12-15 03:14:26 -08:00
Yi Kong
9feb029fe1 Turn on -Wstring-concatenation
Test: presubmit
Bug: 175068488
Change-Id: If1d37f744412ac2064d8cece251b39066f0e86c0
2021-12-15 17:30:31 +08:00
Wei Li
718d2a16ca Merge "Add the initial implementation of bp2build converter for java_library, java_library_host, java_binary_host and cc_library_host_shared so signapk tool can be built with Bazel." am: 2115d35101 am: 9adc5f84bb am: 38387e7624 am: b980aa5f6e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1918122

Change-Id: If5a5f060862e1d6bc8ff2419c06d1d8a2e31d4ef
2021-12-15 04:47:38 +00:00
Wei Li
bafb6d6612 Add the initial implementation of bp2build converter for java_library,
java_library_host, java_binary_host and cc_library_host_shared so
signapk tool can be built with Bazel.

Test: b build //build/bazel/examples/apex/minimal:build.bazel.examples.apex.minimal
Test: jarsigner -verify -verbose build.bazel.examples.apex.minimal.apex
Bug: 209876137
Bug: 196204358
Bug: 210158864
Bug: 210159074
Bug: 210158872
Change-Id: I855884159d25e69d8f9623792c376da820a1eb4c
2021-12-14 17:23:19 -08:00
Liz Kammer
6299b235bb Merge "Use one mutator for all bp2build conversion." am: 92344259c5 am: 782f37eaee am: 5f4df317ee am: 037105c0f8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1878397

Change-Id: I56073dc653947ebf69d7a74e97c1092f06aab139
2021-12-14 20:25:04 +00:00
Liz Kammer
bdc922f3fe bp2build: do not convert prebuilt cc binaries
These do not have a conversion process yet, do not convert them. Add
more protection against using the wrong conversion for prebuilts in cc.

Test: allowlist project with prebuilt objs/binaries and verify BUILD
      files
Change-Id: Ib26689fa19d6fbb1f5c73ded3b5836165977e987
2021-12-14 14:27:57 -05:00
Liz Kammer
be46fccc40 Use one mutator for all bp2build conversion.
Each conversion required defining a separate mutator, which will each
operate on _all_ modules and requires each to repeat checks whether the
mutator should operator. Instead, we introduce a single mutator and
modules can define a ConvertWithBp2build to implement bp2build
conversion for that module.

Test: bp2build.sh
Bug: 183079158
Change-Id: I99d4b51f441c2903879092c5b56313d606d4338d
2021-12-14 09:37:45 -05:00
Rupert Shuttleworth
5bff277b21 Merge "Handle includes for generated headers" am: 6f32f95b25 am: d469eefcc3 am: f56d2d4bfe am: c8f4b2ad17
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1918455

Change-Id: Ia5538bb1609134261c64f6e4357fccd89514969a
2021-12-14 01:22:29 +00:00
Pirama Arumuga Nainar
71d697c5cb Enable memory-mapped coverage instrumentation
Bug: http://b/194128476
Bug: http://b/210012154

- pass -runtime-counter-relocation flag, which is needed to enable
memory-mapped coverage on Linux/Android.

- Include '%c' specifier in -fprofile-instr-generate compiler flag to
default to memory-mapped coverage.

- Disable continuous coverage if instrumentation is on for bionic/libc
(http://b/210012154).

Test: Run few coverage tests on Forrest.
Change-Id: Ie3a912f66470fcd3ffc2ffd73371a4e1d2b15df3
2021-12-13 14:44:32 -08:00
Liz Kammer
1263d9bdb1 Handle includes for generated headers
For generated headers, Soong introduces the package to the includes (and
re-exports as necessary).

Test: bp2build.sh
Change-Id: Iea9cda859ddaa3e5393f0f4533c15fc60222c408
2021-12-13 12:06:39 -05:00
Rupert Shuttleworth
d358c26a10 Add initial support for use_version_lib. am: 484aa25875 am: afbbd4316d am: 2b6dca1b8c am: efd0e0c7ee
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1918278

Change-Id: Ief055b99fae6a3abc01ac82c43c9090718c6ca8b
2021-12-13 14:47:39 +00:00
Rupert Shuttleworth
484aa25875 Add initial support for use_version_lib.
Test: Resolves build error for BP2BUILD_VERBOSE=1 b build //packages/modules/adb:libadbd_core
Test: Added unit test

Bug: 208481704

Change-Id: I4022c686c7baf050de3f97295fe4654515622a66
2021-12-13 06:21:16 -05:00
Treehugger Robot
bba83741d4 Merge changes from topic "revert-1918946-revert-1899703-AMWIVCREEV-CCTEXIRRRV" am: f4c2bf6559 am: 45b20269f6 am: 4eb4bc649d am: 1fcba64203
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1918949

Change-Id: Ib6e320631a5b35974560bf33aaca205006bc051e
2021-12-11 04:52:01 +00:00
Treehugger Robot
f4c2bf6559 Merge changes from topic "revert-1918946-revert-1899703-AMWIVCREEV-CCTEXIRRRV"
* changes:
  Revert^2 "Add dependency license annotations"
  Revert^2 "Build license metadata files in Soong"
2021-12-11 03:32:18 +00:00
Colin Cross
9ac1faf0af Revert "Add dependency license annotations" am: abe2a4b7bf am: a7fcadce74 am: 265eec85a8 am: 8110688fe1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1918943

Change-Id: I8b1908cccf980e93769c5e72490a95846f45a851
2021-12-11 00:28:39 +00:00
Colin Cross
a7fcadce74 Revert "Add dependency license annotations" am: abe2a4b7bf
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1918943

Change-Id: I9438dc5f70a9e30071a051c11dd25f36789822d0
2021-12-10 23:20:49 +00:00
Colin Cross
65cb314c92 Revert^2 "Add dependency license annotations"
abe2a4b7bf

Change-Id: Ibcd16b5b779a4e6d4372dab9d21de76abae9ca9c
2021-12-10 23:05:02 +00:00
Colin Cross
67938c2925 Merge changes from topic "revert-1899703-AMWIVCREEV"
* changes:
  Revert "Build license metadata files in Soong"
  Revert "Add dependency license annotations"
2021-12-10 23:04:45 +00:00
Colin Cross
abe2a4b7bf Revert "Add dependency license annotations"
Revert submission 1899703

Reason for revert: b/210158272
Reverted Changes:
I142c19284:Reuse license metadata files from Soong
Ife89b8f23:Add dependency license annotations
I8e7410837:Build license metadata files in Soong

Change-Id: I51f33ae67311a3cff00d3e581d24c9a3411b7131
2021-12-10 23:02:41 +00:00
Colin Cross
d1ea62d5c9 Merge changes from topic "soong-license-metadata" am: b435744fdc am: 9a6e17e5c1 am: 1aa0005a1f am: 7d162acb13
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1899703

Change-Id: Ie97f43055aa820cb5b1bd4faffe67f2c292a2ecb
2021-12-10 23:02:01 +00:00
Colin Cross
b435744fdc Merge changes from topic "soong-license-metadata"
* changes:
  Add dependency license annotations
  Build license metadata files in Soong
  Escape Host*Variable contents
2021-12-10 21:43:49 +00:00
Treehugger Robot
0621e6d216 Merge "Remove test_min_api_level property" am: ea8b7771f1 am: 39e3984e0d am: 3a32bdcf25 am: fd62f28d36
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1905090

Change-Id: I8b036f244cc2822c8431fad05274d72484a94765
2021-12-09 07:10:33 +00:00