Commit graph

24933 commits

Author SHA1 Message Date
Ivan Lozano
dd0554722a rust: Refactor staticStd to stdLinkage
Instead of returning a boolean, return an enum value to improve
readability and provide greater flexibility for future modifications.

Bug: 168729404
Test: Soong tests pass
Change-Id: Iddcdae8c34be09e476404382e43d1ea5935bae65
2020-09-28 13:26:05 -04:00
Ivan Lozano
11200870b0 rust: Add prefer_rlib property for static libstd.
Adds the prefer_rlib property to allow linking libstd statically for
device rust binaries. This also changes the default behavior of rustlibs
to also prefer rlib linkage. This is because dylibs do not provide
rlib-libstd variants and always link in libstd dynamically. Thus a
binary requesting libstd rlib linkage should not attempt to link against
dylibs that link libstd dynamically.

Bug: 168729404
Test: New Soong test passes.
Change-Id: Idf8dfbbce8fd936f55a3fb323b17a1a7f0ee954e
2020-09-28 12:01:47 -04:00
Thiébaud Weksteen
e0510d7a69 rust: Fix module name in bindgen_test
Test: m nothing
Change-Id: Ifc1dda4433906f3496e86f5b29b7d9ec694d735c
2020-09-25 15:50:09 +02:00
Thiébaud Weksteen
4820c2c8d2 Merge "Avoid Rust source provider rule duplication" 2020-09-25 13:14:01 +00:00
Ivan Lozano
ce2cffd583 Merge "rust: Add rust_bindgen std version w/ cc defaults." 2020-09-25 13:11:34 +00:00
Thiébaud Weksteen
295c72bebc Avoid Rust source provider rule duplication
Until now, source provider modules duplicated the rule to generate the
source for each variant. Add a inter-variant dependency between the
source and the other variants (e.g. rlib, dylib) to avoid this
duplication. Add documentation on this behaviour.

Bug: 162588681
Test: m
Change-Id: I41c9e2220f8875245415e17374852e540dfd47ec
2020-09-25 11:36:13 +02:00
Yi Kong
6a94390d2e Merge "Global ThinLTO mode" 2020-09-25 08:36:17 +00:00
Anton Hansson
a6906e2329 Merge "Make API lint warnings errors for system & testapi" 2020-09-25 06:52:57 +00:00
Kousik Kumar
bf30e4d576 Merge "Allow overrides for RBE_log_dir" 2020-09-25 05:40:24 +00:00
Treehugger Robot
985f6295c2 Merge "Switch to armv7 for Rust ARM" 2020-09-25 03:50:41 +00:00
Treehugger Robot
4f6eebff0c Merge changes I0885e493,Ic37c8db9
* changes:
  linux_bionic_arm64 is added when Host_bionic_arm64 is true
  HostCross is an attribute of a Target, not OsType
2020-09-24 22:56:43 +00:00
Matthew Maurer
ad64c39442 Switch to armv7 for Rust ARM
In the previous mode, building Rust code using certain intrinsics would
fail on arm32 since our runtime is armv7, but our codegen was arm.

Test: cd external/rust; mma
Bug: 169245712
Change-Id: Ie800486b39325486f5ff319e46632df2a6987391
2020-09-24 14:28:47 -07:00
Dan Albert
8bd5095362 Merge changes from topics "soong-apilevel", "soong-config-apilevel"
* changes:
  Convert more versions in config to ApiLevel.
  Replace FutureApiLevel with an ApiLevel.
  Replace ApiStrToNum uses with ApiLevel.
2020-09-24 21:02:07 +00:00
Yi Kong
93718e0d41 Global ThinLTO mode
Experimental global ThinLTO mode for compilation time evaluation.

Bug: 169004486
Test: GLBOAL_THINLTO=true m
Change-Id: I2ff06397be8b65c7972f1e5f09ab1496949567ee
2020-09-25 02:43:14 +08:00
Treehugger Robot
2c7ca784f7 Merge "Extend target docs to cover (almost) all variants." 2020-09-24 18:05:39 +00:00
Ivan Lozano
3d94752b34 rust: Add rust_bindgen std version w/ cc defaults.
Adds the c_std and cpp_std properties to rust_bindgen, and use the
default values from cc if these are undefined.

This assumes by default that the header extension indicates whether
the header is a C or C++ header file. This default can be overridden
by setting either c_std or cpp_std.

Test: Soong tests pass, "-std=" arg included in bindgen calls
Bug: 163580541
Change-Id: I5b0d3b8eae9a54dd91d8a0aca583d7803a344f27
2020-09-24 13:45:09 -04:00
Anton Hansson
b30f593da4 Make API lint warnings errors for system & testapi
They used to be listed to not have this treatment, but we are
baselining the existing warnings and making them errors instead.

Bug: 154317059
Test: m
Change-Id: I306b5a07d1b771cc0061aaac44f881f40fbe85ed
Merged-In: I306b5a07d1b771cc0061aaac44f881f40fbe85ed
2020-09-24 13:51:29 +01:00
Jiyong Park
2210198129 linux_bionic_arm64 is added when Host_bionic_arm64 is true
linux_bionic_arm64 is the new host target using Bionic as libc.  This
change adds a new Soong config Host_bionic_arm64 that enables the
target.

This change also amends firstTarget() function to handle the case when
the available targets for an OS have different arch families. In that
case, first target is selected for each of the arch family. This is
needed in the (rare) care when both linux_bionic_x86_64 and
linux_bionic_arm64 targets are enabled.

Bug: 159685774
Test: add "Host_bionic_arm64": true to out/soong/soong.config and run
./build/soong/soong_ui.bash --make-mode --skip-make
out/soong/host/linux_bionic-arm64/bin/aarch64-linux-bionic/crosvm

Change-Id: I0885e49379f6ee216c6e82adbb1230655171a7a5
2020-09-24 14:14:36 +09:00
Jiyong Park
1613e5541f HostCross is an attribute of a Target, not OsType
A host target is considered as being cross-compiled when the target
can't run natively on the build machine. For example, linux_glibc/x86_64
is a non-cross target on a standard x86/Linux machine, but is a cross
host on Mac. Previously, whether cross or not was a static attribute of
an OsType. For example, Windows was always considered as cross host,
while linux_bionic was not. This becomes a problem when we support more
host targets like linux_bionic/arm64 which should be cross-host on
standard x86/Linux machines.

This change removes HostCross from the OsClass type and instead adds a
property HostCross to the Target type. When a target is being added, it
is initialized to true when the target can't run natively on the current
build machine.

Bug: 168086242
Test: m
Change-Id: Ic37c8db918873ddf324c86b12b5412952b0f2be2
2020-09-24 14:14:31 +09:00
Colin Cross
3735c144e0 Merge "Move PrimaryModule, FinalModule, VisitAllModuleVariants to BaseModuleContext" 2020-09-24 00:58:24 +00:00
Colin Cross
f950513579 Merge "Add providers support" 2020-09-24 00:28:42 +00:00
Martin Stjernholm
e284b48496 Extend target docs to cover (almost) all variants.
Test: n/a - comment change only
Change-Id: Ia0e6e4c6f872cf8023cb6470935cab3d6a0c1fee
2020-09-23 21:12:45 +01:00
Martin Stjernholm
a9a99bc6d2 Merge "Handle absolute source paths correctly." 2020-09-23 13:03:06 +00:00
Roland Levillain
1a1b885319 Merge "Add missing characters in documentation of compile_multilib property." 2020-09-23 12:19:07 +00:00
Kousik Kumar
0d15a72915 Allow overrides for RBE_log_dir
We should override log-dir with the environment variables if its set.
This is needed in our integration tests and generally to allow for
user-overrides.

Test: RBE_log_dir=`pwd`/rbelogs mmma external/boringssl
Change-Id: I3d316a2d60122c42f5c3b5dfede4037362a7b5f1
2020-09-23 02:59:19 -04:00
Yi Kong
76a5ba81e2 Merge "Tweak ThinLTO inling heuristics in absense of PGO profile" 2020-09-23 04:31:42 +00:00
Pirama Arumuga Nainar
d55be35331 Merge "Propagate PGO instr. flags to dependencies of a static lib" 2020-09-23 01:11:40 +00:00
Colin Cross
2d53a608ae Merge changes from topic "return-new-deps"
* changes:
  Remove global state from version mutator
  Return new dependencies from BottomUpMutatorContext.Add*
2020-09-22 23:30:03 +00:00
Dan Albert
4f378d75aa Convert more versions in config to ApiLevel.
The test case I removed is invalid. The codename has had its int
assigned, but the config claims it is not final.

If this ever does need to be supported it's just a matter of making
sure the Q -> 29 mapping (or whatever) in the finalized codenames map
in android/api_levels.go.

Test: treehugger
Bug: http://b/154667674
Change-Id: I4f42ec2fd4a37750519ee3937938a1c65b6bb1e8
2020-09-22 16:01:56 -07:00
Dan Albert
0b176c8038 Replace FutureApiLevel with an ApiLevel.
Keeping the int constant around for now as FutureApiLevelInt because
it's still useful in places that haven't adopted ApiLevel yet for
testing if their non-ApiLevel API level is current or not.

Test: treehugger
Bug: http://b/154667674
Change-Id: I47a7012703f41fdeb56f91edf9c83afa93042deb
2020-09-22 15:04:48 -07:00
Dan Albert
c8060536e8 Replace ApiStrToNum uses with ApiLevel.
Test: treehugger
Bug: http://b/154667674
Change-Id: I2954bb21c1cfdeb305f25cfb6c8711c930f6ed50
2020-09-22 15:04:48 -07:00
Treehugger Robot
af6073f78d Merge "Deprecate USE_GOMA and replace with FORCE_USE_GOMA" 2020-09-22 20:35:23 +00:00
Dan Albert
6d136bf195 Merge "Update finalized codenames map." 2020-09-22 20:23:14 +00:00
Pirama Arumuga Nainar
1150fd7c68 Propagate PGO instr. flags to dependencies of a static lib
Bug: http://b/119560349
Bug: http://b/168925229

To build with PGO instrumentation, the link step also needs
-fprofile-generate flag.  Omitting this will result in a linker error.
This surfaces if module A depends on module B but PGO is used only for
module B.

Previous uses of PGO were avoiding or working around the issue but to
accommadate recent changes, this CL propagates the PGO linker flag to
module A.

Test: pgo-coral-config1 in release branch, TH
Change-Id: I12f6243152d4f5ea5526fbce03c25dba232ddab7
2020-09-22 11:49:25 -07:00
Treehugger Robot
5fc50f2936 Merge "Fix proguard_usage.zip with USE_RBE=true RBE_R8=true" 2020-09-22 17:59:40 +00:00
Yi Kong
2f5f16d574 Tweak ThinLTO inling heuristics in absense of PGO profile
We previously disabled inlining and unrolling completely during ThinLTO
in absense of PGO profile. For global ThinLTO, we want to better balance
binary size and performance.

We evaluated a number of combination of heuristics with global ThinLTO
configuration:
                                binary size change
  no LTO                          baseline
  no inline, no unroll            -0.54%
  no inline, unroll               -0.50%
  import-instr-limit=5, unroll    +0.02%
  import-instr-limit=10, unroll   +0.13%

Loop unrolling does not contribute much to the binary size, therefore
it is re-enabled.

import-instr-limit=5 balances the binary size savings from ThinLTO and
size incrase due to additional optimisation.

Bug: 78485207
Bug: 169004486
Test: TreeHugger
Change-Id: I1c21153605e2ae42daa8857b06e27c081ee8ad85
2020-09-23 01:32:06 +08:00
Stephen Hines
c5a0e64d82 Merge "Switch to clang-r399163." 2020-09-22 16:40:02 +00:00
Roland Levillain
24bb2e63a0 Add missing characters in documentation of compile_multilib property.
Test: n/a (comment-only change)
Change-Id: I77fbca73ecf8d31f2d8146d2d5aa50d8c5503396
2020-09-22 11:19:28 +00:00
Jooyung Han
ca4536fc26 Merge "apex: prebuilt_firmware installs in /etc/firmware" 2020-09-22 01:36:35 +00:00
Martin Stjernholm
14ee832216 Handle absolute source paths correctly.
Can happen if OUT_DIR is set on an absolute path.

Test: env RBE_remote_disabled=true OUT_DIR=/home_2/tmp/out m
Bug: 169048540
Fixes: 169048540
Change-Id: Ia6b91b13142d84e54d0dee8b4e04a91ad2cecc36
2020-09-22 01:17:32 +01:00
Treehugger Robot
7ede442a9e Merge "Suppress reflection warnings when running metalava" 2020-09-21 22:17:25 +00:00
Dan Albert
21498b4153 Merge "Replace stringly-typed API levels." 2020-09-21 20:20:30 +00:00
Ivan Lozano
4de88a62c1 Merge "rust: Add libstd linkage mutator for rlibs." 2020-09-21 19:38:28 +00:00
Kousik Kumar
ec47864ca0 Deprecate USE_GOMA and replace with FORCE_USE_GOMA
Bug: b/163361527
Test: Ran builds with USE_GOMA / FORCE_USE_GOMA flags
Change-Id: I67b229fbf52e913b0c4f5e7932021132ddc0598f
2020-09-21 15:35:57 -04:00
Aurimas Liutikas
4c5efde049 Suppress reflection warnings when running metalava
Intellij PSI/UAST reflects into java.base causing
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.intellij.util.ReflectionUtil (file:/mnt/ssd1/out/master/soong/host/linux-x86/framework/metalava.jar) to method java.util.ResourceBundle.setParent(java.util.ResourceBundle)
WARNING: Please consider reporting this to the maintainers of com.intellij.util.ReflectionUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Upstream bug https://youtrack.jetbrains.com/issue/IDEA-210683

Bug: 168689341
Test: make checkapi
Change-Id: Ibc8954d83d5962b3cd0ea1bac9a62f6ccfc88c6c
2020-09-21 11:35:10 -07:00
Roland Levillain
dba548af83 Merge "Introduce new Arm64 arch variant with dot product features" 2020-09-21 17:54:04 +00:00
Yi Kong
52cebe5aff Merge "Introduce LTO property for -fwhole-program-vtables cflag" 2020-09-21 17:01:56 +00:00
Yi Kong
2d01fe28df Introduce LTO property for -fwhole-program-vtables cflag
-fwhole-program-vtables cflag requires LTO to be enabled. Some projects
add this flag unconditionally, breaking builds that turn off LTO.

Make this an LTO property so that build system will handle adding the
flag when LTO is on.

Test: build
Bug: 169004486
Change-Id: Ifce12c09e1d6b8c2807314c3bb982b076efcaaa4
2020-09-21 16:54:07 +00:00
Liz Kammer
9d1f85da7a Merge "Make hiddenapi use prebuilt stubs when it should" 2020-09-21 14:29:50 +00:00
Jeffrey Vander Stoep
4b524bac10 Merge "Use Rust 1.46.0 prebuilts" 2020-09-21 13:04:33 +00:00