Commit Graph

4662 Commits

Author SHA1 Message Date
Ramy Medhat
79e83919d8 Merge "Pass cpp linking implicit deps to RBE." am: 3618f0a02e am: d678bba6b6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1414829

Change-Id: I1edee6aa2ba229662856c0ff9a9566d86ca5e019
2020-09-01 12:12:45 +00:00
Ramy Medhat
3618f0a02e Merge "Pass cpp linking implicit deps to RBE." 2020-09-01 11:19:28 +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
Ramy Medhat
6797edc70e Pass cpp linking implicit deps to RBE.
Test: build with RBE_CXX=1 RBE_CXX_EXEC_STRATEGY=remote
Change-Id: Ie769b9a99f080b75c1b82e458b5220261e9c1b47
2020-08-28 14:53:44 -04: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
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
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
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
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
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
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
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
Treehugger Robot
45d8c7af88 Merge "Improve abidump generating logic for non-REL build" am: 29737cfc94 am: 0c8d7c6958
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1374297

Change-Id: Ie89168b98e3de295a3c59da3d0e3d6b92bf3d9a4
2020-08-13 12:34:06 +00:00
Treehugger Robot
29737cfc94 Merge "Improve abidump generating logic for non-REL build" 2020-08-13 11:53:05 +00:00
Treehugger Robot
ec8f7940e8 Merge changes I514b90ae,Ie477de70 am: d59540234c am: 8acd131453
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1378334

Change-Id: Ic192d891e33f1efc806a031bd2e8e65920758bb1
2020-08-13 05:29:05 +00:00
Treehugger Robot
d59540234c Merge changes I514b90ae,Ie477de70
* changes:
  Fix DepsInSameApex for some dependencies of static libraries
  Expose all shared and header libraries to Make
2020-08-13 05:01:17 +00:00
Treehugger Robot
fc7baeb866 Merge "Stop using prebuilt NDK CRT objects." am: 50a58067e6 am: 52b4132004
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1363344

Change-Id: I0aaa0a1664f696c712bdf260663bf4b4648aea9c
2020-08-12 22:33:47 +00:00
Treehugger Robot
50a58067e6 Merge "Stop using prebuilt NDK CRT objects." 2020-08-12 22:01:27 +00:00
Dan Willemsen
9e2fd0fab6 Merge "Remove M4 export to Make" am: a6ba0d2a4c am: 50e7c7f0c6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1393489

Change-Id: Ib23151fb899979a7bd168346dd3603e69b8e6f33
2020-08-12 15:17:56 +00:00
Dan Willemsen
a6ba0d2a4c Merge "Remove M4 export to Make" 2020-08-12 14:48:08 +00:00
Kousik Kumar
a2499e0f42 Merge "Add remote execution support for clang-tidy actions" am: 20cccd2e95 am: deab08e664
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1343716

Change-Id: Ic5625a1466a25ee49fe511974ee5828ae78fc146
2020-08-12 14:25:56 +00:00