Commit Graph

6123 Commits

Author SHA1 Message Date
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
Martin Stjernholm
4840a6e02f Merge "Handle absolute source paths correctly." am: a9a99bc6d2 am: d170d99b68 am: 3ee5786146 am: 5323a8a6f8 am: 687baab5a0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1433434

Change-Id: I2a6814bc2d16a09210b1bb2565ce6b9e494a2251
2020-09-23 14:52:36 +00:00
Martin Stjernholm
a9a99bc6d2 Merge "Handle absolute source paths correctly." 2020-09-23 13:03:06 +00:00
Yi Kong
2ca8a04ad4 Merge "Tweak ThinLTO inling heuristics in absense of PGO profile" am: 76a5ba81e2 am: 280fdb9610 am: 5499f46ea6 am: cb89f96bfc am: 90660c0815
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1433954

Change-Id: Ie58691fc97d4aa71aa9f2c27fba09692f085321b
2020-09-23 06:26:39 +00: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
40dc55f2af Merge "Propagate PGO instr. flags to dependencies of a static lib" am: d55be35331 am: 16878206e6 am: 0dc5152f68 am: 6033ba145c am: 749ccad37d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1433217

Change-Id: Ib8974ca928b41311338d80dda930104686914082
2020-09-23 03:27:23 +00:00
Colin Cross
5782caf3e3 Merge changes from topic "return-new-deps" am: 2d53a608ae am: 98d152f0d0 am: 619cbea5c5 am: 3c5bba9c93 am: ba2c80aa2e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1428814

Change-Id: Ia01b631379986861b8da14666403f622ac0d7263
2020-09-23 01:18:36 +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
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
Stephen Hines
4392eaf2d3 Merge "Switch to clang-r399163." am: c5a0e64d82 am: d421364a97 am: 6c76bfed8f am: 394c241989 am: 140bcb4ee2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1401176

Change-Id: I78d075f5bbd7a76ea30a58f8eaaf2c918630866c
2020-09-22 19:23:39 +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
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
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
Dan Albert
bdece9167a Merge "Replace stringly-typed API levels." am: 21498b4153 am: bf0942e3dd am: aec322d7d6 am: 647a308776 am: 9815787e55
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1356263

Change-Id: Ia52a5252bf3780279be3d63d42a376a1041aba43
2020-09-21 22:18:35 +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
Roland Levillain
842410d9e5 Merge "Introduce new Arm64 arch variant with dot product features" am: dba548af83 am: c3f8bb9f35 am: 9cf2103acd am: 76c2720461 am: 3288c6c9c9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1426708

Change-Id: I8673220c20841c39fb83d0ba45974c37904f9184
2020-09-21 19:04:40 +00:00
Yi Kong
d53a5af1ca Merge "Introduce LTO property for -fwhole-program-vtables cflag" am: 52cebe5aff am: 6b8931ce48 am: 50dfc16e17 am: 380f24b73e am: e1eee5fd54
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1429862

Change-Id: I8d9840b2cd313682859a54ca0da74e70bff354e5
2020-09-21 19:04:27 +00:00
Roland Levillain
dba548af83 Merge "Introduce new Arm64 arch variant with dot product features" 2020-09-21 17:54:04 +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
Dan Albert
1a2462717e Replace stringly-typed API levels.
Handling of API levels within Soong is currently fairly difficult
since it isn't always clear based on context what kind of API level a
given string represents, how much canonicalizing and error checking
the code receiving the string are expected to do, or how those errors
should be treated.

The API level struct does not export its raw data, so as to keep its
"constructor" private to the android package, and to prevent misuse of
the `number` field, which is only an implementation detail for preview
API levels. API levels can be parsed with either
`android.ApiLevelFromUser`, which returns any errors to the caller, or
`android.ApiLevelOrPanic`, which is used in the case where the input
is trusted and any errors in parsing should panic. Even within the
`android` package, these APIs should be preferred over direct
construction.

For cases where there are context specific parsing requirements, such
as handling the "minimum" alias in the cc module,
`nativeApiLevelFromUser` and `nativeApiLevelOrPanic` should be used
instead.

Test: treehugger
Bug: http://b/154667674
Change-Id: Id52921fda32cb437fb1775ac2183299dedc0cf20
2020-09-18 12:41:28 -07:00
Selene Huang
7141705760 Add keymint to vndk.
Test: treehugger presubmit
Change-Id: Ie68fc6758b4205f21a19dd4ca544b302a3c8fb8c
2020-09-17 23:50:08 -07:00
Victor Khimenko
98801ec1ee Merge "Add -D__ANDROID_NATIVE_BRIDGE__ to native_bridge targets" am: f18c623c04 am: a5aa453308 am: 99404342c8 am: f1b5387e26 am: 897e5f3757
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1428610

Change-Id: Ib024d7f20acca3816a9f72cbf0872cf8627372ea
2020-09-18 04:01:55 +00:00
Yu-Han Yang
613712c720 Add GNSS AIDL interfaces (build/soong)
Bug: 159467682
Test: atest VtsHalGnssTargetTest
Change-Id: I4699eb8c9d73d56ba586896c65f0f8f7f9040dee
2020-09-17 20:11:42 -07:00
Colin Cross
d1f898e70a Remove global state from version mutator
A per-context variable is used to store the list of modules that
contain stubs and their available versions.  Stores the list of the
stubs versions on the implementation module, and then use the new
return values from AddVariationDependencies to expand dependencies
on implementation libraries to also depend on the stubs libraries.
Adds a new mutator pass to propagate list of stub versions to llndk
libraries.

Also creates an alias version variation called "latest" to allow
depending on the latest version without having to know what it is.

Test: all Soong tests
Test: no change to build.ninja, Android-${TARGET_PRODUCT}.mk, make_vars-${TARGET_PRODUCT}.mk or late-${TARGET_PRODUCT}.mk
Change-Id: If19659e2e5828c860fd4d679ef79a414b7ea2efc
2020-09-17 18:56:59 -07:00
Victor Khimenko
f18c623c04 Merge "Add -D__ANDROID_NATIVE_BRIDGE__ to native_bridge targets" 2020-09-17 19:09:03 +00:00
Victor Khimenko
1a31f80b03 Add -D__ANDROID_NATIVE_BRIDGE__ to native_bridge targets
And remove dual meaning from arm_on_x86 target. It was set for x86
targets with arm support and for arm targets with x86 support - and that
2nd one was abused for native_bridge version of RenderScript.

It's much safer and cleaner to rely on __ANDROID_NATIVE_BRIDGE__ there
while leaving arm_on_x86 to mean "x86 binary built in the image with arm
support".

It's only used by bcc compiler which is in canadian-cross situation here:
it's pure x86-64 binary, but it needs to know about ALL supported
architectures on device because it needs to include appropriate codegen
module.

Bug: http://b/153609531

Test: cts-tradefed run cts --abi armeabi-v7a -m CtsRsCppTestCases
Test: cts-tradefed run cts --abi arm64-v8a -m CtsRsCppTestCases

Change-Id: I869212e0b82eeaa30361a4e183d5c862ab40ef12
2020-09-17 01:42:50 +00:00
Tom Cherry
a646a9de11 Include system/core/liblog/include instead of using symlinks
It seems better to include this path directly rather than creating
symlinks in system/core that accomplish the same result.

Test: treehugger
Change-Id: I248a2f0450bbd5da132f67872ec018decba42725
2020-09-16 16:52:29 -07:00
Stephen Hines
2210e720c9 Switch to clang-r399163.
Bug: http://b/155835175
Bug: http://b/151457797
Bug: http://b/165945989
Test: m with aosp_blueline
Change-Id: Id2c2932ccbc34fcbb19cd0b4da0d66ea92cc099a
2020-09-15 13:48:05 -07:00
Treehugger Robot
92ae56554d Merge "Heed SkipInstall flag when adding install rules for vendor-snapshot." am: 386821fae7 am: f6173cf1d2 am: c61d5f2904 am: d89e03f730 am: 8cc652f6fc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1423509

Change-Id: I8f342230be86cbf9c80ae6d1fe5a36d3f403fbc3
2020-09-15 19:27:22 +00:00
Treehugger Robot
386821fae7 Merge "Heed SkipInstall flag when adding install rules for vendor-snapshot." 2020-09-15 16:49:35 +00:00
Riddle Hsu
ba31b8073f Merge "Disable the prebuilt host binary test on darwin." am: 280b899a37 am: a33f2016a2 am: da56a9b9d8 am: 175d2623e8 am: c23b5e91d9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1427730

Change-Id: I42bd16c08f6cf049d12f80831702daf80d51ad10
2020-09-15 10:19:00 +00:00
Treehugger Robot
67a2b72204 Merge "Symlink prebuilt binaries on host." am: b11236d53d am: cb067953eb am: f34d8c94d7 am: 089e8d67d2 am: 7a4913c245
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1404637

Change-Id: Ic00a88ed42e702adfea522b9319db95d6afd5cfc
2020-09-15 02:54:08 +00:00
Martin Stjernholm
6a9a14663d Disable the prebuilt host binary test on darwin.
Variants and paths are different there, and it is hard to test since
it's only in postsubmit in TH.

Test: m nothing
Bug: 168558897
Change-Id: I071540b3c7ff9a9fd4104dca75079e831b1b2529
2020-09-15 02:56:19 +01:00
Treehugger Robot
b11236d53d Merge "Symlink prebuilt binaries on host." 2020-09-15 00:00:15 +00:00
Treehugger Robot
b72cdea7e8 Merge "LinuxBionic supports arm64" am: 5a1a88ee93 am: 298cc116ce am: 3728f3b498 am: 8c21946f2a am: 2d7ef4a0cb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1409590

Change-Id: I8cec0b6df4ab9606e254e1720dfc89834196a193
2020-09-14 22:43:45 +00:00
Martin Stjernholm
809d51866a Heed SkipInstall flag when adding install rules for vendor-snapshot.
The prebuilt-vs-source selection operates by setting SkipInstall on
either module. When the vendor-snapshot module visits all modules it
will visit both, and if it is a static library it will then add
duplicate install rules for both source and prebuilt unless it
looks at SkipInstall.

Test: `m nothing` in a tree with prebuilts/runtime present, that
  has been updated with a snapshot after https://r.android.com/1398472,
  which started to propagate vendor_available flags to prebuilts
  snapshots.
Bug: 151303681
Change-Id: Ie425f0115e4180b7f4a8e682696697d55d666845
2020-09-14 22:15:42 +01:00
Treehugger Robot
5a1a88ee93 Merge "LinuxBionic supports arm64" 2020-09-14 15:59:16 +00:00
Colin Cross
680b11571f Merge "Use alias for test_per_src apex dependencies" am: a018b3df16 am: b524b7a9f6 am: a6aafd9d18 am: bf6baa6494 am: 2b90325fa0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1406260

Change-Id: I368bf31438820af7de33c2a5f0931763cde2cb4a
2020-09-12 22:42:10 +00:00
Colin Cross
a018b3df16 Merge "Use alias for test_per_src apex dependencies" 2020-09-12 20:21:36 +00:00
Colin Cross
13a8fbedca Make generated library SDK snapshots determinstic am: 2c033610e2 am: c16e34e85e am: f4e815c868 am: 9ebd1454ba am: ff5e805d8d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1425997

Change-Id: Ifa4abaca9cbef1c4bef3b3abb43b51b558e39e0e
2020-09-12 19:51:22 +00:00
Treehugger Robot
535ab9a246 Merge "Propagate recovery_available property through to sdk snapshot" am: 05175c405b am: cd1c4bb58b am: 9cabaa47ad am: 00e9b68322 am: 4225ac8989
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1425730

Change-Id: I703c8de9746303bf48b81eac79809c32eb42a071
2020-09-12 00:14:56 +00:00
Yifan Hong
20146fced4 Merge "Sanitize APEX module name properly." am: c2c2d4e716 am: 18a051adfd am: b061c19fae am: 58e1a76367 am: 731da4e08d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1423412

Change-Id: I7258337155fdea260d786a8673d32c9ae5f89fdf
2020-09-12 00:10:18 +00:00
Colin Cross
2c033610e2 Make generated library SDK snapshots determinstic
Sort the include dir properties before printing them out of a map.

Test: m checkbuild
Change-Id: Ia924158755983631259ef0b53c369666de4e1d23
2020-09-11 23:10:39 +00:00
Colin Cross
90dab3498d Use alias for test_per_src apex dependencies
AddFarVariationDependencies was broken, which allowed apex to add
dependencies on tests by requesting an empty test_per_src variation
even though some test dependencies did not have a test_per_src
variation.  Add an alias from the pre-test_per_src variation
variant to the empty test_per_src variation, and drop the
test_per_src variation when requesting the depencency.

Test: TestApexWithTests
Change-Id: I2ed7bdd761027956141e25d4d81f9074afe628b6
2020-09-11 16:02:24 -07:00
Pirama Arumuga Nainar
0d1a961617 Merge "Set -fsjlj-exceptions for all 32-bit Windows compiles" am: 0710d8e1cc am: 46ac90bd23 am: ff5ebad225 am: 3d112bc9f2 am: 1a10457ac3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1424708

Change-Id: I85e8cd4f4f06e7c90945fb5cb1f4397cb45b17ee
2020-09-11 22:12:52 +00:00