Commit graph

18456 commits

Author SHA1 Message Date
Chih-hung Hsieh
8744cdffeb Merge "Switch from clang-r370808b to clang-r377782" 2020-02-13 21:46:35 +00:00
Jeffrey Huang
f0ae6ccaa7 Remove liblog from whitelist
Bug: 145923087
Test: m -j
Change-Id: Ib1b711c01262ce9466cdd49daa3cc7142376004c
2020-02-13 12:33:39 -08:00
Ivan Lozano
8107b85189 Remove execute-only support.
With kernel support being removed for execute-only memory layouts,
remove support for XOM until there's kernel support again.

This allows us to gain the code-size improvements from
"-z noseparate-code".

Bug: 147300048
Test: Compiled binaries no longer marked XOM by default.
Change-Id: Ie84bdd2ca025e8b14867008291bf9ce143b5e999
2020-02-13 13:50:34 -05:00
Martin Stjernholm
6d415273c0 Do all dexpreoptDisabled checks before registering a dex2oat host dep.
Also disable dexpreopting for host. These are necessary to avoid adding
dependencies on dex2oat in various non-platform builds where they will
break.

Since we cannot assume at least one module enables dexpreopting now,
the two dexpreopt singletons are silently disabled if there has been no
call to dexpreopt.GetGlobalSoongConfig.

Bug: 145934348
Bug: 148312086
Bug: 148319588
Bug: 148690468
Test: m
Test: env OUT_DIR=out-tools prebuilts/build-tools/build-prebuilts.sh
  on the aosp-build-tools branch
Test: build/soong/soong_ui.bash --make-mode static_sdk_tools dist DIST_DIR=out-dist BUILD_HOST_static=1
  on internal (cf b/148312086#comment8)
Test: build/soong/soong_ui.bash --make-mode dist DIST_DIR=out-apps TARGET_BUILD_APPS=Launcher3 TARGET_BUILD_VARIANT=userdebug
  on internal without art/ and external/vixl/ (cf b/148319588)
Change-Id: I240dade7204b87fc2d12181534ab23439eca8b46
2020-02-13 17:46:48 +00:00
Martin Stjernholm
8d80ceeb12 Pass dexpreopt config structs by reference.
Should cut down on a bit of copying, and also required for an upcoming
CL that'll change GetCachedGlobalSoongConfig.

Test: m nothing
Bug: 145934348
Change-Id: I6bed737d9b061b5239cc603ad881f4ccd4312e43
2020-02-13 17:46:48 +00:00
Martin Stjernholm
d90676fdde Reland: Get the dex2oat host tool path from module dependency on the
binary module.

This uses the Once cache for GlobalSoongConfig to propagate the dex2oat
path from a module dependency to the singletons (both the one that
writes out dexpreopt_soong.config and the one that creates the
dexpreopted boot images). Unless dexpreopting is disabled altogether
through DisablePreopt in dexpreopt.config, that means:

- We must ensure at least one module registers a dex2oat tool
  dependency and resolves a GlobalSoongConfig using it, or else the
  singletons fail. That means we litter dex2oat dependencies in java
  modules even when they won't get dexpreopted and hence don't really
  need them.

- We still assume there's at least one java_library or android_app in
  the build.

This relands https://r.android.com/1205730 without changes - the
necessary fixes are in the child CLs.

Bug: 145934348
Test: m
  (check that out/soong/dexpreopt_soong.config points to dex2oatd64)
Test: env USE_DEX2OAT_DEBUG=false m
  (check that out/soong/dexpreopt_soong.config points to dex2oat64)
Test: env OUT_DIR=out-tools prebuilts/build-tools/build-prebuilts.sh
  on the aosp-build-tools branch
Change-Id: I66661711b317d1e4ec434861982919bdde19b575
2020-02-13 17:46:48 +00:00
Martin Stjernholm
40f9f3c061 Reland: Move the Once cache for dexpreopt.GlobalConfig into the
dexpreopt package.

Preparation for a future CL that will need to get the make-written
GlobalConfig from within dexpreopt.

Also rename the Load*Config functions to Parse*Config, since they don't
actually load the config files anymore.

This relands https://r.android.com/1211982.

Bug: 145934348
Test: m
Change-Id: Icb9332a93811d77d2d8b06e983b92501b180a358
2020-02-13 17:46:48 +00:00
Automerger Merge Worker
1b8156a3cf Merge "Use precise class loader context for system server jars." am: 394b9b379a
Change-Id: Ie9f00ab2e36189a513131d48fc9defecb31f0d94
2020-02-13 17:25:11 +00:00
Martin Stjernholm
75a48d8ae2 Reland: Separate dexpreopt.GlobalSoongConfig to allow independent
caching of it.

Introduce a Once cache for GlobalSoongConfig to allow it to get binary
tool paths from ordinary module dependencies (coming in a future CL)
that are then reused in singletons.

This relands https://r.android.com/1205729.

Bug: 145934348
Test: m
Change-Id: I039d6e204bee5ddc16d8e2d85057fbec20e326fe
2020-02-13 17:21:13 +00:00
Ulyana Trafimovich
394b9b379a Merge "Use precise class loader context for system server jars." 2020-02-13 17:13:13 +00:00
Automerger Merge Worker
ad6e56e993 Merge "Bump our macOS target version to 10.9." am: 3375433ed2
Change-Id: I97d5130e4ab3b455639347f0f4a58b748991a0fc
2020-02-13 16:14:16 +00:00
Elliott Hughes
3375433ed2 Merge "Bump our macOS target version to 10.9." 2020-02-13 16:02:19 +00:00
Ulya Trafimovich
f3ff010bd4 Use precise class loader context for system server jars.
This patch excludes non-Soong system server jars from dexpreopting.

System server jars should be dexpreopted together for better
performance: each jar should have all preceding system server jars
in its class loader context (that is passed to dex2oat and recorded
in the resulting .oat file to be used by the loader).

This means that we need a total order on system server jars. The
default order provided by PRODUCT_SYSTEM_SERVER_JARS is not good, as
it does not always respect genuine dependencies between jars (counter-
examples are rare, but non-trivial to fix: b/148219586).

This patch adds a post deps mutator pass that creates additional
dependencies and enforces global order. These are later used to
generate precise class loader contexts and system server classpath.

Test: Class loader contexts in the oat files for system server jars
  match expectations:

  $ oatdump --oat-file=out/target/product/walleye/system/framework/oat/arm64/com.android.location.provider.odex | grep '^classpath'
  classpath = PCL[]
  $ oatdump --oat-file=out/target/product/walleye/system/framework/oat/arm64/services.odex | grep '^classpath'
  classpath = PCL[/system/framework/com.android.location.provider.jar*1919890654]
  $ oatdump --oat-file=out/target/product/walleye/system/framework/oat/arm64/wifi-service.odex | grep '^classpath'
  classpath = PCL[/system/framework/com.android.location.provider.jar*1919890654:/system/framework/services.jar*4269704903:/system/framework/services.jar!classes2.dex*134345935]
  ...

Test: The phone boots and logcat has no scary messages related to
  class loader contexts:

  $ lunch aosp_walleye-userdebug && m
  $ adb reboot bootloader && fastboot flashall -w && adb wait-for-device
  $ adb root
  $ adb shell stop
  $ adb logcat -c
  $ adb shell setprop dalvik.vm.extra-opts -verbose:oat
  $ adb shell start
  $ adb logcat | egrep -i 'system_server: .*load.*/system/framework'
  02-03 14:14:26.912  5016  5016 I system_server: Loading /system/framework/oat/arm64/com.android.location.provider.odex with executable: 1
  02-03 14:14:26.914  5016  5016 I system_server: Successfully loaded /system/framework/oat/arm64/com.android.location.provider.odex with executable: 1
  02-03 14:14:26.914  5016  5016 I system_server: Loading /system/framework/oat/arm64/services.odex with executable: 1
  02-03 14:14:26.916  5016  5016 I system_server: Successfully loaded /system/framework/oat/arm64/services.odex with executable: 1
  02-03 14:14:26.927  5016  5016 I system_server: Loading /system/framework/oat/arm64/wifi-service.odex with executable: 1
  02-03 14:14:26.933  5016  5016 I system_server: Successfully loaded /system/framework/oat/arm64/wifi-service.odex with executable: 1
  02-03 14:14:26.933  5016  5016 I system_server: Loading /system/framework/oat/arm64/ethernet-service.odex with executable: 1
  02-03 14:14:26.934  5016  5016 I system_server: Successfully loaded /system/framework/oat/arm64/ethernet-service.odex with executable: 1
  02-03 14:14:26.946  5016  5016 I system_server: Loading /system/framework/oat/arm64/com.android.location.provider.odex with executable: 0
  02-03 14:14:26.947  5016  5016 I system_server: Successfully loaded /system/framework/oat/arm64/com.android.location.provider.odex with executable: 0
  02-03 14:14:26.947  5016  5016 I system_server: Loading /system/framework/oat/arm64/services.odex with executable: 0
  02-03 14:14:26.948  5016  5016 I system_server: Successfully loaded /system/framework/oat/arm64/services.odex with executable: 0
  02-03 14:14:26.948  5016  5016 I system_server: Loading /system/framework/oat/arm64/wifi-service.odex with executable: 0
  02-03 14:14:26.948  5016  5016 I system_server: Successfully loaded /system/framework/oat/arm64/wifi-service.odex with executable: 0
  02-03 14:14:26.949  5016  5016 I system_server: Loading /system/framework/oat/arm64/ethernet-service.odex with executable: 0
  02-03 14:14:26.949  5016  5016 I system_server: Successfully loaded /system/framework/oat/arm64/ethernet-service.odex with executable: 0
  02-03 14:14:30.480  5016  5016 I system_server: Loading /system/framework/oat/arm64/com.android.location.provider.odex with executable: 1
  02-03 14:14:30.481  5016  5016 I system_server: Successfully loaded /system/framework/oat/arm64/com.android.location.provider.odex with executable: 1

Bug: 141785760
Bug: 140451054
Bug: 148944771

Change-Id: Idac678dbd1f5fe0e381ce8e0e3561423f8a31389
2020-02-13 14:39:03 +00:00
Automerger Merge Worker
cc153a6a57 Merge "Make PRODUCT_BOOT_JARS and PRODUCT_UPDATABLE_BOOT_JARS disjoint." am: cc9a5edd4f
Change-Id: Icdf33fa16a312eff7a1c71f17ebaa4ba23bffc97
2020-02-13 13:48:33 +00:00
Ulyana Trafimovich
cc9a5edd4f Merge "Make PRODUCT_BOOT_JARS and PRODUCT_UPDATABLE_BOOT_JARS disjoint." 2020-02-13 13:36:25 +00:00
Ulya Trafimovich
4cdada2d1f Make PRODUCT_BOOT_JARS and PRODUCT_UPDATABLE_BOOT_JARS disjoint.
This is to unify boot jars with system server jars:
PRODUCT_SYSTEM_SERVER_JARS and PRODUCT_UPDATABLE_SYSTEM_SERVER_JARS
do not overlap.

Test: aosp_walleye-userdebug boots

Exempt-From-Owner-Approval: cherry-pick.
Bug: 146363577
Change-Id: If001049a46f8e9d38921dabeedbd61e971ebfe73
Merged-In: If001049a46f8e9d38921dabeedbd61e971ebfe73
(cherry picked from commit ef4358e536)
2020-02-13 13:35:39 +00:00
Automerger Merge Worker
7dbfe9a852 Merge "Add vendor snapshot modules" am: f048446f92
Change-Id: I28f589f50c4305a6287a88916e522401f618afb8
2020-02-13 11:17:01 +00:00
Treehugger Robot
f048446f92 Merge "Add vendor snapshot modules" 2020-02-13 11:01:10 +00:00
Automerger Merge Worker
6a22b910e5 Merge "Disable PGO profile use in Clang-based coverage builds" am: 64a075c789
Change-Id: I1a10630ef67e457b0539b519e829aab7f95bc924
2020-02-13 07:02:08 +00:00
Treehugger Robot
64a075c789 Merge "Disable PGO profile use in Clang-based coverage builds" 2020-02-13 06:51:21 +00:00
Automerger Merge Worker
8aac3e3c0d Update apex.go to remove libutils am: 9401b187f8
Change-Id: I72a201f0e0dc78f0d5876ffd2a2cd5e3d2df56d7
2020-02-13 06:20:55 +00:00
Elliott Hughes
632dbb3dc2 Bump our macOS target version to 10.9.
https://developer.apple.com/documentation/xcode/notarizing_macos_software_before_distribution/resolving_common_notarization_issues
says "notarization only works for binaries linked against macOS 10.9
or later".

Test: N/A
Bug: http://b/143105198
Change-Id: If66f81caa2f074bf70a75094da578295aa9f58ad
2020-02-12 18:31:35 -08:00
Jeffrey Huang
9401b187f8 Update apex.go to remove libutils
Bug: 145922701
Test: m -j
Change-Id: I13078f43129a7a9478b9bb97bb94c2c70fdb148c
2020-02-12 17:35:59 -08:00
Pirama Arumuga Nainar
807d49bc43 Disable PGO profile use in Clang-based coverage builds
Bug: http://b/143977934

Clang errors that -fprofile-use and -fprofile-instr-generate are
incompatible.

Test: m CLANG_COVERAGE=true COVERAGE_PATHS="*" on cf_x86_phone target
Change-Id: I584b615639fcef86668b7fa34b7511b4820d9548
2020-02-12 15:12:07 -08:00
Chih-Hung Hsieh
9d9555e348 Switch from clang-r370808b to clang-r377782
Allow new clang compiler warnings until they are
fixed or suppressed in all branches.

Bug: 145916209
Test: make checkbuild
Change-Id: Ic873b8d705dacd0d92f9031b3960e01283090363
2020-02-12 21:50:07 +00:00
Automerger Merge Worker
cf6fc983ae Merge "Improve documentation of the enabled property" am: 6a20b179d2
Change-Id: Id6065ec725fd9bbb9c5e4204264fa2c2e8b640e0
2020-02-12 21:12:16 +00:00
Treehugger Robot
6a20b179d2 Merge "Improve documentation of the enabled property" 2020-02-12 21:08:32 +00:00
Automerger Merge Worker
0c8e8c2cf3 Merge "Update the doc about apex_available" am: 6eb0da1530
Change-Id: I061fad849d672ef1f175c58dfc202378ff019581
2020-02-12 21:06:49 +00:00
Treehugger Robot
6eb0da1530 Merge "Update the doc about apex_available" 2020-02-12 20:58:24 +00:00
Jiyong Park
9a1e14ef6c Update the doc about apex_available
The default has changed.

Exempt-From-Owner-Approval: documentation change

Bug: 128708192
Bug: 149393721
Test: n/a
Change-Id: I91f36fc1fb5f2302deac8ee23bb847077b1281c9
2020-02-12 20:58:08 +00:00
David Zeuthen
b71fe84c64 Port IdentityCredential HAL to AIDL.
Bug: 111446262
Test: atest android.security.identity.cts
Test: VtsHalIdentityTargetTest
Test: android.hardware.identity-support-lib-test
Change-Id: Ibd5403f52e2d59237e77757c3f334c13b26f3d9d
2020-02-12 10:05:03 -05:00
Paul Duffin
54d9bb70d0 Improve documentation of the enabled property
Makes it clear that disabling a module is something that should be
avoided if possible.

Test: m soong_docs
Change-Id: Ief11e705f049edfd53b2af66bdf753f24d32aa71
2020-02-12 10:28:40 +00:00
Jiyong Park
f760cae41b apexDepsMutator is a top-down mutator
apex { name: ["myapex"], native_shared_libs: ["libX", "libY"] }
cc_library { name: "libX", shared_libs: ["libY"] }
cc_library { name: "libY", shared_libs: ["libZ"], stubs: {...} }

apexDepsMutator was a bottom up mutator and it uses WalkDeps to traverse
the dependency tree rooted at myapex in a depth-first order. While
traversing the tree, if calls BuildForApex for a module that will be
part of the APEX.

libY is visited twice. Once via libX and once via myapex. If the visit
from libX was before the visit from myapex (since this is a depth-first
traversing), BuildForApex is not called for libY and its dependency
libZ, because libY provides a stub. And then when libY is again visited
via myapex, BuildForApex is correctly called for the module, but not for
its dependencies libZ because the paths from libY to libZ was already
visited.

As a result, the apex variant of libY has a dependency to the non-apex
variant of libZ.

Fixing the problem by changing the mutator a top-down one.

Bug: 148645937
Test: m
Change-Id: Ib2cb28852087c63a568b3fd036504e9261cf0782
2020-02-12 17:01:26 +09:00
Automerger Merge Worker
ee239878f4 Merge "Update apex dependency even for test and non-installable APEXes" am: 4e29184a4e
Change-Id: I6c61b9a816c98bc878a394c612fc99d26acbb612
2020-02-12 07:52:58 +00:00
Treehugger Robot
4e29184a4e Merge "Update apex dependency even for test and non-installable APEXes" 2020-02-12 07:45:47 +00:00
Automerger Merge Worker
8a7f0e94c1 Merge "Automatically set compile_dex:true and hostdex:true for APEX variants" am: 6655756230
Change-Id: Ic54a14c775d39486930bc356f84c2bd6073d9f0c
2020-02-12 05:49:14 +00:00
Treehugger Robot
6655756230 Merge "Automatically set compile_dex:true and hostdex:true for APEX variants" 2020-02-12 05:35:25 +00:00
Automerger Merge Worker
233c3d4978 Merge "java_sdk_library - replace .docs suffix with .stubs.source" am: 19d84a0f3e
Change-Id: Ifdc36ce678d34a73cd88ac89d31b39f74ed33de3
2020-02-12 02:43:27 +00:00
Treehugger Robot
19d84a0f3e Merge "java_sdk_library - replace .docs suffix with .stubs.source" 2020-02-12 02:29:35 +00:00
Jiyong Park
6b21c7d2ab Automatically set compile_dex:true and hostdex:true for APEX variants
... unless they are turned off explicitly.

Bug: 147221965
Test: m
Change-Id: I6b91d6409d9cf06ad09467c53d5d51a9c693256e
2020-02-12 10:47:36 +09:00
Automerger Merge Worker
39b51a899f Merge "<apex_name>-deps-info correctly tracks dependencies" am: 2bb26d3fad
Change-Id: Ibc9b5c619373c1698fa1cb90129d5da45bb5407b
2020-02-12 00:49:07 +00:00
Automerger Merge Worker
00f3bf9e7e Merge "m <module_name> builds <module_name>.<apex_name>" am: 45f3c9b6a6
Change-Id: I30659368e9eb37d83e2f1ad45b43f3bd3c2d50f7
2020-02-12 00:48:42 +00:00
Jiyong Park
2bb26d3fad Merge "<apex_name>-deps-info correctly tracks dependencies" 2020-02-12 00:47:21 +00:00
Treehugger Robot
45f3c9b6a6 Merge "m <module_name> builds <module_name>.<apex_name>" 2020-02-12 00:35:55 +00:00
Automerger Merge Worker
b19df54d94 Merge "neverallow: update for different HIDL build." am: 226adf28ae
Change-Id: If94b76353b10f255f24ed274ead5bef34bbf387e
2020-02-11 23:24:24 +00:00
Steven Moreland
226adf28ae Merge "neverallow: update for different HIDL build." 2020-02-11 23:10:34 +00:00
Jiyong Park
ab872e0295 Update apex dependency even for test and non-installable APEXes
The apex dependency map wasn't updated for test or non-installable
APEXes to work around the problem that a module being in such APEX
prevented the module from being installed in the system partition.

Since that problem is not happening any more, removing the unnecessary
work-around.

Bug: 123892969
Test: m
Change-Id: I43e07a9611a3e08ff39b9a64454b1c67949d35bc
2020-02-12 07:45:16 +09:00
Automerger Merge Worker
aa47e5748a Merge "Revert "Allow Linux hosts to use ubsan runtime sanitizers."" am: 2d743b54c7
Change-Id: I6f1999ff19f14b6599788a19f6c9462d97d445d6
2020-02-11 20:38:36 +00:00
Ivan Lozano
2d743b54c7 Merge "Revert "Allow Linux hosts to use ubsan runtime sanitizers."" 2020-02-11 20:23:36 +00:00
Ivan Lozano
9e37faa3ab Revert "Allow Linux hosts to use ubsan runtime sanitizers."
This reverts commit dbc5000c5b.

Reason for revert: Build breakage.

Change-Id: Ia6a1b58f156e4cc071562043c2f99f78b45b7968
Exempt-From-Owner-Approval: Reverting change due to build breakage.
2020-02-11 20:21:01 +00:00