Commit Graph

4671 Commits

Author SHA1 Message Date
Matthias Maennich
2b718ea738 Merge "soong: add support for module specific lexer flags" am: bea94d3525 am: f4d8891660 am: 75826da3db am: 71acf40e05 am: 9e6941979f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1363562

Change-Id: Ia2579d5dce996d8c350fedc8d66c67a51ef4860c
2020-08-28 21:21:50 +00:00
Matthias Maennich
75826da3db Merge "soong: add support for module specific lexer flags" am: bea94d3525 am: f4d8891660
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1363562

Change-Id: I0480bbdd966aeb0233bfca66c20dbd7eb0c1608d
2020-08-28 20:03:19 +00:00
Matthias Maennich
bea94d3525 Merge "soong: add support for module specific lexer flags" 2020-08-28 19:24:01 +00:00
Thiébaud Weksteen
01113aa699 Merge "cc: export Stripper struct" am: 03156929db am: 44c0a17793 am: 8bd1e224b0 am: 3704e0c13a am: 7eab857e72
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1404788

Change-Id: I8261f736399edb4aa2c15466b723e6ed473a9200
2020-08-28 10:36:08 +00:00
Bowgo Tsai
02c81e214f Merge "Revert "[pgo] Return updated Flags after adding flags for PGO/AFDO"" am: 38414db4de am: aeca1f6aa0 am: dffdcb2d6a am: 9b84bc3a5a am: f27c2875ef
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1413430

Change-Id: I2666a33bf1d2c8ff60226a4d1a9335f7e3e84c27
2020-08-28 10:36:02 +00:00
Thiébaud Weksteen
8bd1e224b0 Merge "cc: export Stripper struct" am: 03156929db am: 44c0a17793
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1404788

Change-Id: I0998951ffcde60254f69f99cf55cd564472990e9
2020-08-28 09:03:46 +00:00
Bowgo Tsai
dffdcb2d6a Merge "Revert "[pgo] Return updated Flags after adding flags for PGO/AFDO"" am: 38414db4de am: aeca1f6aa0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1413430

Change-Id: I7b3b4dee24f62f30578ff970fcdd193e87aa1c21
2020-08-28 09:03:40 +00:00
Bowgo Tsai
988ff8d149 Revert "[pgo] Return updated Flags after adding flags for PGO/AFDO"
This reverts commit 5010a97388.

Reason for revert:  b/166728338 - build failures on master branch

Bug: 162702246
Bug: 166728338
Change-Id: Ie9e51e7c5533d220ad3e160439cb38ff88f068ac
Test: TreeHugger
2020-08-28 08:08:36 +00:00
Treehugger Robot
6b3dec735e Merge "[pgo] Return updated Flags after adding flags for PGO/AFDO" am: 1fde95ac3f am: b2403bc2f7 am: 1e88888c83 am: 9f145eb500 am: b43fd1117e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1414408

Change-Id: Id7e72187742fe061cd85980a58cf9bd1b147ac3e
2020-08-28 06:13:28 +00:00
Treehugger Robot
1e88888c83 Merge "[pgo] Return updated Flags after adding flags for PGO/AFDO" am: 1fde95ac3f am: b2403bc2f7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1414408

Change-Id: I5b7dde3a337c174f6b48181ed4f5309e41ad280c
2020-08-28 04:59:33 +00:00
Pirama Arumuga Nainar
5010a97388 [pgo] Return updated Flags after adding flags for PGO/AFDO
Bug: http://b/162702246

Test: m ANDROID_PGO_INSTRUMENT=hwui hwuimacro and check hwuimacro has
      PGO instrumentation.
Change-Id: I8044702e0aed4fa7bb9ac71608a83a95f319abd9
2020-08-27 16:28:45 -07:00
Treehugger Robot
5a60431ee7 Merge "apex: pass "apex name" as literal to apex variants" am: d1ac3a79e0 am: 613222477c am: e0b4c0f851 am: 13b30a1493 am: b099c2dbd1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1403227

Change-Id: I192ea1008332146d4b24a89b6938c8a82505efbb
2020-08-27 08:24:33 +00:00
Treehugger Robot
04598253d3 Merge "bootstrap is added for cc_binary only when the module is in an APEX" am: 23a6a41c66 am: bf49e6e7fc am: 7ac243e9ea am: 6480dbaf33 am: e5e0dc14f4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1409927

Change-Id: I10649e9fda5536bd92de3c3de0fcd26363e284ed
2020-08-27 08:24:20 +00:00
Thiébaud Weksteen
d458745f15 cc: export Stripper struct
The cc stripping logic can be reused for Rust. Export the Stripper
structure for that purpose. Extract the strip-related flags from
builderFlags into StripFlags. Add the method flagsToStripFlags
(similarly to flagsToBuilderFlags).

Add the helper method disableStripping on libraryDecorator.

Test: m
Bug: 153430439
Change-Id: I11aef1abb8d498a4c1672500a7398279edf7f548
2020-08-27 10:13:42 +02:00
Treehugger Robot
e0b4c0f851 Merge "apex: pass "apex name" as literal to apex variants" am: d1ac3a79e0 am: 613222477c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1403227

Change-Id: Id91c20feae2f5718714db09c24b1b64018811ce3
2020-08-27 00:18:14 +00:00
Treehugger Robot
7ac243e9ea Merge "bootstrap is added for cc_binary only when the module is in an APEX" am: 23a6a41c66 am: bf49e6e7fc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1409927

Change-Id: I3768014726edd74f24d98b28c3bfc8c85b19bff8
2020-08-27 00:10:50 +00:00
Treehugger Robot
d1ac3a79e0 Merge "apex: pass "apex name" as literal to apex variants" 2020-08-27 00:01:15 +00:00
Treehugger Robot
23a6a41c66 Merge "bootstrap is added for cc_binary only when the module is in an APEX" 2020-08-26 23:28:54 +00:00
Matthias Maennich
22fd4d1b82 soong: add support for module specific lexer flags
To support module specific lexer flags, this follows the same strategy
as the yacc flags:
 - add LexProperties to the BaseCompilerProperties
 - propagate those flags to the generator generation (i.e. genLex)
 - add a placeholder for custom flags
 - replace the placeholder with the concatenated flags

This might not support escaping very well, but I figured that this is a
very edge case. Support for escaping etc. could be added later on.

Bug: 159682555
Signed-off-by: Matthias Maennich <maennich@google.com>
Change-Id: I31a3b783bb05213fe1621191031952b41b318103
2020-08-26 21:41:33 +01:00
Jiyong Park
89f7bf1635 bootstrap is added for cc_binary only when the module is in an APEX
Like shared libraries, the bootstrap subdirectory is appended to the
install path only when the module is in an APEX. Currently, this change
doesn't make any difference because only the Bionic binary (linker) is
satisfying the existing condition InstallToBootstrap() and it already
satisfies DirectlyInAnyApex.

However, this change makes a diference when we build the binary for the
host targets. Then without this change, it is installed to
out/soong/host/<OS>-<arch>/bin/bootstrap. This doesn't make sense
because we don't use APEXes for the host targets. With this change,
the binary is correctly installed to out/soong/host/<OS>-<arch>/bin
because DirectlyInAnyApex returns false for hosts.

Bug: 159685774
Test: m
Change-Id: I0d63bd8c11e3a96ee6a27b2295bc14d6dc15ff9e
2020-08-25 18:57:39 +09:00
Treehugger Robot
49f641e5e9 Merge "Support ninja rsp files in soong_zip" am: 4c2e4f381a am: 1e4fbc23bf am: 15bbb3b646 am: 905f3fe3f8 am: eecb1b577d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1405368

Change-Id: I3281a64f94f9310be02c02ad2f8981b9fa3cdf42
2020-08-24 23:12:16 +00:00
Treehugger Robot
6eeb9fc5e5 Merge "Propagate sanitize.never flag in SDK snapshots." am: e819bec240 am: a5c0b11970 am: b3b358cafe am: 8b3374a919 am: 33c9ae67e4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1406917

Change-Id: I802e207744614220f36520fcd13464bea314c29b
2020-08-24 21:16:46 +00:00
Treehugger Robot
15bbb3b646 Merge "Support ninja rsp files in soong_zip" am: 4c2e4f381a am: 1e4fbc23bf
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1405368

Change-Id: Iaea9c5749421e82a8a9f2c713c2d53c8abf44663
2020-08-24 20:03:37 +00:00
Treehugger Robot
4c2e4f381a Merge "Support ninja rsp files in soong_zip" 2020-08-24 18:40:56 +00:00
Treehugger Robot
b3b358cafe Merge "Propagate sanitize.never flag in SDK snapshots." am: e819bec240 am: a5c0b11970
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1406917

Change-Id: Ief4f39ffa3c549ba980c0b2006f7ea1411c254f4
2020-08-24 18:27:57 +00:00
Jooyung Han
c2a1d70eaf apex: pass "apex name" as literal to apex variants
When a cc module sets UseApexNameMacro(mutated property), it is built
with __ANDROID_APEX_NAME__ for its apex variants.

For now the new prop is used by aidl_interface-generated modules only.

Note that we already have __ANDROID_APEX_<NAME>__ macro. The new macro
can be used when we need to pass the name as data while the old one is
useful when we want conditional compilation.

Bug: 165017590
Test: m com.android.aidltest
     check build.ninja if -D__ANDROID_APEX_NAME__ is defined for apex
     varaints
Change-Id: Ia81ba8f833d23254e58c9777daf184d7861f07a7
2020-08-24 10:08:27 +09:00
Treehugger Robot
1baa7b7421 Merge "Add extra_test_configs option" am: ec7a91f9fa am: 82448f2d2d am: 180a485b50 am: 437bb3b11d am: 57fa8ee91c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1402168

Change-Id: Ib63b87c02158c5454806a3f14c1aaf9ae890e387
2020-08-21 18:43:33 +00:00
Martin Stjernholm
fbb486fc7a Propagate sanitize.never flag in SDK snapshots.
This is necessary to not get dependencies on libclang_rt sanitizer libs
for the CRT objects which lead to cyclic dependencies in sanitizer
builds.

Test: `lunch aosp_blueline_hwasan-userdebug && m nothing`
  in a tree that has the prebuilts created and unzipped from
  `build/soong/scripts/build-aml-prebuilts.sh runtime-module-{sdk,host-exports}`
Bug: 151303681
Change-Id: I3f848a084280bdc3ade4b74df03e981d8cc61222
2020-08-21 18:43:51 +01:00
Treehugger Robot
180a485b50 Merge "Add extra_test_configs option" am: ec7a91f9fa am: 82448f2d2d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1402168

Change-Id: If619742e8271e804231d029a87f5fa1297959488
2020-08-21 17:26:05 +00:00
Treehugger Robot
ec7a91f9fa Merge "Add extra_test_configs option" 2020-08-21 16:22:43 +00:00
Treehugger Robot
952140ab59 Merge "Reland: Deduplicate APEX variants that would build identically" am: 68bfe074c6 am: a3d1c127a2 am: 4d9984eeb1 am: 76309aab5d am: a106e405e9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1405087

Change-Id: I5ba652222b6c9ed40fd8c643f92485b26842bd9b
2020-08-21 08:43:24 +00:00
Treehugger Robot
4d9984eeb1 Merge "Reland: Deduplicate APEX variants that would build identically" am: 68bfe074c6 am: a3d1c127a2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1405087

Change-Id: I7cf0c8d2c27757395e54fb4cc8592f438aa6ccaa
2020-08-21 07:38:47 +00:00
Treehugger Robot
68bfe074c6 Merge "Reland: Deduplicate APEX variants that would build identically" 2020-08-21 06:46:51 +00:00
Treehugger Robot
63aa5a56a9 Merge "Allow globally disabling some clang-tidy checks." am: 66790d8943 am: b8638926f4 am: 43b8a7ff72 am: 34171e0d43 am: 7dcf1cf64c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1403127

Change-Id: Ibdd3bf8f70140a57ccd918ca3d8f1036939934fd
2020-08-20 22:35:58 +00:00
Treehugger Robot
43b8a7ff72 Merge "Allow globally disabling some clang-tidy checks." am: 66790d8943 am: b8638926f4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1403127

Change-Id: Ib129a158cad3564622f5170bf7e061cf74e8046d
2020-08-20 20:26:15 +00:00
Treehugger Robot
66790d8943 Merge "Allow globally disabling some clang-tidy checks." 2020-08-20 19:51:31 +00:00
Dan Shi
95d19422a6 Add extra_test_configs option
Bug: 163344047
Test: m -j HelloWorldHostTest hello_world_test HelloWorldTests
Change-Id: I237e3aa3f40df1f6387ba8ff6a16e56535cdeae9
2020-08-19 15:27:03 -07:00
Benjamin Schwartz
5ec7024911 Create Power Stats AIDL interface
Bug: 162472196
Test: m
Change-Id: I44ffdf07c181cb4a119ec5de73bcb9ffaf485504
2020-08-19 15:25:57 -07:00
Colin Cross
053fca10c9 Support ninja rsp files in soong_zip
Add a -r argument to soong_zip that reads a list of files from a file
like the -l argument but treats it as a Ninja rsp file with escaping.
Replace the -l arguments in Soong that are using rsp files with -r.

Fixes: 162435077
Test: TestReadRespFile, TestZip
Change-Id: I4605312e99406ab1bd0c37af9c5ad212393f0403
2020-08-19 21:18:56 +00:00
Colin Cross
aede88c1c7 Reland: Deduplicate APEX variants that would build identically
APEX variants that share the same SDK version and updatability
almost always use identical command line arguments to build but
with different intermediates directories.  This causes unnecessary
build time and disk space for duplicated work.

Deduplicate APEX variants that would build identically.  Create
aliases from the per-APEX variations to the new shared variations
so that the APEX modules can continue to depend on them via the
APEX name as the variation.

This has one significant change in behavior.  Before this change,
if an APEX had two libraries in its direct dependencies and one
of those libraries depended on the other, and the second library
had stubs, then the first library would depend on the implementation
of the second library and not the stubs.  After this change, if
the first library is also present in a second APEX but the second
library is not, then the common variant shared between the two
APEXes would use the stubs, not the implementation.

In a correctly configured set of build rules this change will
be irrelevant, because if the compilation worked for the second
APEX using stubs then it will work for the common variant using
stubs.  However, if an incorrect change to the build rules is
made this could lead to confusing errors, as a previously-working
common variant could suddenly stop building when a module is added
to a new APEX without its dependencies that require implementation
APIs to compile.

This change reduces the number of modules in an AOSP arm64-userdebug
build by 3% (52242 to 50586), reduces the number of variants of the
libcutils module from 74 to 53, and reduces the number of variants
of the massive libart[d] modules from 44 to 32.

This relands I0529837476a253c32b3dfb98dcccf107427c742c with a fix
to always mark permissions XML files of java_sdk_library modules as
unique per apex since they contain the APEX filename, and a fix
to UpdateUniqueApexVariationsForDeps to check ApexInfo.InApexes
instead of DepIsInSameApex to check if two modules are in the same
apex to account for a module that depends on another in a way that
doesn't normally include the dependency in the APEX (e.g. a libs
property), but the dependency is directly included in the APEX.

Bug: 164216768
Test: go test ./build/soong/apex/...
Change-Id: I2ae170601f764e5b88d0be2e0e6adc84e3a4d9cc
2020-08-19 10:21:17 -07:00
Dan Albert
d12afec49c Allow globally disabling some clang-tidy checks.
Test: used for the upcoming compiler update
Bug: None
Change-Id: Id17db2c48fa3e165da81a1d084827bde142406dd
2020-08-18 13:28:03 -07:00
Treehugger Robot
671aed59c9 Merge "Revert "Deduplicate APEX variants that would build identically"" am: fc4d79598c am: b1d3c4c4d7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1403647

Change-Id: Ia2db2038480c3e09e7c82c1766f9b922e5cc6a11
2020-08-18 17:42:08 +00:00
Pete Bentley
0c7b26e0e2 Revert "Deduplicate APEX variants that would build identically"
This reverts commit d6b2525b00.

Reason for revert: <Breaks tests - confirmed by Forrest: b/165188843>

Change-Id: I7cb68cb87522415004390c0672dc774e0067b122
2020-08-18 13:44:59 +00:00
Treehugger Robot
1f160e818b Merge "Deduplicate APEX variants that would build identically" am: ca29a25d38 am: aa3235edcc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1399832

Change-Id: I4fe0cc33956d110e6bb1de49183470eb21992fbf
2020-08-18 05:19:52 +00:00
Colin Cross
d6b2525b00 Deduplicate APEX variants that would build identically
APEX variants that share the same SDK version and updatability
almost always use identical command line arguments to build but
with different intermediates directories.  This causes unnecessary
build time and disk space for duplicated work.

Deduplicate APEX variants that would build identically.  Create
aliases from the per-APEX variations to the new shared variations
so that the APEX modules can continue to depend on them via the
APEX name as the variation.

This has one significant change in behavior.  Before this change,
if an APEX had two libraries in its direct dependencies and one
of those libraries depended on the other, and the second library
had stubs, then the first library would depend on the implementation
of the second library and not the stubs.  After this change, if
the first library is also present in a second APEX but the second
library is not, then the common variant shared between the two
APEXes would use the stubs, not the implementation.

In a correctly configured set of build rules this change will
be irrelevant, because if the compilation worked for the second
APEX using stubs then it will work for the common variant using
stubs.  However, if an incorrect change to the build rules is
made this could lead to confusing errors, as a previously-working
common variant could suddenly stop building when a module is added
to a new APEX without its dependencies that require implementation
APIs to compile.

This change reduces the number of modules in an AOSP arm64-userdebug
build by 3% (52242 to 50586), reduces the number of variants of the
libcutils module from 74 to 53, and reduces the number of variants
of the massive libart[d] modules from 44 to 32.

Bug: 164216768
Test: go test ./build/soong/apex/...
Change-Id: I0529837476a253c32b3dfb98dcccf107427c742c
2020-08-17 15:18:31 -07:00
Treehugger Robot
11ff8974eb Merge "Rename ApexName to ApexVariationName" am: a07777d434 am: be9a9035f2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1399831

Change-Id: I31f1d4eedbad29ac1562834ea70eb52e0c543ecd
2020-08-15 07:02:47 +00:00
Treehugger Robot
a07777d434 Merge "Rename ApexName to ApexVariationName" 2020-08-15 06:43:52 +00:00
Colin Cross
e07f2316b7 Rename ApexName to ApexVariationName
In preparation for reusing the same variation for multiple apexes,
rename ApexName to ApexVariationName.

Bug: 164216768
Test: all soong tests
Change-Id: I88f2c5b192ffa27acd38e01952d0cefd413222a0
2020-08-13 17:50:29 -07:00
Colin Cross
e3b91dc7fb Merge changes I02fb745a,Iccc96c0d am: a24b9deb5f am: 094956cf00
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1378536

Change-Id: I8a434610d1869e30a853208d974a16196aa9e884
2020-08-13 22:28:35 +00:00
Colin Cross
a24b9deb5f Merge changes I02fb745a,Iccc96c0d
* changes:
  Follow all shared library dependencies when collecting JNI libraries
  Handle static unwinder in ltoDepsMutator
2020-08-13 21:55:53 +00:00