Commit Graph

25033 Commits

Author SHA1 Message Date
Treehugger Robot 985f6295c2 Merge "Switch to armv7 for Rust ARM" 2020-09-25 03:50:41 +00:00
Martin Stjernholm b024957791 Propagate all sanitizer flags in SDK snapshots.
liblog snapshot needs to sanitizer.address=false to avoid cycle in asan
builds. Adding that separately in library_sdk_member.go would start to
feel like whack-a-mole, so the snapshot generation is instead extended
to handle nested property structs.

This uses the BpPropertySet.AddProperty extension in
https://r.android.com/1423510, and common value optimisation now
recurses into non-anonymous structs, instead of comparing them as a
whole.

Test: m nothing
Test: `m SANITIZE_TARGET=address nothing` with prebuilts/runtime
  present in the manifest and a fresh snapshot made with this
Bug: 151303681
Change-Id: I472554117a488e6c800045cb2ed59377778571a4
2020-09-25 00:33:04 +01:00
Martin Stjernholm 191c25f589 Handle property structs and BpPropertySets as values to AddProperty.
Both will create a nested property set, that may be merged with an
existing one.

Test: m nothing
Bug: 151303681
Change-Id: I30696ba3eb8960ca6fa54c9ee2cf6229ab9f5da9
2020-09-25 00:33:04 +01: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 af7b36dea5 Add type information to symbolfile and ndkstubgen.
Test: mypy symbolfile
Test: pytest
Bug: None
Change-Id: I6b1045d315e5a10e699d31de9fafc084d82768b2
2020-09-24 14:03:31 -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
Yo Chiang 219968c9b3 soong: Exclude system shared libs from fix suggestions
Pass the value of system_shared_libs to the Android.mk world, so that
prebuilt ELF check can exclude them from fix suggestions.

Bug: 141925662
Test: Write a bad cc_prebuilt_library module and check fix suggestions
Change-Id: I0cc61821765507180ce6a582bf8125a192f83a57
2020-09-24 13:18:08 +08: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
Jooyung Han 7f146c0da1 apex: emit file_contexts for flattened apex
Flattened APEXes are installed in /<partition>/apex/<name>, so its
file_contexts file should be amended accordingly.
For example, file_contexts of an apex "com.android.foo" with should be
modified by prepending actual install path to the path regex.

/bin/foo <sepolicy label>
=> /system/apex/com\.android\.foo/bin/foo <sepolicy label>

File_contexts file is emitted to "make" via LOCAL_FILE_CONTEXTS variable
for apex_manifest.pb module.

Make collects these files and use them to build file_contexts.bin.

Also removed global state which is used to keep the list of all
flattened apexes.

Bug: 166518492
Test: m file_contexts.bin
      check intermediate file_contexts.modules.tmp file
      in $OUT/obj/ETC/file_contexts.bin_intermediates/
Change-Id: I780370b6e576964a5c09f9477f3361f341dd576b
2020-09-23 15:43:39 +00: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 bc220ca803 Forbid -fwhole_program_vtables
-fwhole_program_vtables depends on LTO being enabled. User manually
adding this through ldflag will break no LTO build configuration.

Test: TreeHugger
Change-Id: I557ec57831f01856a467f9567c3e7e25f8a6c566
2020-09-23 01:39:32 +08: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 Shi 3194912150 Add support of test data to python_host_test
Bug: none
Test: m -j vts_vndk_abi_test
confirm abi_dump.zip found next to test binary

Change-Id: I834dddfc13eb9e7addd234307b085b16124db234
2020-09-21 14:36:43 -07: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
Jooyung Han 8e5685ddca apex: prebuilt_firmware installs in /etc/firmware
Installation path of prebuilt_firmware varies accoding to target
partitions. When it is for system, it installs a file in
/system/etc/firmware while it installs in /vendor/firmware for vendor.

We'd better be consistent about installation path when it is
for APEXes regardless of target partition. Otherwise, ueventd would need
to scan both /apex/*/etc/firmware and /apex/*/firmware.

Having /etc prefix for prebuilt modules helps module owners to predict
the layout of the contents.

Bug: 162701747
Bug: 167942098
Test: soong tests
Test: loading vibrator firmware from vibrator apex (sunfish)
Change-Id: I7a7105026426f8a7a156bc947304930f761c81f3
2020-09-21 11:02:57 +09:00
Treehugger Robot 41243c1d5f Merge "Copy documentation from Blueprint interfaces into Soong interfaces" 2020-09-19 05:17:59 +00:00