Commit Graph

21329 Commits

Author SHA1 Message Date
Thiébaud Weksteen 682c9d7b25 Rename ccConfig to cc_config
Follow up from aosp/1413495 to set a consistent name throughout the
package.

Test: m
Change-Id: Idafcd973e7d874cd97599ac419c2972a8a5cd0b4
2020-08-31 10:06:16 +02:00
Thiébaud Weksteen 416149e09b Merge changes I94fd8bbc,I497dcdff,I1873a180
* changes:
  rust: strip libraries and binaries
  rust: add ccToolchain to Module
  rust: enable use-android-relr-tags
2020-08-31 07:54:32 +00:00
Colin Cross 9c35c9ae63 Merge "Remove hack for platform availability of modules with missing apexes" 2020-08-31 04:20:18 +00:00
Nikita Ioffe a0254b5289 Merge "Add F2FS support for APEX build system" 2020-08-28 21:55:24 +00:00
Colin Cross d2c81a7933 Remove hack for platform availability of modules with missing apexes
The affected modules weren't actually built in the affected build,
delay the platform availability check in Make instead to allow
the build to proceed.

Bug: 154888298
Test: m checkbuild
Change-Id: I21778e38e04635545b352dee2043a33ec9da246b
2020-08-28 13:32:02 -07:00
Matthias Maennich bea94d3525 Merge "soong: add support for module specific lexer flags" 2020-08-28 19:24:01 +00:00
Theotime Combes 4ba38c1a3f Add F2FS support for APEX build system
Add the new property payload_fs_type in apex module type. Either 'f2fs'
or 'ext4'. Default 'ext4'.

Test: m

Bug: 158453869
Change-Id: I36f373251bd597e11acb62af75437a87e2a531ec
Merged-In: I36f373251bd597e11acb62af75437a87e2a531ec
2020-08-28 12:03:00 +00:00
Jooyung Han dcbb66f8c9 Merge "apex: dedup jni_libs when generating apex_manifest" 2020-08-28 11:28:49 +00:00
Ulyana Trafimovich b8822a0616 Merge "Propagate transitive SDK Java library dependencies to dexpreopt." 2020-08-28 09:36:13 +00:00
Thiébaud Weksteen fabaff6bd7 rust: strip libraries and binaries
Reuses the cc.Stripper logic. Abstracts Stripper to avoid the spreading
of references to the cc package.

rustc requires unstripped libraries (precisely, with the `.rustc`
section) when building dependent targets. Contrary to cc, the output of
a compiler module will remain unstripped and only an extra build rule
will be added. This rule will be referenced at install time (in
baseCompiler.install or androidmk).

This change drastically reduces the size of the installed libraries:
(unstripped, from out/target/product/crosshatch/system)
$ find . -name \*.dylib.so -print0 | du -c --files0-from=-
149996  total

(stripped, with this change)
$ find . -name \*.dylib.so -print0 | du -c --files0-from=-
42380   total

Bug: 153430439
Test: cd external/rust; mma
Change-Id: I94fd8bbcec97e0610aa325d3db4460be84d01734
2020-08-28 10:50:17 +02:00
Thiébaud Weksteen 31f1bb80ef rust: add ccToolchain to Module
The cc toolchain information is required when using cc.Stripper.
Move to a Module method to avoid importing the cc package everywhere.

Test: m nothing
Bug: 153430439
Change-Id: I497dcdff4e767ecb8b8688c73cf88850c302683d
2020-08-28 10:47:11 +02:00
Thiébaud Weksteen 19e1c6c8e7 rust: enable use-android-relr-tags
Bug: 153430439
Test: m
Change-Id: I1873a180f0646cd1dba9e1756fd68bd788d4f725
2020-08-28 10:47:11 +02:00
Thiébaud Weksteen 03156929db Merge "cc: export Stripper struct" 2020-08-28 08:32:28 +00:00
Bowgo Tsai 38414db4de Merge "Revert "[pgo] Return updated Flags after adding flags for PGO/AFDO"" 2020-08-28 08:15:48 +00:00
Thiébaud Weksteen 3600b80e6f Return all rules when TestingModule.Rule fails
Similarly to Output, we return the list of Rules that have been
generated for TestingModule. This helps debugging failing tests.

Test: m nothing
Change-Id: I3542f4e4632f94fb84208c2e48e629271a373fd4
2020-08-28 08:15:09 +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
Jooyung Han b9007609f6 apex: dedup jni_libs when generating apex_manifest
When we package both 32/62, there could be two instances of the same
library. We need to dedup the list of jni_libs.

Bug: n/a
Test: m com.android.cronet (which uses jni_libs)
      check apex_manifest.pb
Change-Id: I9a9f42f0f5219ab7bc50d945b54113b5d823b7f3
2020-08-28 16:33:16 +09:00
Treehugger Robot 1fde95ac3f Merge "[pgo] Return updated Flags after adding flags for PGO/AFDO" 2020-08-28 04:50:08 +00:00
Treehugger Robot 10a3873a80 Merge "Introduce BOARD_CURRENT_API_LEVEL_FOR_VENDOR_MODULES" 2020-08-28 04:26:49 +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
Ivan Lozano b0e99edab1 Merge "[rust] Pass cc dependencies as linker flags." 2020-08-27 20:50:16 +00:00
Jeongik Cha 219141c6bb Introduce BOARD_CURRENT_API_LEVEL_FOR_VENDOR_MODULES
If BOARD_CURRENT_API_LEVEL_FOR_VENDOR_MODULES has a numeric value,
it replaces "current" or "system_current" with the version which
the flag indicates.

Bug: 163009188
Test: BOARD_CURRENT_API_LEVEL_FOR_VENDOR_MODULES=29 m, and then check if every vendor
java module's sdk_version is 29 if its sdk_version was current.

Change-Id: I17b49b8e02caf2d1bc57b91648d4420f3ad9fcb9
2020-08-27 23:09:54 +09:00
Ulya Trafimovich fc24ad3d4e Propagate transitive SDK Java library dependencies to dexpreopt.
For some dependencies, like stubs, the SDK library may not be found at
build time (either because the implementation library is not among the
dependencies of the dexpreopted module, or because it's part of a
prebuilt, or because it's missing from the build altogether). In such
cases dexpreopt is useless, because dex2oat does not have access to the
full classpath (unless the &-classpath is used). Therefore do not
dexpreopt in such cases.

Test: lunch aosp_cf_x86_phone-userdebug && m
Bug: 132357300
Change-Id: If289088cfd103011ccb16165e95a97b30fd31b81
2020-08-27 11:47:15 +01:00
Ulyana Trafimovich 03333d0e2f Merge "Export error reporting function to allow using it in other packages." 2020-08-27 09:07:51 +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
Colin Cross 3806fc0943 Merge changes I6aa28149,I1ff35ea9
* changes:
  Remove TestApexWithJniLibs_Errors
  Create image variations for sh_binary
2020-08-27 00:29:36 +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
Ivan Lozano 2093af23c0 [rust] Pass cc dependencies as linker flags.
In order to support cc dependencies which do not start with the 'lib'
prefix, we can't pass them through the -l flag. Instead, we can pass
them directly to linker flags.

Bug: 166151658
Test: cd external/rust/; mma
Test: cd external/crosvm/; mma
Test: Test linking to a cc dep that does not begin with 'lib'

Change-Id: I5acbf3d3405e66446f3eae600b35683c4eb3d8a5
2020-08-26 17:07:29 -04: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
Ivan Lozano 4d947f0ea8 Merge "Link device binaries dynamically by default." 2020-08-26 20:32:32 +00:00
Joel Galenson 6945e9b650 Migrate away from removed option
Upstream removed the -Z no-landing-pads option in
https://github.com/rust-lang/rust/pull/70175, which we picked up in
our latest toolchain update.

Fixes: 166317885
Test: Build and TreeHugger
Change-Id: I51c0ef671bf6a334b2b7223da42cab547e4407d3
2020-08-25 15:27:15 -07:00
Treehugger Robot 2d078b814a Merge "Bazel overlay: rename 'deps' to 'module_deps'." 2020-08-25 21:40:50 +00:00
Ivan Lozano 042504f7d6 Link device binaries dynamically by default.
Device binaries currently are linked statically by default. Instead we
should be linking these dynamic by default. To avoid conflicts when
manually specifying rlib dependencies on modules, we always link libstd
dynamically for all device modules except static libraries.

This removes the "prefer_dynamic" property entirely to avoid confusion.

Bug: 165161105
Test: m profcollectd is built dynamically.
Test: cd external/rust/; mma
Test: cd external/crosvm/; mma
Change-Id: I25ac897040acbcc2d97c791a33e8e01610632272
2020-08-25 13:32:53 -04:00
Ulya Trafimovich 5ab276ad1d Export error reporting function to allow using it in other packages.
Test: lunch aosp_cf_x86_phone-userdebug && m
Change-Id: I3a1d936ac57966b2f47cb1d9a56e0f96f47b807d
2020-08-25 12:45:15 +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
Jingwen Chen ce3d46fe05 Bazel overlay: rename 'deps' to 'module_deps'.
'deps' is a module prop used by some module types, like
prebuilt_build_tool:

https://cs.android.com/android/platform/superproject/+/master:build/soong/android/prebuilt_build_tool.go;l=25-26;drc=751ae87ed29c67629f068a8590af80023a457294

Use `module_deps` to prevent conflicts in the generated overlay
attributes.

Bug: 162720644
Test: m bazel_overlay && cd out/soong/bazel_overlay && bazel cquery
//...
Test: soong_build tests

Signed-off-by: Jingwen Chen <jingwen@google.com>
Change-Id: Ia075a860983960b2d9121d30ead8f808be7e0c5b
2020-08-25 06:11:53 +00:00
Jingwen Chen dc4df2dd4a Merge "Surface module properties as Bazel BUILD target attributes in the Bazel overlay" am: 81a0b66d93
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1393254

Change-Id: Iaaf6ce5bd5e9aacc2ec577bbb60fe2544ad945ba
2020-08-24 23:40:11 +00:00
Jingwen Chen 81a0b66d93 Merge "Surface module properties as Bazel BUILD target attributes in the Bazel overlay" 2020-08-24 22:59:11 +00:00
Treehugger Robot 1e4fbc23bf Merge "Support ninja rsp files in soong_zip" am: 4c2e4f381a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1405368

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

Change-Id: Ia8a02f8570ca0619c1b4696aa72c2dd1a2a393ee
2020-08-24 17:31:15 +00:00
Liz Kammer 380c67920e Merge "Add imports_sdk_version to prebuilt_apis" am: 9c07d24477
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1397557

Change-Id: Ic536dfe4c2f3a3a2e610520266cdca76f0d9ecfd
2020-08-24 17:30:51 +00:00
Treehugger Robot e819bec240 Merge "Propagate sanitize.never flag in SDK snapshots." 2020-08-24 17:20:58 +00:00
Liz Kammer 9c07d24477 Merge "Add imports_sdk_version to prebuilt_apis" 2020-08-24 16:50:51 +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
Colin Cross 6419a88214 Update go.mod to go 1.15 am: 42f135b7b0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1405909

Change-Id: Ic3bfd0cf94cd477d8a0f8830cb9b9bb3764968f0
2020-08-22 00:51:33 +00:00
Colin Cross 9e93b1bb12 Remove TestApexWithJniLibs_Errors
AddFarVariationDependencies was broken, which allowed dependencies
on non-libraries to be added even though a link variation was
requested.  When AddFarVariationDependencies is fixed, attempting
to add a non-library to jni_libs results in the usual missing
variant error.

Test: none
Change-Id: I6aa281491b8af5f141a2d132e248c75f95d68ab5
2020-08-21 16:18:11 -07:00
Colin Cross cc83efbb18 Create image variations for sh_binary
AddFarVariationDependencies was broken, which allowed apex modules
to depend on sh_binary even though they were requesting an image
variation and sh_binary did not have one.  Create image variations
for sh_binary.

Test: TestApexWithShBinary
Change-Id: I1ff35ea9967edafbb7812a5e56667e4385af7e2f
2020-08-21 14:27:34 -07:00
Colin Cross 42f135b7b0 Update go.mod to go 1.15
The version in go.mod is used by `go build` to select the version
of the Go language to target.  If it is older than the version of Go
in the tree then command line tools like `go test` will give different
results from inside the build.  Update the version to match the version
of Go in the tree.

Test: go build ./java
Change-Id: I418f401580be7696e2829c970938c7c82715b932
2020-08-21 11:13:21 -07:00