Commit graph

3956 commits

Author SHA1 Message Date
Steven Laver
7a833bdf2b Merge "Don't check library variant identicalness for VNDK extensions" 2020-01-29 21:26:48 +00:00
Automerger Merge Worker
0fc81af6a9 Merge "Add whole_static_libs to non-svelte configs." am: c0ebc81e3d am: b3e6f5f64e am: 9beba772e6
Change-Id: I1557d0e0f3fc53dc8264703022bef30545ffff7c
2020-01-29 18:01:22 +00:00
Christopher Ferris
c0ebc81e3d Merge "Add whole_static_libs to non-svelte configs." 2020-01-29 17:22:01 +00:00
Steven Laver
025d98162b Don't check library variant identicalness for VNDK extensions
These libraries don't have a core variant against which to check
for identicalness.

Bug: 148526685
Test: built a previously failing target with this change (succeeded)
Change-Id: Ide8ec58df1868175f52c005bf73bb81fc196a571
2020-01-29 08:23:09 -08:00
Automerger Merge Worker
3ccf41b598 Add AUTO_UNINITIALIZE as another option for trivial initialization. am: 797e1959e3 am: 5cbb2c9c4e am: 7e785a4708
Change-Id: Id11df160ddadc47428c58fb15c270ae9b74c4c9d
2020-01-29 01:13:16 +00:00
Stephen Hines
797e1959e3 Add AUTO_UNINITIALIZE as another option for trivial initialization.
This lets us test uninitialized variables even if we change the defaults
for -ftrivial-auto-var-init.

Bug: 131390872
Test: AUTO_UNINITIALIZE=true m
Change-Id: I2b4473a0547dc9c4d9f081d8af2d283f17f66f7a
2020-01-28 14:43:11 -08:00
Elliott Hughes
da909feb95 Use relocation-packer style relocation packing between 23 and 28.
Bug: http://b/147452927
Test: treehugger
Change-Id: I8197dcb7884993d75775eaea667981d7822d6d1d
2020-01-28 13:08:40 -08:00
Automerger Merge Worker
1bf59ab8ab Merge "Add support for experimentally enabling RBE support on specific rules." am: 5e0dbe4e3e am: 205edb5da3 am: a171ec4e95
Change-Id: I2922a3dd955162fa9f713ebfe9fe1852d76fd2c3
2020-01-28 20:31:14 +00:00
Christopher Ferris
c71193ae53 Add whole_static_libs to non-svelte configs.
This is to support enabling scudo only for non-svelte configs.

Also, add exclude_static_libs to allow removing the jemalloc libs.

Bug: 137795072

Test: Verified that a svelte and non-svelte config can use this method
Test: to properly choose between scudo and jemalloc.

Change-Id: Iec6bfe159f8491138e93dde1d225a8c874c7ce31
2020-01-28 12:02:46 -08:00
Ramy Medhat
8ea054a81e Add support for experimentally enabling RBE support on specific rules.
This CL adds RBE support to javac, r8, and d8 rules which is only
enabled if respective environment variables are set.

Test: an aosp_crosshatch build with and without the new variables.
Change-Id: Ic82f3627944f6a5ee7b9f3228170c2709b1bfcb8
2020-01-28 12:42:47 -05:00
Automerger Merge Worker
2b4893b669 Add target.ramdisk am: cf4832c8bc am: 0e4b401dd0 am: 7bfa6b0a56
Change-Id: I9a43e57ee9fa173fe80633e7974b74c7d4149a2a
2020-01-25 01:14:19 +00:00
Automerger Merge Worker
7c6b9aa0f4 Add ramdisk image. am: 1b3348d50a am: 45fd8b4547 am: f9e51442b6
Change-Id: Icfa7eaeaa70bc7380a01b33c110f74ec783c8b4d
2020-01-25 01:14:09 +00:00
Yifan Hong
0e4b401dd0 Add target.ramdisk
am: cf4832c8bc

Change-Id: Iffaa86779dc03939bc3e94f6fba53c5b9f6dbbbb
2020-01-24 16:33:45 -08:00
Yifan Hong
45fd8b4547 Add ramdisk image.
am: 1b3348d50a

Change-Id: I9bf85d8119a970b0526a13b6a7e251f6de307929
2020-01-24 16:32:50 -08:00
Yifan Hong
a8c82cc218 Merge changes from topics "board_use_recovery_as_root_soong", "ramdisk"
* changes:
  libatomic / libgcc_stripped: ramdisk_available
  Add target.ramdisk
  Ramdisk modules install to correct location
  Add ramdisk image.
2020-01-24 22:39:41 +00:00
Ivailo Karamanolev
5650166b98 Merge "Add android.hardware.light-ndk_platform to vndkMustUseVendorVariantList" 2020-01-23 16:05:08 +00:00
Automerger Merge Worker
7ae23db1e5 Merge "Revert "Revert "apex_vndk uses vendor variants only""" am: 7b2970536e am: 4e5f39e9d8 am: d2293a5d6c
Change-Id: I75f3c5fbf97a422a15deebf9a07514a27517b88c
2020-01-23 13:50:46 +00:00
Treehugger Robot
7b2970536e Merge "Revert "Revert "apex_vndk uses vendor variants only""" 2020-01-23 13:16:52 +00:00
Ivailo Karamanolev
1415cb8397 Add android.hardware.light-ndk_platform to vndkMustUseVendorVariantList
aidl libs need to be differentiated because they explicitly set
different system/vendor stabilities.

Bug: 142230898
Test: fixes build
Change-Id: Ib09baa946faff8334f7c50568db5e6735dfbbfe2
2020-01-23 10:42:01 +01:00
Automerger Merge Worker
c0bd73f156 Merge "Reland "Clean up no-vendor-variant VNDK whitelist"" am: 641e87a02c am: a54fbcbce0 am: 6db7972481
Change-Id: I10726f2b4b1337a529112b5c74691e84f9a6f376
2020-01-23 06:43:52 +00:00
Automerger Merge Worker
7b66ae8ba1 Merge "Revert "apex_vndk uses vendor variants only"" am: 7dfb229936 am: cb8a4e39e8 am: 40cd3da318
Change-Id: Ic15d4f885a577520994d7f8b99937e167734956d
2020-01-23 06:43:44 +00:00
Automerger Merge Worker
4f1218a7c0 Merge "apex_vndk uses vendor variants only" am: e4226c4d67 am: 65ea3bca11 am: 7713f3f743
Change-Id: I09a0448de71a9ec196e4673b271c4e6eb4073158
2020-01-23 06:43:15 +00:00
Vic Yang
641e87a02c Merge "Reland "Clean up no-vendor-variant VNDK whitelist"" 2020-01-23 06:07:58 +00:00
Jooyung Han
a57af4adc0 Revert "Revert "apex_vndk uses vendor variants only""
This reverts commit 5df3b11f78.

Reason for revert: re-land with a fix

Fix a broken soong test
Add implicit dependency (libprofile-clang-extra) to make a test pass.

Bug: n/a
Test: m
Change-Id: I0b179199bc032501354f8e24782837453781bd8c
2020-01-23 14:48:29 +09:00
Jooyung Han
7dfb229936 Merge "Revert "apex_vndk uses vendor variants only"" 2020-01-23 05:34:42 +00:00
Jooyung Han
5df3b11f78 Revert "apex_vndk uses vendor variants only"
This reverts commit 559ad01db9.

Reason for revert: broken builds

Change-Id: Ia8a09a2bdbdc8e76f2d4b9eb54e36ccc544e9397
Bug: b/148181875
2020-01-23 05:31:05 +00:00
Treehugger Robot
e4226c4d67 Merge "apex_vndk uses vendor variants only" 2020-01-23 04:47:05 +00:00
Jooyung Han
559ad01db9 apex_vndk uses vendor variants only
VNDK APEX is supposed to contain "vendor" variants of VNDK libraries.
This is different from normal APEXes which have "apex" variants.

Bug: 146758869
Test: build / flash / boot
Change-Id: I5e035678c337334092616b58d2e0e404788a6639
Exempt-From-Owner-Approval: Got ORV, but rebased with resolving merge conflicts.
2020-01-23 04:46:53 +00:00
Yifan Hong
cf4832c8bc Add target.ramdisk
Add the following:
- exclude_shared_libs
- exclude_static_libs
- static_libs

Allow to customize linking for ramdisk variant.

Test: pass
Bug: 147347110
Change-Id: I6f55f11a6fdad8029d85833a3eedc2e95a712d51
2020-01-22 16:54:18 -08:00
Yifan Hong
1b3348d50a Add ramdisk image.
It is similar to recovery image.
Test: m nothing -j

Change-Id: I11389777c6bfb0c0d73bbb4c70091c1e70f44077
2020-01-22 16:54:18 -08:00
Automerger Merge Worker
b67cb16f4e Merge "Add coverage flags for Clang coverage builds." am: b6aeb14150 am: 195ed73e05 am: a5486a3ce4
Change-Id: Ice10bb5085f0ecb1330c5c12086d10b6ce6d6407
2020-01-22 22:57:36 +00:00
Automerger Merge Worker
41976f65c8 Merge "Revert "Default to pattern initialization for uninitialized variables."" am: 8aecc11844 am: 20f4f20573 am: 52a5c8a6c4
Change-Id: I59b7744189596223c466bb228a3c0117a1253d1f
2020-01-22 22:57:18 +00:00
Oliver Nguyen
b6aeb14150 Merge "Add coverage flags for Clang coverage builds." 2020-01-22 22:34:35 +00:00
Hadrien Zalek
8aecc11844 Merge "Revert "Default to pattern initialization for uninitialized variables."" 2020-01-22 22:16:18 +00:00
Hadrien Zalek
6fecbee4d5 Revert "Default to pattern initialization for uninitialized variables."
This reverts commit fae236f4ee.

Reason for revert: Breaks 32-bit app tests on Cuttlefish
Bug: 148123414

Change-Id: Ieeb0b09e711a55172e6faa0035d1eb84dd6c4471
2020-01-22 21:50:56 +00:00
Vic Yang
34b24aa82e Reland "Clean up no-vendor-variant VNDK whitelist"
Test: Build success
Change-Id: If8ca5f9cec5fc735e56ec06fefd4cebf44032b59
2020-01-21 15:38:42 -08:00
Automerger Merge Worker
b5e21f9fec Merge "build: Link the unwinder dynamically into platform and vendor binaries." am: d2f8df4b3e am: d248db0569 am: 765ca85910
Change-Id: I974cd680c23df784e1a17ebff2ef18ae8091b2de
2020-01-21 22:42:37 +00:00
Peter Collingbourne
d2f8df4b3e Merge "build: Link the unwinder dynamically into platform and vendor binaries." 2020-01-21 21:28:44 +00:00
Automerger Merge Worker
7491494ed9 Merge "Revert "Clean up no-vendor-variant VNDK whitelist"" am: f3cae775e9 am: eefd2dbb9e am: 21eaaee02c
Change-Id: I98b0e040bcd579ef09adcd0d555a095692832817
2020-01-21 21:14:19 +00:00
Vic Yang
f3cae775e9 Merge "Revert "Clean up no-vendor-variant VNDK whitelist"" 2020-01-21 20:45:49 +00:00
Vic Yang
987ebebfbc Revert "Clean up no-vendor-variant VNDK whitelist"
This reverts commit 882e59d45d.

Reason for revert: Breaking build on internal target

Change-Id: I775f120ef140835ee4fe76db5cbbb33255f93b76
2020-01-21 20:38:37 +00:00
Automerger Merge Worker
c8d49dd28d Merge "Clean up no-vendor-variant VNDK whitelist" am: a07b2f7766 am: c465d38acd am: ca317d9fee
Change-Id: Idd12794b8d29535c90bccbcc5bdb407ffc104cb1
2020-01-21 19:06:15 +00:00
Automerger Merge Worker
93aba9621f Merge "Default to pattern initialization for uninitialized variables." am: b9b979c8aa am: 51fd7fd318 am: 5ae46811a1
Change-Id: I2b994c28f5fa6911f699ad8512193a9e3a55c6e6
2020-01-21 19:06:00 +00:00
Treehugger Robot
a07b2f7766 Merge "Clean up no-vendor-variant VNDK whitelist" 2020-01-21 18:38:55 +00:00
Vic Yang
882e59d45d Clean up no-vendor-variant VNDK whitelist
First round of cleaning. Remove VNDK libraries that
already have identical variants.

Bug: 148082691
Test: Build success
Change-Id: I97f946a2cbf459b607a73e766db9fb8d7655f220
2020-01-21 18:33:44 +00:00
Stephen Hines
b9b979c8aa Merge "Default to pattern initialization for uninitialized variables." 2020-01-21 18:06:31 +00:00
Automerger Merge Worker
b9c5ce4f92 Merge "Do not create ABI dumps for NDK stub libraries" am: a22f30e0c9 am: 4ced3e137a am: a8473160f0
Change-Id: I3a45ffe284582a6448fac56b5266d95c5af20907
2020-01-20 02:39:30 +00:00
Hsin-Yi Chen
a22f30e0c9 Merge "Do not create ABI dumps for NDK stub libraries" 2020-01-20 02:11:16 +00:00
Automerger Merge Worker
22e4996821 Add OWNERS for cc/config/vndk.go am: ff9f7fb26a am: b85b6d03aa am: 38a78173f4
Change-Id: I8180e369835bbb6d99d6639010c82a1c78140601
2020-01-17 22:49:25 +00:00
Automerger Merge Worker
9166980bbd Merge "Add "-no-warn-sample-unuse=true" to work around AutoFDO issue" am: d810312751 am: b13d81ba3b am: 1c78fcfd38
Change-Id: Ia956fc1f8ede4187243cfddd73ff80a97290b1b3
2020-01-17 22:27:43 +00:00
Automerger Merge Worker
1036bf62e1 Merge changes from topic "vndkvariantcheck" am: 3fbe62b57d am: 38166bf1d0 am: e249a4f808
Change-Id: Idc66ebc6866dcf57b984638011edcb5e985715e5
2020-01-17 22:20:44 +00:00
Vic Yang
ff9f7fb26a Add OWNERS for cc/config/vndk.go
This file contains only a list of VNDK libraries that are allowed to
have different VNDK variant behaviors.

Test: N/A
Change-Id: I9e395b82b8006133294cf325e4626c1b34053588
2020-01-17 11:23:14 -08:00
Yi Kong
d810312751 Merge "Add "-no-warn-sample-unuse=true" to work around AutoFDO issue" 2020-01-17 19:04:23 +00:00
Treehugger Robot
3fbe62b57d Merge changes from topic "vndkvariantcheck"
* changes:
  vndkMustUseVendorVariant += libstagefright_bufferpool@2.0
  Emit LOCAL_CHECK_SAME_VNDK_VARIANTS
2020-01-17 18:45:43 +00:00
Automerger Merge Worker
13c5d7814c Merge "Dedup cc binary build components registration" am: e24093a784 am: 87318085ca am: bdcf05af66
Change-Id: Id1ecda6c1f14c714d8aa22b5efddd0ba3c7300fe
2020-01-17 11:46:56 +00:00
Treehugger Robot
e24093a784 Merge "Dedup cc binary build components registration" 2020-01-17 11:11:50 +00:00
Hsin-Yi Chen
d2451683d9 Do not create ABI dumps for NDK stub libraries
Some NDK stub libraries are tagged with "LLNDK" in lsdump_paths.txt
because they are not in NDK, and their base module names are in LLNDK.
This commit excludes those NDK stub libraries from lsdump path list.

Test: make findlsdumps
Bug: 147409497
Change-Id: I7a72758ba40d5f5bda8c436dd0b22e5efda03a32
2020-01-17 14:07:32 +08:00
Yi Kong
92474e5b8f Add "-no-warn-sample-unuse=true" to work around AutoFDO issue
Autofdo generates profile for an instruction even if there is no debug
information associated with it or no debug information associated with
the function. A bogus offset will be produced in the profile. Add the
flag to suppress Clang from generating error for such cases.

Test: build with ETM profile
Bug: 147844018
Bug: 79161490
Change-Id: I37da1ba3a4962072ccdf01f79fbf2c2b4c77b56b
2020-01-16 17:09:19 -08:00
Automerger Merge Worker
c8279bf8c5 Merge "power: add stable aidl to VndkMustUseVendorVariantList" am: 27a5c64200 am: 062354f8f5 am: e33f18511c
Change-Id: I710fe5446ec722db0e6b3548abd76605da584a69
2020-01-16 23:09:09 +00:00
Wei Wang
27a5c64200 Merge "power: add stable aidl to VndkMustUseVendorVariantList" 2020-01-16 22:35:42 +00:00
Automerger Merge Worker
4c167ae85d Merge "Save compilation units in protobuf format." am: 1be2d48005 am: e0703cdd88 am: 0a5b3ff2b7
Change-Id: I1d9d4c999b72443c36f992050987962a55cb4056
2020-01-16 19:27:17 +00:00
Treehugger Robot
1be2d48005 Merge "Save compilation units in protobuf format." 2020-01-16 18:55:26 +00:00
Paul Duffin
2ee6979443 Dedup cc binary build components registration
Bug: 146540677
Test: m nothing

Change-Id: I1c677d0ee2cead1d61f81e34e8d5a2f4a52f6cad
2020-01-16 14:10:18 +00:00
Automerger Merge Worker
18cb8f9305 Merge "AIDEGen:fix module_bp_cc_deps.json content error." am: bb363086c7 am: 850a13f80c am: 6a3d85228e
Change-Id: I7f23e4e88752d5f9039d68dcfe8a77ed178c63f1
2020-01-16 01:32:18 +00:00
Treehugger Robot
bb363086c7 Merge "AIDEGen:fix module_bp_cc_deps.json content error." 2020-01-16 00:20:40 +00:00
Sasha Smundak
6c2d4f91f8 Save compilation units in protobuf format.
Bug: 146224091
Test: manual
Change-Id: I7a856bab13f54c78efa0061421c3fcb9341bc6e7
2020-01-15 12:40:03 -08:00
Stephen Hines
fae236f4ee Default to pattern initialization for uninitialized variables.
Pattern initialization helps us make C++ safer, while not altering the
semantics/usage of C++ (as zero init does).

Bug: 131390872
Test: Local testing. Parts of CTS.
Change-Id: I9705ca3b724208647f0eab0a704f6f360206d482
2020-01-15 11:26:38 -08:00
Automerger Merge Worker
901c8e6287 Merge "Reland^2 "m <apex_name>-deps-info prints the internal/external deps of the APEX"" am: 814bebb8ea am: 8d050e8e6e am: a7c65b295e
Change-Id: Ib50d00c8cf7f1c6cefd17d9dfa51a4b45835236f
2020-01-15 06:44:21 +00:00
Vic Yang
8c38ecba01 vndkMustUseVendorVariant += libstagefright_bufferpool@2.0
Bug: 145157349
Test: Build success
Change-Id: Ic5f1699d034715545c53a8842ef14692f2017706
2020-01-14 22:39:37 -08:00
bralee
adba3c0a0a AIDEGen:fix module_bp_cc_deps.json content error.
Bug: 147324044
Test: 1. export SOONG_COLLECT_CC_DEPS=1 SOONG_GEN_CMAKEFILES=1;m nothing
         module_bp_cc_deps.json will be generated.
	 In module_bp_cc_deps.json,
	 "libui": {
             ...
             "system_include_flags": {
                 "header_search_path": [
                     "system/core/include",
                     "system/media/audio/include",
                     "hardware/libhardware/include",
                     "hardware/libhardware_legacy/include",
                     "hardware/ril/include",
                     "frameworks/native/include",
                     "frameworks/native/opengl/include",
                     "frameworks/av/include",
                     "libnativehelper/include_jni"
                 ]
                 "system_search_path": [
                     "bionic/libc/include",
                     "bionic/libc/kernel/uapi",
                     "bionic/libc/kernel/uapi/asm-x86",
                     "bionic/libc/kernel/android/scsi",
                     "bionic/libc/kernel/android/uapi"
                 ]
             },
             ...
         },

Change-Id: Iabc638ca451f568b2a4c09327f8f3c220f6fc154
2020-01-15 13:38:48 +08:00
Wei Wang
6c01618885 power: add stable aidl to VndkMustUseVendorVariantList
Bug: 146453294
Test: Build
Change-Id: I0e8e8ed425affa8103eff5aef74a7859341d0058
2020-01-14 17:32:56 -08:00
Jiyong Park
83dc74b770 Reland^2 "m <apex_name>-deps-info prints the internal/external deps of the APEX"
This reverts commit 7cb4d378e7.

Test: m
Test: ALLOW_MISSING_DEPENDENCIES=true DIST_DIR=out/dist ./art/tools/dist_linux_bionic.sh -j80 com.android.art.host
(in the master-art-host branch)

Change-Id: I9beca73aafdf42f03bfa19cf1634b2641dac417b
2020-01-14 18:40:56 +09:00
Automerger Merge Worker
17f7140e2f Merge "Revert "Reland "m <apex_name>-deps-info prints the internal/external deps of the APEX"""" am: a7503367cf am: 39ed342b9b am: 9651bdef91
Change-Id: I1b22374e4a5698f15576c6daf474e6797318feb9
2020-01-14 09:30:56 +00:00
Jiyong Park
a7503367cf Merge "Revert "Reland "m <apex_name>-deps-info prints the internal/external deps of the APEX"""" 2020-01-14 08:58:17 +00:00
Jiyong Park
7cb4d378e7 Revert "Reland "m <apex_name>-deps-info prints the internal/external deps of the APEX"""
This reverts commit 956305c61c.

Reason for revert: broke master-art-host branch
Exempt-From-Owner-Approval: reverting a bad change

Change-Id: Id7faed4ee85328c7c65847a3543ea9e67a3d50b3
2020-01-14 08:58:02 +00:00
Automerger Merge Worker
57414e4ad7 Merge "Reland "m <apex_name>-deps-info prints the internal/external deps of the APEX""" am: 17c51a4ff6 am: acf9d43674 am: 500fddf35c
Change-Id: I0a93edcbffafaa031959f520866041059e1dd760
2020-01-14 03:02:44 +00:00
Treehugger Robot
17c51a4ff6 Merge "Reland "m <apex_name>-deps-info prints the internal/external deps of the APEX""" 2020-01-14 02:40:42 +00:00
Automerger Merge Worker
5f70666484 Merge "A test cc module is installable even if it's not available for platform" am: eecf99ce66 am: 931f464856 am: 918864fa22
Change-Id: I3faf4756c989e38a975b36e168e9bd1dbd7af98a
2020-01-13 01:01:51 +00:00
Treehugger Robot
eecf99ce66 Merge "A test cc module is installable even if it's not available for platform" 2020-01-13 00:31:58 +00:00
Automerger Merge Worker
889f0a3d41 Merge "Sandbox soong_build by changing to root directory" am: ae7cddd5ad am: 70eefb570a am: 9280bf9474
Change-Id: I7d749bf12f039ca72bd59f4264082043f1f14fde
2020-01-11 07:34:02 +00:00
Colin Cross
988414c2cf Sandbox soong_build by changing to root directory
This relands I12a0f907753fefd1997ab8b4ea2ac331234093cf along with
a fix to blueprint for absolute paths.

Store the current working directory and then change to the root
directory so that all file accesses must go through helpers in
the android package that properly track dependencies.

Change-Id: I24ac485677aa102eec1a2521d16820da6ee1ae77
Fixes: 146437378
Test: m checkbuild
Test: m OUT_DIR=/tmp/out nothing
2020-01-11 01:11:46 +00:00
Automerger Merge Worker
8c02671d51 Merge "Revert "Sandbox soong_build by changing to root directory"" am: e734832d25 am: 408fab4d25 am: f84fe5fbd4
Change-Id: Iac451a70c28566f8413b2495e8ae8a24b80e2a2f
2020-01-10 22:31:07 +00:00
Peter Collingbourne
e5ba28648f build: Link the unwinder dynamically into platform and vendor binaries.
Instead of linking the unwinder statically into every binary, link it
dynamically, by exporting the symbols from libc.so. This has a number
of advantages:

- Reduces image size (system.img size decreases by 1.7MB on walleye-userdebug,
  and 1.2MB on crosshatch-userdebug).
- Allows us to easily change/upgrade the unwinder throughout the system,
  including vendor prebuilts.
- Allows code outside of libc++ to define custom personality routines.
  Previously, personality routines would call the unwinder routines in the
  local binary, which would cause problems with unwinders with global state
  (such as the libgcc unwinder) if the copy of the unwinder used for unwinding
  (normally libc++'s copy) were different from the copy linked against the
  personality routine.

Bug: 144430859
Change-Id: I3b2a4a3ee58c6777989f811e19a3aeb47c0945bd
2020-01-10 11:38:30 -08:00
Colin Cross
13e8cb9b4c Merge "Sandbox soong_build by changing to root directory" am: e35e961aa9 am: 856eff7fde
am: a2040fc892

Change-Id: I31d8b52f57f685bc69aab817d9b4eebcafaf78df
2020-01-10 11:14:39 -08:00
Colin Cross
47e4f9e1e8 Revert "Sandbox soong_build by changing to root directory"
This reverts commit 05c25ccb4a.

Reason for revert: broke absolute OUT_DIR
Bug: 146437378

Change-Id: I523ed79d40e1c1ef040212ba794a7a084abea75d
2020-01-10 18:51:04 +00:00
Colin Cross
05c25ccb4a Sandbox soong_build by changing to root directory
Store the current working directory and then change to the root
directory so that all file accesses must go through helpers in
the android package that properly track dependencies.

Fixes: 146437378
Test: m checkbuild
Change-Id: I12a0f907753fefd1997ab8b4ea2ac331234093cf
2020-01-09 14:19:46 -08:00
Jiyong Park
956305c61c Reland "m <apex_name>-deps-info prints the internal/external deps of the APEX""
This reverts commit 4513f703f9.

Bug: 1190898
Test: m
Test: EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true NATIVE_COVERAGE=true  m dist

Change-Id: I50fdccabb43e4751694db83ee451d388657257e0
2020-01-09 18:42:27 +09:00
Jiyong Park
fe9a43002e A test cc module is installable even if it's not available for platform
This change fixes a bug that test modules (cc_test or its sub types) are
unconditionally considered as non-installable if they are configured to
not available for platform. The rationale behind the decision was that
an APEX variant of a module doesn't need to be installed to the device
because the variant will anyway be included in the APEX. However, it's
wrong for test modules. They are not included in the APEX, but should be
installed to /data/nativetest*.

One might think that we need to make the tests available for the
platform (i.e. apex_available: ["//apex_available:platform"]). This
however doesn't work if the libraries that the tests should link against
are configured to be not available for the platform, which currently is
the case for the ART tests.

Bug: 146995717
Test: m
Change-Id: I51843f5b4ea0a418c64c63784347231590cd3c35
2020-01-09 13:20:34 +09:00
Automerger Merge Worker
322a4362cf Merge "Revert "m <apex_name>-deps-info prints the internal/external deps of the APEX"" am: 8ea6bc4a05 am: 8298e7fd87 am: e66dbf8734
Change-Id: I1c3842f9c40141cad8a23bc436ac6222857773d5
2020-01-09 02:48:12 +00:00
Jiyong Park
8ea6bc4a05 Merge "Revert "m <apex_name>-deps-info prints the internal/external deps of the APEX"" 2020-01-09 02:20:42 +00:00
Jiyong Park
4513f703f9 Revert "m <apex_name>-deps-info prints the internal/external deps of the APEX"
This reverts commit 114ff53f5e.

Reason for revert: broke cf_x86_phone-userdebug_coverage 

Change-Id: I7221fd0b0baee5407a7322240c170aef8e549e4d
2020-01-09 02:05:18 +00:00
Automerger Merge Worker
52d8fd07c4 Merge "m <apex_name>-deps-info prints the internal/external deps of the APEX" am: 573326a8ce am: ef9f93cfac am: 00cdc4a80f
Change-Id: Ie40197044f09140d14262cdf6a17aae1d3c6582e
2020-01-09 01:17:11 +00:00
Treehugger Robot
573326a8ce Merge "m <apex_name>-deps-info prints the internal/external deps of the APEX" 2020-01-09 00:44:13 +00:00
Vic Yang
d92090fb29 Emit LOCAL_CHECK_SAME_VNDK_VARIANTS
If a VNDK library does not require using different core and vendor
variants, emit LOCAL_CHECK_SAME_VNDK_VARIANTS so that the two variants
can be checked for identicalness.

Bug: 145157349
Test: With the corresponding change in build/make, remove libbinder
      from build/soong/cc/config/vndk.go and check a build fails
      even without TARGET_VNDK_USE_CORE_VARIANT set.

Change-Id: I7698edf9a24b0df150c0e4f7d8dd4926f053eee8
2020-01-08 14:44:38 -08:00
Automerger Merge Worker
9b27a19c30 Merge "Support sampling PGO profiles" am: 563e3a4f95 am: e8c2eb1f83 am: 88f36d7689
Change-Id: Ia3eccccbc267181971e9fae608d5f116004de38f
2020-01-07 22:56:03 +00:00
Steven Moreland
4b662e4d3b Merge "vibrator: use package as name" 2020-01-07 22:43:01 +00:00
Yi Kong
563e3a4f95 Merge "Support sampling PGO profiles" 2020-01-07 22:18:12 +00:00
Automerger Merge Worker
1ea5d14650 Merge "Pass auto_gen_config setting in Android.bp to makefile" am: 13f30ae38c am: 75b879c30b am: 458321b216
Change-Id: Iecd57fcaac4b7b3d70c99de73037ff4c5aea5cc6
2020-01-07 08:35:45 +00:00
Greg Kaiser
e4141abf92 Merge "vndkMustUseVendorVariantList += android.hardware.automotive.occupant_awareness" 2020-01-07 04:15:44 +00:00
Dan Shi
2468d015fe Pass auto_gen_config setting in Android.bp to makefile
Bug: none
Test: local test with fuzzy_fastboot
Change-Id: I2c62f6fb58737538ef9e1e9fcbe63e03dfa7ee91
2020-01-06 16:21:10 -08:00
Tim Joines
5af27903bd vndkMustUseVendorVariantList += android.hardware.automotive.occupant_awareness
aidl libs need to be differentiated because they explicitly set
different system/vendor stabilities.

Fixes: 147241051
Test: fixes build
Change-Id: I77c0b21816ff10e0642eccbea22a0dc556e94dca
2020-01-06 15:34:49 -08:00
Steven Moreland
9dbe4035ef vibrator: use package as name
In order to provide a more descriptive name, and to be consistent
with HIDL, the stable AIDL package names are switching from
vintf-vibrator format to the package format
(android.hardware.vibrator).

Bug: N/A
Test: all build time
Change-Id: Ie6580714c3d09c1f99808ca9f8dc7875487f1049
Merged-In: Ie6580714c3d09c1f99808ca9f8dc7875487f1049
2020-01-06 14:08:00 -08:00
Steven Moreland
8aca9025f3 vibrator: use package as name
In order to provide a more descriptive name, and to be consistent
with HIDL, the stable AIDL package names are switching from
vintf-vibrator format to the package format
(android.hardware.vibrator).

Bug: N/A
Test: all build time
Change-Id: Ie6580714c3d09c1f99808ca9f8dc7875487f1049
2020-01-06 13:41:24 -08:00
Steven Moreland
de0bac5e13 rebootescrow: use package as name
In order to provide a more descriptive name, and to be consistent
with HIDL, the stable AIDL package names are switching from
vintf-rebootescrow format to the package format
(android.hardware.rebootescrow).

Bug: N/A
Test: all build time
Change-Id: I76487b1a325cc4a4c26382cf553c2edf6c27389f
2020-01-06 13:22:03 -08:00
Yi Kong
0b9932164b Support sampling PGO profiles
Bug: 79161490
Test: build and flash with ETM generated sampling profile
Change-Id: I82bf61ebfc9f1a1c74a370f0421c46862dd470db
2020-01-02 16:21:03 -08:00
Jiyong Park
114ff53f5e m <apex_name>-deps-info prints the internal/external deps of the APEX
We need to have a way to see the list of modules that directly or
indirectly contribute to an APEX. People find it difficult to determine
whether a module is included in which APEXes because APEX tracks
indirect dependencies as well as direct dependencies. Therefore, just
looking at Android.bp for the APEX itself doesn't give the answer.

This change adds a new make target <apex_name>-deps-info, which
generates out/soong/<apex_name>-deps-info.txt file that shows the
internal and external dependencies of the said APEX.
Here, internal means the dependencies are actually part of the
APEX, while external means the dependencies are still external to the
APEX.

Bug: 146323213
Test: m (apex_test amended)
Change-Id: I33d1ccf5d1ca335d71cd6ced0f5f66b8c3886d13
2020-01-02 09:41:30 +09:00
Automerger Merge Worker
585928fc5d Restrict SdkMemberTypes that can be used with sdk/sdk_snapshot am: e602918294 am: b39c226ff7 am: 5f7e9a061b
Change-Id: I1b7d00af424d786c1f166f7d93776ff65278899e
2019-12-31 20:33:16 +00:00
Paul Duffin
e602918294 Restrict SdkMemberTypes that can be used with sdk/sdk_snapshot
By default SdkMemberTypes are only supported on module_exports module
type. Support for sdk module type has to be explicitly specified.

The java_header_libs, native_shared_libs and stubs_sources are
supported on sdk. The latter is required to provide the stubs source
for an API specified in java_header_libs as they should be kept in
sync.

Bug: 146341462
Test: m nothing
Change-Id: I19b9e60792780a797458d4a9e489506602b13144
2019-12-31 15:08:59 +00:00
Automerger Merge Worker
050828a12f Merge "AIDEGen: collect cc_srcs and cc related flags in module_bp_cc_deps.json" am: 0a6c8813ba am: 3f4ed419b6 am: 956fdb547a
Change-Id: Ia8a9b63a7aae4af3728dfacf1c30659a57939008
2019-12-31 01:36:57 +00:00
Automerger Merge Worker
6e87e730a8 Merge "Detach VNDK using core library list from VNDK APEX" am: 2c12207919 am: 1290b12a30 am: d389915493
Change-Id: I5d9a0650152fb00719f2b7ae07dbba38fd4f956d
2019-12-31 01:36:20 +00:00
Treehugger Robot
0a6c8813ba Merge "AIDEGen: collect cc_srcs and cc related flags in module_bp_cc_deps.json" 2019-12-31 01:16:35 +00:00
Kiyoung Kim
e1aa8ea34e Detach VNDK using core library list from VNDK APEX
Some devices require VNDK using core library list, but this is dependent
to system image rather than VNDK version. This change removes VNDK using
core variant library list file from VNDK APEX, and also remove VNDK
version from its filename.

Bug: 142599349
Test: m -j passed && aosp_cf_x86_go_phone booted
Change-Id: Ibc53b8dfc9d38e14bbaa878154034d25a6d34089
2019-12-30 14:29:52 +09:00
bralee
5a5cce695f AIDEGen: collect cc_srcs and cc related flags in module_bp_cc_deps.json
Define a field CCSrcs and other cc related flags in a type ccIdeInfo
struct and write them into out/soong/module_bp_cc_deps.json. AIDEGen
can use these data to generate CMakeLists.txt by Python for multiple
native projects in CLion IDE.

Bug: 141512319

Test: 1. export SOONG_COLLECT_JAVA_DEPS=false SOONG_COLLECT_CC_DEPS=true;m nothing
         check
	 1). File out/soong/module_bp_cc_deps.json is generated.
	 2). In "JniInvocation_test" module: "path", "srcs",
	     "global_common_flags", "local_common_flags",
	     "global_c_flags", "local_c_flags", "global_c_conly_flags",
	     "local_c_conly_flags", "global_cpp_flags",
	     "local_cpp_flags" and "system_include_flags"
	     have been created.

Change-Id: I9292cc6373157ba68f013998a7364f84a70d5593
2019-12-30 09:35:40 +08:00
Automerger Merge Worker
96b74db89c Merge "Create product variant for product partition" am: 727173ecca am: 31bfaff20f am: 0b9c91b0cf
Change-Id: I52c421066068f949a9fa60a7ab8857e7cf81751b
2019-12-21 01:30:12 +00:00
Treehugger Robot
727173ecca Merge "Create product variant for product partition" 2019-12-21 00:56:45 +00:00
Automerger Merge Worker
af0afa7c5d Differentiate between cc library and binary am: a0843f6a6f am: 62e6e00395 am: f4d042ac45
Change-Id: I82263af2452c78f6e1644645840073b109a3b07a
2019-12-20 18:35:54 +00:00
Automerger Merge Worker
399bf82141 Dedup cc library module type registration am: 6c26dc7392 am: 8b5ff4cabc am: 8531a59aed
Change-Id: Ic46577792f1db04742a24c30b6dc3e193e3dcc94
2019-12-20 18:35:49 +00:00
Paul Duffin
a0843f6a6f Differentiate between cc library and binary
The cc library and cc binary (and other cc module types) are all
instances of cc.Module. So, to differentiate between them and make
sure that only appropriate library instances can be added to
native_shared/static_libs this adds a special sdkMemberTypes field to
Module which if set specifies the SdkMemberTypes the module supports.
If it is not set then the module type cannot be used in the sdk at all.

Corrects an issue with one of the tests where a prebuilt cc
library was added to the sdk instead of a source cc library.

Adds a new test to ensure that cc_library_(shared|static)_host module
types work with the sdk as well and another test to ensure that
cc_library can be used as either.

Bug: 142918168
Test: m checkbuild
Change-Id: I359cdbdd15328ca571f276d2b6ce9a229ebb2c86
2019-12-20 15:45:17 +00:00
Paul Duffin
6c26dc7392 Dedup cc library module type registration
Test: m checkbuild
Bug: 146540677
Change-Id: I6685338550f587212e70f3eba8d4342b66f566e2
2019-12-20 15:22:52 +00:00
Justin Yun
5f7f7e8a39 Create product variant for product partition
When PRODUCT_PRODUCT_VNDK_VERSION is set to 'current', product
modules are enforced to use only VNDK libs from the system partition
as BOARD_VNDK_VERSION does to vendor partition.

Modules with 'vendor_available: true' create product variant as well
as core and vendor variants. The product variant as an image variant
is used for the modules in /product or /system/product.

It must not affect the current build behavior without
PRODUCT_PRODUCT_VNDK_VERSION set.

Bug: 134099726
Bug: 138966004
Bug: 144534640
Test: build without PRODUCT_PRODUCT_VNDK_VERSION set
Change-Id: I4d3585c110d84493e45bf76d550dc240bb26137f
2019-12-20 17:56:08 +09:00
Automerger Merge Worker
f779f44bc2 Merge "Generate Compdb file in the output directory" am: 076651765a am: d31cf9eda1 am: 2ce52dc457
Change-Id: I8d933fae674f298b532c6bcfec9c4df95570bf8f
2019-12-20 04:32:24 +00:00
Treehugger Robot
076651765a Merge "Generate Compdb file in the output directory" 2019-12-20 04:01:00 +00:00
Automerger Merge Worker
bb1ce92ed7 Merge "Dedup cc build components registration" am: 4565aba98c am: 60e17ae445 am: 7b59c5f316
Change-Id: I13e16f00844873614440fd4270f7023271df1caa
2019-12-20 02:50:52 +00:00
Automerger Merge Worker
15461e8216 Merge "Improve cc tests by adding fuzzer mutators" am: de85fa9f5f am: c2acb75a92 am: d4ab3052ff
Change-Id: I4fb978543a4985587762892304c73f1c62de613a
2019-12-20 02:50:37 +00:00
Automerger Merge Worker
4e965ebbce Merge "Improve cc tests by adding sanitizer mutators" am: 7d211f1793 am: 152b5f8675 am: 5b91dc8d39
Change-Id: Ife351bc2628c32e7473ead96097b6ebd325604ec
2019-12-20 02:50:24 +00:00
Automerger Merge Worker
504b300fc6 Merge "Dedup prebuilt mutator registration" am: 82f4f99780 am: 849e8f7509 am: e05577b9a8
Change-Id: I094959ab23674cafcc40455f5ea1c062085c75f1
2019-12-20 02:50:06 +00:00
Automerger Merge Worker
598e0885e7 Merge "Dedup registration for cc default test config" am: 24de9ea201 am: 6da6395f16 am: 1971acf840
Change-Id: Iff72ebfc46ba03e5b9a26ba04e6810f720747bc7
2019-12-20 02:48:49 +00:00
Treehugger Robot
4565aba98c Merge "Dedup cc build components registration" 2019-12-20 01:27:00 +00:00
Treehugger Robot
de85fa9f5f Merge "Improve cc tests by adding fuzzer mutators" 2019-12-20 01:26:01 +00:00
Treehugger Robot
7d211f1793 Merge "Improve cc tests by adding sanitizer mutators" 2019-12-20 01:25:56 +00:00
Treehugger Robot
82f4f99780 Merge "Dedup prebuilt mutator registration" 2019-12-20 01:25:51 +00:00
Treehugger Robot
24de9ea201 Merge "Dedup registration for cc default test config" 2019-12-20 01:25:42 +00:00
Changyeon Jo
96279252d7 Generate Compdb file in the output directory
This change modifies the location of generated compdb file from
$ANDROID_BUILD_TOP to where compdbOtuputProjectsDirectory points to,
under $OUT_DIR.  This is especially required for the build environment
that maps $ANDROID_BUILD_TOP as read-only, such as Gitc.

Test: m SOONG_GEN_COMPDB=1 nothing
      examine generated compile_commands.json
Signed-off-by: Changyeon Jo <changyeon@google.com>

Change-Id: I86700f89b613a443a33982ecd5501b0f68a62be7
2019-12-20 00:10:02 +00:00
Automerger Merge Worker
0662e65654 Merge changes I7e9440a0,I7f1a4b64,If5d6fdac am: b237de1914 am: ab879385eb am: 396fd80826
Change-Id: I96741af41ba539d783787abc0b79f82caef2e5d4
2019-12-19 23:37:41 +00:00
Treehugger Robot
b237de1914 Merge changes I7e9440a0,I7f1a4b64,If5d6fdac
* changes:
  Dedup cc prebuilts module type registration
  Detect registration of duplicate module/singleton types
  Dedup prebuilt apis module type/mutator registration
2019-12-19 22:43:02 +00:00
Automerger Merge Worker
ddb6485b64 Merge "Adding capability to granular disable of fuzzer" am: 5c5cc67ee2 am: c2887f9e28 am: 9a00444e75
Change-Id: I7465458b6cd9c131971779eeb9007610a60c99b3
2019-12-19 20:41:11 +00:00
Hamzeh Zawawy
5c5cc67ee2 Merge "Adding capability to granular disable of fuzzer" 2019-12-19 19:54:07 +00:00
Paul Duffin
036e7001ae Dedup cc build components registration
Effectively adds the cc_defaults module type to the set that are
registered for tests that rely on cc default deps so needed to remove
a few references of that.

Test: m checkbuild
Bug: 146540677
Change-Id: I9df3d33a0cf3f6b22d270efed8366d0183eccaec
2019-12-19 19:19:40 +00:00
Paul Duffin
075c417837 Improve cc tests by adding fuzzer mutators
This fixes an issue that arises when deduping cc build component
registration code.

The fuzzer and fuzzer_deps post deps mutators were not previously
added when running cc tests. That meant the tests were not actually
testing the same behavior as at runtime.

Adding the mutators breaks the TestFuzzTarget test as the mutator
changes the variant of the fuzz_smoke_test that is created and so the
test fails to find it.

This fixes the test by correct the variant name.

Test: m checkbuild
Bug: 146540677
Change-Id: I9d2be0023affb7722f0399663fa18a2a5fb610d8
2019-12-19 19:19:40 +00:00
Paul Duffin
d686791c16 Improve cc tests by adding sanitizer mutators
This fixes an issue that arises when deduping cc build component
registration code.

The sanitize_runtime_deps and sanitize_runtime post deps mutators were
not previously added when running cc tests. That meant the tests were
not actually testing the same behavior as at runtime.

Adding the mutators breaks the TestFuzzTarget test as the mutator adds
libclang_rt.ubsan_standalone-aarch64-android as a dependency of libc++
and the former is not available.

This fixes the test by adding the missing dependency as a cc prebuilt
shared library.

Test: m checkbuild
Bug: 146540677
Change-Id: Ie13c7e6fcefef7d9cb1cc5364be3dc563ce40de5
2019-12-19 19:19:40 +00:00
Paul Duffin
0c4979bbdf Dedup prebuilt mutator registration
Test: m checkbuild
Bug: 146540677
Change-Id: I9f8a11adf61fe6f352ec1eabc7c5bac332348ba2
2019-12-19 19:19:40 +00:00
Paul Duffin
77980a8bb9 Dedup registration for cc default test config
The cc.GatherRequiredDepsForTest() method returns some default module
definitions that are required when using cc module types like
cc_library. Previously, the registration of the module types and
mutators needed to process those default definitions was duplicated
in the test config initialization.

This change removes that duplicated code and replaces it with calls
to cc.RegisterRequiredBuildComponentsForTest(ctx) which registers all
the required build components.

Test: m checkbuild
Bug: 146540677
Change-Id: I80b6913c5691ff164ce9d308b9e1da24940f2d42
2019-12-19 19:19:40 +00:00
Paul Duffin
59986b23cc Dedup cc prebuilts module type registration
Test: m checkbuild
Bug: 146540677
Change-Id: I7e9440a075ef9c683729ed83e0033ab529fe4ac0
2019-12-19 19:19:40 +00:00
Automerger Merge Worker
b47c56b232 Merge "Create public stub for platform's sysprop_library" am: 0cbb31e9e7 am: c044c0f713 am: a9ee40b723
Change-Id: Ic4c49427f484d0d23f01bd8dc3078b9d14cf1263
2019-12-19 03:51:44 +00:00
Treehugger Robot
0cbb31e9e7 Merge "Create public stub for platform's sysprop_library" 2019-12-19 03:23:01 +00:00
Inseob Kim
ac1e986c55 Create public stub for platform's sysprop_library
Java modules using SystemAPI can now link against platform owned
sysprop_library with public stub. This allows modules to use platform's
public sysprops (which should be regarded as an API) without any hidden
API usages, if using dynamic linking and boot class path.

This doesn't affect any vendor or odm owned sysprop_library.

Bug: 141246285
Bug: 145167888
Test: m
Change-Id: I99824fb24a75cc8282211c2ad6c6296ae9fca393
2019-12-19 09:35:23 +09:00
Automerger Merge Worker
0f6a89ae9b Merge "Reland "Also package recursive jni_libs deps of android_apps as well as direct deps." with bug fix." am: ddd27246ee am: d7d6b17706 am: 57ae4e4328
Change-Id: I662411bbddca40103098e17db6226acc8aa8596e
2019-12-18 23:54:12 +00:00
Automerger Merge Worker
e7a323d22a Merge "Don't create native bridge variants of vendor modules" am: 0bfb9e8d9b am: 27ba444ad3 am: 60184e2703
Change-Id: I0b11c91ce9ec9ff7b76294f9852a8e82e2c8219f
2019-12-18 23:53:42 +00:00
Peter Collingbourne
ddd27246ee Merge "Reland "Also package recursive jni_libs deps of android_apps as well as direct deps." with bug fix." 2019-12-18 23:29:58 +00:00
Colin Cross
0bfb9e8d9b Merge "Don't create native bridge variants of vendor modules" 2019-12-18 23:16:04 +00:00
Kenny Root
bfe4b1862d vndkMustUseVendorVariantList += vintf-rebootescrow
TARGET_VNDK_USE_CORE_VARIANT devices explicitly track libs which are
differentiated between system/vendor. b/145157349 is filed to try to
catch these errors during normal builds (or in presubmit).

aidl libs need to be differentiated because they explicitly set
different system/vendor stabilities.

Fixes: 146513281
Test: fixes build
Change-Id: I0a56d67bfd035a4438d05d5c983c47de8234dc3b
2019-12-18 14:49:44 -08:00
hamzeh
3478a0d8a0 Adding capability to granular disable of fuzzer
This change is to add granularity for disabling
of the fuzzer from running on host, device or both.

Bug: 145824604
Test: make haiku successfully completes after change
Change-Id: I686b439e36c622108f7b5b3e3f4738b8295320a7
2019-12-18 13:58:59 -08:00
Automerger Merge Worker
36b002fe57 Move filesystem into Config am: 98be1bb00f am: a6f8134501 am: e33aec3174
Change-Id: I67f36b86dccf922c6d3648890edce51117c91a9e
2019-12-18 20:18:27 +00:00
Colin Cross
83bead469b Don't create native bridge variants of vendor modules
The logic in cc.Module.ImageMutatorBegin() to skip creating vendor
variants for native bridge modules stopped working when the image
mutator was moved before the arch mutator because the native
bridge variant hadn't been created yet.  Move the logic to the arch
mutator to avoid creating native bridge variants for vendor variants.

Fixes: 146486214
Test: lunch aosp_cf_x86_pasan-userdebug && m SANITIZE_TARGET=address
Change-Id: I46cff4905f929c9989d005f0ceb01388d47323c1
2019-12-18 10:45:46 -08:00
Colin Cross
98be1bb00f Move filesystem into Config
The filesystem object was available through ModuleContext.Fs(), but
gives too much access to the filesystem without enforicing correct
dependencies.  In order to support sandboxing the soong_build
process move the filesystem into the Config.  The next change will
make it private.

Bug: 146437378
Test: all Soong tests
Change-Id: I5d3ae9108f120fd335b21efd612aefa078378813
2019-12-18 08:19:10 -08:00
Treehugger Robot
572aeed6a4 Merge "Move imageMutator before archMutator" 2019-12-18 02:34:36 +00:00
Peter Collingbourne
ad84f975d2 Reland "Also package recursive jni_libs deps of android_apps as well as direct deps." with bug fix.
This time, exclude NDK libraries instead of LLNDK libraries from the
package. This is necessary because there are libraries such as libvndksupport
which are LLNDK but are not accessible to apps.

Original commit message:
> Previously, android_app targets for which a.shouldEmbedJnis(ctx) = true
> (e.g. CtsSelinuxTargetSdk25TestCases) would need to specify all of their
> recursive library dependencies, including for example libc++ when depending
> on the platform libc++. This means unnecessary churn when we add a new
> dependency to libc++ (e.g. libunwind [1]). To avoid the churn and allow
> jni_libs clauses to be simplified, make the build system search for the
> recursive dependencies and automatically include them.
>
> This change allows us to remove code that was previously adding NDK libc++
> as a special case, as it is now covered by the generic code.
>
> Also fix some improper quoting that was exposed as a result of this change
> causing more files to be packaged than before.
>
> [1] https://android-review.googlesource.com/q/topic:%22libunwind-so%22

Bug: 144430859
Test: atest CtsAppOpsTestCases
Test: atest FrameworksNetSmokeTests
Change-Id: I8311ede0b44d7e50b9f272912ead8ef07e82b074
2019-12-17 16:55:20 -08:00
Automerger Merge Worker
d4fc98eba3 Merge "Revert "Also package recursive jni_libs deps of android_apps as well as direct deps."" am: 9fd9b92d51 am: 91ef43f39e am: b9f21634ea
Change-Id: I8a7191c050535882bbcbb9bad0141b31ef3abfb6
2019-12-18 00:43:36 +00:00
Lorenzo Colitti
2973c1106f Revert "Also package recursive jni_libs deps of android_apps as well as direct deps."
This reverts commit 6f907ad3dd.

Reason for revert: Broke FrameworksNetSmokeTests

Bug: 146456945
Change-Id: Ibef7bb80c532e70cfcfb974f51a99ed25437a343
2019-12-18 00:15:07 +00:00
Colin Cross
fb0c16e95a Move imageMutator before archMutator
Run the imageMutator between osMutator and archMutator so that
different arch variants can be set for the different partitions.

Bug: 142286466
Test: m checkbuild
Change-Id: I65d05714b75aa462bf9816da60fdc2deda4de593
Merged-In: I65d05714b75aa462bf9816da60fdc2deda4de593
(cherry picked from commit 9c8f687584)
2019-12-17 14:45:11 -08:00
Automerger Merge Worker
7356dee847 Merge "Also package recursive jni_libs deps of android_apps as well as direct deps." am: ff8cb1e69e am: d6800751c7 am: d10be18767
Change-Id: I5728e95988e46f10fd8a5c7d108b6679fa33f53a
2019-12-17 21:24:55 +00:00
Colin Cross
9c8f687584 Move imageMutator before archMutator
Run the imageMutator between osMutator and archMutator so that
different arch variants can be set for the different partitions.

Bug: 142286466
Test: m checkbuild
Change-Id: I65d05714b75aa462bf9816da60fdc2deda4de593
2019-12-17 11:16:37 -08:00
Peter Collingbourne
6f907ad3dd Also package recursive jni_libs deps of android_apps as well as direct deps.
Previously, android_app targets for which a.shouldEmbedJnis(ctx) = true
(e.g. CtsSelinuxTargetSdk25TestCases) would need to specify all of their
recursive library dependencies, including for example libc++ when depending
on the platform libc++. This means unnecessary churn when we add a new
dependency to libc++ (e.g. libunwind [1]). To avoid the churn and allow
jni_libs clauses to be simplified, make the build system search for the
recursive dependencies and automatically include them.

This change allows us to remove code that was previously adding NDK libc++
as a special case, as it is now covered by the generic code.

Also fix some improper quoting that was exposed as a result of this change
causing more files to be packaged than before.

[1] https://android-review.googlesource.com/q/topic:%22libunwind-so%22

Bug: 144430859
Change-Id: I3d6fbcce75bc108a982eb7483992a4b202056339
2019-12-16 15:20:09 -08:00
Automerger Merge Worker
9fc4b42dc8 Merge "Add $ORIGIN to fuzzer-coverage sanitized .so's." am: a1682631eb am: 630f2d4caf am: 50a9cadcf4
Change-Id: I65e2db8c383a398d9cd14da0f29ca14762c89bcd
2019-12-16 21:37:28 +00:00
Automerger Merge Worker
95747ac10b Merge changes from topic "separate_code" am: 894cdee30a am: 7346c709e2 am: a923639223
Change-Id: I65b77b31c770382abf7002a90e111a3ffe25e35a
2019-12-16 21:36:54 +00:00
Automerger Merge Worker
67eebe6442 Revert "Revert "soong: upgrade Android platform to clang-r370808"" am: eb20744361 am: c2e2dce120 am: 1ae7cbd085
Change-Id: I9582942220289d30dc21afddaeb477dd67732b80
2019-12-16 21:36:52 +00:00
Nick Desaulniers
c2e2dce120 Revert "Revert "soong: upgrade Android platform to clang-r370808""
am: eb20744361

Change-Id: Ia0c47b43fcb53da68caf6496fb2a421c74581a02
2019-12-16 13:20:15 -08:00
Mitch Phillips
a1682631eb Merge "Add $ORIGIN to fuzzer-coverage sanitized .so's." 2019-12-16 21:17:03 +00:00
Nick Desaulniers
894cdee30a Merge changes from topic "separate_code"
* changes:
  soong: use -Wl,-z,separate-code w/ -Wl,--execute-only
  Revert "Revert "soong: upgrade Android platform to clang-r370808""
2019-12-16 21:13:28 +00:00
Treehugger Robot
bd0624304e Merge "Use empty string for core image variant" 2019-12-16 20:54:32 +00:00
Nick Desaulniers
dcee1e5c54 soong: use -Wl,-z,separate-code w/ -Wl,--execute-only
The clang-r370808 upgrade contains a change to LLD allow PT_LOAD
segments to reside at non-multiples of the page size in the resulting
object file.  https://reviews.llvm.org/rL369344

While this helps reduce the alignment waste and resulting image size, it
has interesting implications for execute only memory (XOM): The runtime
loader will now load code or data from other segments into pages with
different protections than intended.

This would partially defeat execute only (XOM) text sections as the
segment could now overlap with previous and following sections. This
might allow for code or data from the preceding and following sections
(like .eh_frame, and .data.rel.ro) to be executable, and either ends of
.text to be readable.

When the runtime loader (linker[64]) `mmap`s segments from *.so files,
the file offset parameter (see `man 2 mmap`) MUST be a multiple of the
page size.  Since the updated LLD can now pack segments in a file (which
helps minimize resulting object file size) (previously, the segment
offsets were page aligned), this has interesting implications.

To appreciate the current bug, consider the following output from
`readelf` before this patch is applied, but after the toolchain upgrade:

```
$ readelf -lSW $OUT/symbols/apex/com.android.runtime/lib64/bionic/libc.so
...
  [Nr] Name              Type            Address          Off    Size   ES Flg Lk Inf Al
...
  [13] .eh_frame         PROGBITS        000000000002e7c0 02e7c0 013374 00   A  0   0  8
  [14] .text             PROGBITS        0000000000042b40 041b40 09ecb4 00  AX  0   0 64
  [15] .plt              PROGBITS        00000000000e1800 0e0800 001f30 00  AX  0   0 16
  [16] .data.rel.ro      PROGBITS        00000000000e4740 0e2740 005208 00  WA  0   0 32
...
  Type           Offset   VirtAddr           PhysAddr           FileSiz  MemSiz   Flg Align
  PHDR           0x000040 0x0000000000000040 0x0000000000000040 0x000230 0x000230 R   0x8
  LOAD           0x000000 0x0000000000000000 0x0000000000000000 0x041b34 0x041b34 R   0x1000
  LOAD           0x041b40 0x0000000000042b40 0x0000000000042b40 0x0a0bf0 0x0a0bf0   E 0x1000
  LOAD           0x0e2740 0x00000000000e4740 0x00000000000e4740 0x006720 0x006720 RW  0x1000
...
   01     .note.android.ident .note.gnu.build-id .dynsym .gnu.version .gnu.version_d .gnu.version_r .gnu.hash .dynstr .rela.dyn .rela.plt .rodata .eh_frame_hdr .eh_frame
   02     .text .plt
   03     .data.rel.ro .fini_array .init_array .dynamic .got .got.plt
...

The above output tells us:
1. .text will wind up in the third (02) segment.
2. The third segment will be (LOAD)'ed as (E)xecutable.
3. Because the file (Offset) of the first segment (0x41b40) is NOT a
   multiple of the page size, it cannot be passed as the `offset` to
   `mmap`. As such it will be rounded down to the first multiple of the
   page size, 0x41000.
4. The preceding section (.eh_frame) will be loaded in the preceding
   segment (01). It occupies file (Off)set range [(0x2e7c0):0x41b34].
   0x41b34 is not explicit in the output, instead you must use the
   formula:
     Off     + Size    == End
   ie.
     0x2e7c0 + 0x13374 == 0x41b34
   (This happens to match (FileSiz) of the second segment, which makes
   sense as .eh_frame is the final section in the second segment.)
5. mmap'ing file offset 0x41000 when loading the second segment will
   include 0x4c0 bytes (0x42000 - 0x41b40) from .text, now mapped as
   readable (oops). Suddenly code from .text is now readable (and thus
   scannable for gadgets for ROP chains).
6. mmap'ing file offset 0x41000 when loading the third segment will
   include 0xb34 bytes (0x41b34 - 0x41000) from .eh_frame, now mapped as
   executable (oops). Suddenly data from .eh_frame is now executable
   (and thus a potential gadget for ROP chains).
7. mmap'ing file offset 0xe2000 when loading the third segment will
   include 0x8CO bytes (0xe3000 - 0xe2740) from .data.rel.ro, now mapped
   as executable (oops). Suddenly data from .data.rel.ro is now
   executable (and thus a potential gadget for ROP chains).
8. mmap'ing file offset 0xe2000 when loading the fourth segment will
   include 0x730 bytes (0xe0800 + 0x1f30 - 0xe2000) from .plt, now
   mapped as readable (oops). Suddenly data from .plt is now readable
   (and thus scannable for gadgets for ROP chains).

All these oops' could be avoided if the linker placed .text+.plt at page
size aligned file offsets, which is what `-Wl,-z,separate-code` code
does.  After this patch, we have:

```
$ readelf -lSW $OUT/symbols/apex/com.android.runtime/lib64/bionic/libc.so
...
  Type           Offset   VirtAddr           PhysAddr           FileSiz  MemSiz   Flg Align
  PHDR           0x000040 0x0000000000000040 0x0000000000000040 0x000230 0x000230 R   0x8
  LOAD           0x000000 0x0000000000000000 0x0000000000000000 0x041b34 0x041b34 R   0x1000
  LOAD           0x042000 0x0000000000042000 0x0000000000042000 0x0a0be0 0x0a0be0   E 0x1000
  LOAD           0x0e3000 0x00000000000e3000 0x00000000000e3000 0x006720 0x006720 RW  0x1000
```

In the future, we could go back to tightly packing segments in the
binary if the runtime loader was improved to detect the previously
stated problem, and `memset` over the problematic ranges of the freshly
`mmap`ed pages (implying additional startup cost for reduced binary
size). This might save ~6 KB from each native binary, which adds up to
~17 MB for an AOSP image.

Also, prefer
-Wl,--execute-only
rather than
-Wl,-execute-only

Bug: 139945549
Bug: 146144180
Test: readelf -lSW $OUT/symbols/apex/com.android.runtime/lib64/bionic/libc.so
Change-Id: I64527e034ca3c71565ea52ed06f81f75d5216627
Reported-by: Ryan Prichard <rprichard@google.com>
Suggested-by: Fangrui Song <maskray@google.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
2019-12-16 09:55:37 -08:00
Automerger Merge Worker
3bb231d4a5 Merge "Decouple addition of new sdk member types from sdk code" am: 0558ecce51 am: d32b891ff3 am: b0a704e865
Change-Id: Id0f8ca132ef2221cce3f4449babfa480e7c9a1fc
2019-12-14 15:22:27 +00:00
Colin Cross
7113d20774 Use empty string for core image variant
Use the empty string for the core image variant so that modules
added to imageMutator do not change their build directory.

Bug: 142286466
Test: m checkbuild
Change-Id: Ida4534d9a4d6176236aaa480fed359ce27acfaa1
Merged-In: Ida4534d9a4d6176236aaa480fed359ce27acfaa1
(cherry picked from commit 72d685ee7f45e5393be44ae4159edf083ac918de)
2019-12-13 20:44:36 -08:00
TreeHugger Robot
8f67bfe0a7 Merge "Use empty string for core image variant" 2019-12-14 02:57:38 +00:00
Automerger Merge Worker
1297e10a55 Merge "Separate sdk membership support out of cc/library.go" am: edb4e21de5 am: 260f9a212f am: 3b49c9c6ba
Change-Id: I28cbbf54aca52e73d9073d4e5004ab5b86b595a9
2019-12-13 22:44:08 +00:00
Colin Cross
7d114b28e6 Use empty string for core image variant
Use the empty string for the core image variant so that modules
added to imageMutator do not change their build directory.

Bug: 142286466
Test: m checkbuild
Change-Id: Ida4534d9a4d6176236aaa480fed359ce27acfaa1
2019-12-13 13:13:57 -08:00
Nick Desaulniers
eb20744361 Revert "Revert "soong: upgrade Android platform to clang-r370808""
This reverts commit 862eb4648a.

Re-upgrades the compiler to clang-r370808, after first dealing with
regressions in ndk_translate and execute only pages.

Bug: 139945549
Bug: 145807809
Bug: 145827049
Bug: 145825270
Test: atest \
  CtsSelinuxTargetSdk27TestCases:android.security.SELinuxTargetSdkTest#testNoExecuteOnly
Test: m ndk_translation_host_unit_tests && \
  ./out/host/linux-x86/nativetest/ndk_translation_host_unit_tests/ndk_translation_host_unit_tests
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Change-Id: I714b582faffa8c92384818a7b12338d621968548
2019-12-13 13:13:06 -08:00
Paul Duffin
255f18e584 Decouple addition of new sdk member types from sdk code
Previously, adding a new SdkMemberType would require adding a new
sdkMemberListProperty instance to the sdkMemberListProperties as well
as adding a new property into the sdkProperties struct. They are
potential sources of conflict and couple the sdk code with all the
packages that add members to it. This change switched to a
registration model that allows each package to register its sdk
member types decoupling them from the sdk code.

Adds an SdkPropertyName() method to SdkMemberType that specifies the
name of the property to use in the sdk/sdk_snapshot. Also provides
an SdkMemberTypeBase struct to be used by providers of SdkMemberType
implementations.

SdkMemberType instances are registered using the
RegisterSdkMemberType() func which sorts the registered instances
by their SdkPropertyName() to ensure the behavior is consistent and
not affected by order of registration.

When creating a new sdk module a dynamicSdkMemberTypes instance is
created that contains the following:

* A properties struct is created dynamically that contains a field for
  each registered SdkMemberType, corresponding to that type's
  SdkPropertyName().

* A list of sdkMemberListProperty instances is also created, one for
  each registered SdkMemberType.

The dynamicSdkMemberTypes instance is cached using a key that uniquely
identifies the set of registered types just in case new types are
registered after one has been created, e.g. by tests.

Bug: 142918168
Test: m checkbuild
Change-Id: I4bf2bf56a2a49025aa41454048bc1e8ccc6baca2
2019-12-13 20:07:33 +00:00
Automerger Merge Worker
654e9f2850 Improve handling of generated include dirs am: 57b9e1da75 am: 8f2425e6b4 am: 8ec1ad6abc
Change-Id: I1c05439e657e92cf5e77f581800c229814214742
2019-12-13 12:26:33 +00:00
Automerger Merge Worker
9a47164f81 Generalize common property extraction am: a7cd8c8344 am: d54bbb878c am: dcfcf40d2c
Change-Id: Ia52cd0891729230eb83e39b3d6719eb95a7a879f
2019-12-13 12:26:28 +00:00
Paul Duffin
2f6bc09fee Separate sdk membership support out of cc/library.go
Bug: 142918168
Test: m checkbuild
Change-Id: I4a7f2af8e0b41feca2b5a431b42ad03bbfe94b0c
2019-12-13 10:43:10 +00:00
Paul Duffin
57b9e1da75 Improve handling of generated include dirs
The exported include dirs includes both source and generated
directories (e.g. containing aidl generated headers). The latter are
always arch specific so if they are present they make all the include
directories arch specific.

This change separates the source and generated include dirs so that
the source include dirs (which are probably not arch specific) can be
optimized separately from the arch specific generated include dirs.

The FilterPathList() func was refactored to extract the more general
FilterPathListPredicate() func.

A number of tests needed to be updated to reflect the more optimal
snapshot creation.

Bug: 142918168
Test: m checkbuild
Change-Id: Id1a23d35a45b250ae2168834f9c2a65c86a5fd77
2019-12-13 09:59:48 +00:00
Paul Duffin
a7cd8c8344 Generalize common property extraction
Previously, code that attempted to optimize the generated .bp rules
treated the properties structure as a single entity. So, a single arch
specific value would cause all properties to be treated as arch
specific. Also, that code was specific to one structure type.

This generalizes the optimization to work with any properties structure
which will be helpful for other multi-variant module types. It also
treats each property separately.

The hasArchSpecificFlags field has been removed from nativeLibInfo and
a commonProperties field has been added instead into which the common
values will be found. File path creation that conditionally prefixed a
path with archType has been replaced with general code that relies on
archType being "" for common properties and filepath.Join(..) ignoring
empty string components.

The common and arch variant properties are always processed. The first
within the context of the .bp module's property set and the latter
within an arch specific property set. There are always some properties
that are arch specific, e.g. outputFile, so there is no need to worry
about an empty arch property set being created.

The archSpecificNativeLibInfo type was renamed nativeLibInfoProperties
as it may not be arch specific.

The printExportedDirCopyCommandsForNativeLibs variable was renamed to
addExportedDirCopyCommandsForNativeLibs as it no longer does any
printing.

Bug: 142918168
Test: m checkbuild
Change-Id: Iad45913299c37fd76fe03ed0ca68bdc68ed76431
2019-12-13 09:59:48 +00:00
Automerger Merge Worker
262c0598b0 Merge "Expose some factories for aidl_test.go" am: cf96a82fbd am: a8c5109aee am: ba2fb913ac
Change-Id: I6de18a8eb306e81af0aaf389bdbdd855cb5043ac
2019-12-13 06:41:40 +00:00
Treehugger Robot
cf96a82fbd Merge "Expose some factories for aidl_test.go" 2019-12-13 05:51:38 +00:00
Automerger Merge Worker
03091dc5eb Added support for using static libraries in sdk snapshot am: 9ab556fd8e am: 5a1b8920f2 am: 2075b54fd5
Change-Id: Ic21b9a032a18cc752598b5fbc8f7ac54896a6826
2019-12-12 14:45:54 +00:00
Automerger Merge Worker
dc2db7cf20 Dedup prebuilt cc library creation am: ac6e608da7 am: eb66f93eea am: 1c723d3e21
Change-Id: I61b497048bb341af8918e62558225f76fc31607b
2019-12-12 14:45:43 +00:00
Paul Duffin
9ab556fd8e Added support for using static libraries in sdk snapshot
Parameterized the cc.librarySdkMemberType to allow it to support
both static and shared libraries. Created two instances, one for shared
and one for static libraries. A follow up change will add support for
libraries that can be both.

Added *librarySdkMemberType to nativeMemberInfo as information from
there is needed when generating the snapshot.

Made organizeVariants() func a method of *librarySdkMemberType so that
it can initialize the new field. Moved it to be with all the other
methods of that type.

Added host and device tests for the new module type.

Bug: 142918168
Test: m nothing
Change-Id: I00b1e8424b9d81f7d15edc4883971d10668ec2cc
2019-12-12 11:37:39 +00:00
Paul Duffin
ac6e608da7 Dedup prebuilt cc library creation
Bug: 142918168
Test: m checkbuild
Change-Id: I82cf3b098f024a6ab0884642b21b2238864942a2
2019-12-12 11:37:39 +00:00
Automerger Merge Worker
7000b33b2e Merge "AndroidMkEntries() returns multiple AndroidMkEntries structs" am: 8ce3c2c8df am: aefa4ba9d0 am: c9313f217b
Change-Id: Id9928fa3016190d92d41cfd8ee5f3589600e95c9
2019-12-12 04:08:03 +00:00
Treehugger Robot
8ce3c2c8df Merge "AndroidMkEntries() returns multiple AndroidMkEntries structs" 2019-12-12 03:23:06 +00:00
Automerger Merge Worker
d1a083beb9 Merge "cc_fuzz: add "data" field" am: 3606b00176 am: e6f58d4a61 am: 7fac7783c9
Change-Id: If5ecfe75959c19baba2a7355791d7bbc5b8dacae
2019-12-11 23:48:50 +00:00
Tri Vo
3606b00176 Merge "cc_fuzz: add "data" field" 2019-12-11 23:04:57 +00:00
Jiyong Park
0b0e1b9804 AndroidMkEntries() returns multiple AndroidMkEntries structs
AndroidMkEntries now returns multiple AndroidMkEntires so that a module
can emit multiple Make modules if needed.

Bug: 128708192
Test: m

Change-Id: I56b6f76d22943b80329951c5acb80a1b932441ad
2019-12-11 17:25:27 +09:00
Automerger Merge Worker
e612b4f709 Merge "Run ABI checks for shared libs exported by APEX" am: e87dae6083 am: 0fa84ea03c am: 89f3650141
Change-Id: I224f3e3b95e66ce7636af09c233997e6569100fe
2019-12-10 18:17:50 +00:00
Logan Chien
e87dae6083 Merge "Run ABI checks for shared libs exported by APEX" 2019-12-10 17:36:55 +00:00
Mitch Phillips
734b4cb62f Add $ORIGIN to fuzzer-coverage sanitized .so's.
Build fuzzer-sanitized libraries with an $ORIGIN DT_RUNPATH. Android's linker
uses DT_RUNPATH, not DT_RPATH. When we deploy cc_fuzz targets and their
libraries to /data/fuzz/<arch>/lib, any transient shared library gets the
DT_RUNPATH from the shared library above it, and not the executable, meaning
that the lookup falls back to the system. Adding the $ORIGIN to the DT_RUNPATH
here means that transient shared libraries can be found colocated with their
parents.

This may have some interesting consequences if:

 1. Your fuzz target depends on a shared library which has `sanitize.fuzzer:
 false` (as the DT_RUNPATH won't have `$ORIGIN`, and so you may get missing
 libraries).
 2. A `SANITIZE_TARGET=fuzzer` platform has a shared object in two
 different directories (like system vs. ndk) and is depending on the linker
 implementation details to resolve this in some manner.

I don't believe either of these instances should reasonably happen in
practise.

Fixes: 145973404
Fixes: 145988908
Test: m example_fuzzer
Change-Id: I94cbf628fc1ce15c43283d72bdabd9817de1fef8
2019-12-10 17:35:55 +00:00
Oliver Nguyen
1382ab6d31 Add coverage flags for Clang coverage builds.
Bug: 143977934
Test: m CLANG_COVERAGE=true
Test: m NATIVE_COVERAGE=true
Change-Id: I5d07d336e241856961eb0bc9678fdc9d5a076802
2019-12-09 16:35:15 -08:00
Andrew Chant
4b8d14df54 Merge "Revert "soong: upgrade Android platform to clang-r370808"" am: ed75f18e25 am: 26f8210a88
am: 7bc59d3d19

Change-Id: I9db811783b85f3bfc4747a1047d954d59b4ed060
2019-12-09 16:23:02 -08:00
Martin Stjernholm
213d6533cc Merge "Move/dedupe some host path functions in package_ctx.go." am: 455e3a089d am: 47a7da1485
am: 1c0a6ebb26

Change-Id: I72f384073fff467ba53a8dea9422b4296605bb26
2019-12-09 16:14:37 -08:00