Commit graph

13047 commits

Author SHA1 Message Date
Sasha Smundak
97d511a16d Implement extract_apks
Bug: 152319766
Test: manual and builtin
Change-Id: Ia15d66e86c7bcfd52f5b776173ca1665b68ff438
Merged-In: Ia15d66e86c7bcfd52f5b776173ca1665b68ff438
2020-06-03 09:49:38 -07:00
TreeHugger Robot
abc4f820a1 Merge "Build native coverage variant of APEXes when needed" into qt-dev 2020-02-04 00:43:58 +00:00
Pirama Arumuga Nainar
c2cf2c5dbe Wrap getenv when linking a coverage-enabled binary
The wrapper to getenv() appends the effective userid (euid) of the
current process to GCOV_PREFIX.  This avoids conflicts and permissions
issues when multiple processes try to create/access the same directories
and files under /data/misc/trace.

Bug: 148178774
Test: Verify that coverage files are written to
/data/misc/trace/<euid>/proc/... instead of /data/misc/trace/proc/...

Change-Id: If58081a12b2b9bc40cfcbf64c99beafe198d07af
Merged-In: If58081a12b2b9bc40cfcbf64c99beafe198d07af
(cherry picked from commit 100bbdc8f3)
2020-02-03 19:04:09 +00:00
Pirama Arumuga Nainar
2363a2b162 Refactor libprofile-extras to be added as a whole static library
Bug: http://b/134177005
Bug: http://b/116873221

Previously, the libprofile-extras dependency was added as a
LateStaticLib and the constructor in this library was included during
linking with the '-uinit_profile_extras' linker flag.  This was done
because at the deps() stage, the exact binaries that need coverage are
not known (in fact the coverage-enabled variants are not created yet).

This meant that for a link command, if one of the shared libraries
already exported the constructor, the output of the link command did not
load/link libprofile-extras.

For other reasons, we now want to add more symbols to this library that
need to be linked into all libraries and executables.  To accomplish
that, refactor the dependency handling so libprofile-extras can be added
as a 'WholeStaticLib'.

This is done by creating a new dependency type (with a coverageDepTag
dependency tag) to add libprofile-extras as a dependency for all modules
that can potentially link with coverage.  During the flags() call, this
dependency is moved as a WholeStaticLib dependency iff coverage is
enabled in this link step.

There are a few NFC changes as well:
- deps() takes a DepsContext parameter.
- flags() has an extra PathDeps parameter and return value.
- add useSdk() helper to cc.Module.

Test: Build with coverage and check that we can generate coverage using
SIGUSR1 and the debug.coverage.flush sysprop.

Change-Id: I7e7d8201956a150febbda5bb1794f8ece016db8b
Merged-In: I7e7d8201956a150febbda5bb1794f8ece016db8b
(cherry picked from commit 82fe59b656)
2020-02-03 19:03:45 +00:00
Oliver Nguyen
baa54c6ed8 Package coverage files as a zip.
Bug: 148178774
Test: make NATIVE_COVERAGE=true COVERAGE_PATHS="*"
Change-Id: I955212a20ea19c854ebc88635252a1d174ea8f7f
Merged-In: I955212a20ea19c854ebc88635252a1d174ea8f7f
(cherry picked from commit c743414d42)
2020-02-03 19:00:22 +00:00
Colin Cross
cba45b2892 DO NOT MERGE: Add tradefed_java_library_host
Add a module type for tradefed libraries that causes an additional
copy to be installed at out/host/linux-x86/tradefed.

Bug: 143908003
Exclude merging into *-plus-aosp branches, since they already include the change.
Merged-In: I670345494abbad80dacab54471e635abfae3b3b3
Merged-In: I1cb25bbd5823a14f1a9428d58827677eff22ec7e
Change-Id: I55bca53e02588827374896ef87d58f3f4bdc48c7
(cherry picked from commit f0f2e2cf79)
2019-12-13 22:06:41 +00:00
Jerome Gaillard
0b09ad7f34 Update droidstubs build target
This allows to use Metalava to generate metadata files useful for
Android Studio as part of a droidstubs target.
Once those files have been created in a new metadata folder, they are
zipped to make it easier to transfer them into the
out/target/common/obj/PACKAGING folder where they can then be picked up
by the SDK build to be included there.

Bug: 142480924
Test: m sdk
Change-Id: I4be1c9e78369c65ee9cd94706c6d20ab0df6b797
Merged-In: I4be1c9e78369c65ee9cd94706c6d20ab0df6b797
2019-11-18 10:36:22 +00:00
Jaewoong Jung
105e166581 Add NOTICE file path to apex bundle base rule.
The NOTICE files are missing from prebuilt apexes, and it turns out they
were excluded when building bundles.

Bug: 140317706
Test: Ran build_mainline_modules.sh and checked bundle base modules.
Change-Id: I92c4231f2007e1d8cd9c2bd044201458803c0fd7
2019-09-04 13:26:18 -07:00
TreeHugger Robot
5961cb4598 Merge "API: Add baseline file for API check" into qt-dev 2019-08-15 18:07:32 +00:00
Jiyong Park
49932f3e69 Build native coverage variant of APEXes when needed
When the native coverage is enabled, APEXes (and files there) are built
for native coverage as well.

Bug: 138952487
Test: make -j NATIVE_COVERAGE=true COVERAGE_PATHS='*' com.android.resolv
find out -name "*.gcno" | grep DnsResolver shows files

Test: libnetd_resolv.zip is found under
$(TARGET_OUT)/apex/com.android.resolv/lib directory

Merged-In: I97bcee9bf8ffc0dc71453abbdb613ed56ea2cdb4
(cherry picked from commit ee9a98d88e)
Change-Id: I97bcee9bf8ffc0dc71453abbdb613ed56ea2cdb4
2019-08-16 00:01:18 +09:00
Adrian Roos
4937c4a8ba API: Add baseline file for API check
Bug: 139128921
Test: m apicheck
Change-Id: Ia10c51fdca10e2a3d1cc3a7bc6d798d447c7b729
Merged-In: Ia10c51fdca10e2a3d1cc3a7bc6d798d447c7b729
2019-08-13 15:38:52 +00:00
Kun Niu
1bc40c56b9 Build module from source branch instead of using prebuilds when coverage is enabled.
Test: successfully get coverage data from coverage build.
Bug: 137865099
Change-Id: I7df96c2b2c2ec2859393fb2c19ffe1081d112c96
Merged-In: I7df96c2b2c2ec2859393fb2c19ffe1081d112c96
2019-08-05 13:36:20 -07:00
Jiyong Park
895e224d8f fix: APEX prebuilts are disabled in platform build
This change fixes a bug that APEX prebuilts are auto-disabled in
platform builds (i.e. non-unbundled builds).

Bug: 137282010
Test: m com.android.conscrypt
check that the apex is from prebuilt directory

Change-Id: I935ef3896e80864bdcc1ca5f6fc12b63c9588c0d
2019-07-17 08:21:36 +09:00
TreeHugger Robot
7610ba915c Merge changes I2c00af07,I2f49fa7d into qt-dev
* changes:
  Fix the unbundled mainline module build
  Revert "Don't build hiddenapi flags or encode dex for unbundled builds"
2019-07-16 04:16:31 +00:00
Dan Shi
40c0afeb7c Support require_root in auto-gen test configs
require_root is added to allow auto-generated test config to include
RootTargetPreparer so the test runs with root permission.

Bug: 134509111
Bug: 136633978
Test: add "require_root: true" to init_benchmarks and libpower_test
  build the modules, confirm the extra target preparer is added in the
  test configs.

Change-Id: Ia07503e338935d6aa92560e7cf7b18d2a4c51243
Merged-In: Ia07503e338935d6aa92560e7cf7b18d2a4c51243
2019-07-15 17:31:17 +00:00
Jiyong Park
53554e2559 Fix the unbundled mainline module build
This change fixes two problems:

1) the prebuilt apexes are force disabled for the unbundled builds
because we need to build the modules from the source then

2) the dependencies from an sdk_library module to
*.stubs.{public|system|tests} are not added for the unbundled build
because the stubs modules are disabled.

Bug: 137282010
Test: unbundled mainline builds are successful
Test: build com.android.media and inspect the jar file to see if
hiddenapi flags are there
$ cd out/dist/mainline_modules_arm
$ unzip com.android.media.apex apex_payload.img
$ mkdir -p mnt
$ sudo mount -o ro,loop apex_payload.img mnt
$ dexdump2 mnt/javalib/updatable-media.jar | grep hiddenapi
shows results

Merged-In: I2c00af07aac4a15770d3acab011a36e2e4803bfc
Change-Id: I2c00af07aac4a15770d3acab011a36e2e4803bfc
2019-07-15 17:21:20 +09:00
Jiyong Park
716828ab4e Revert "Don't build hiddenapi flags or encode dex for unbundled builds"
This reverts commit 7b8a567f44.

Bug: 137282010
Test: With the CL above this one, the unbundled mainline module build
does not fail.

Merged-In: I2f49fa7dbe1da92cb282a9bc14acd5830888ed17
Change-Id: I2f49fa7dbe1da92cb282a9bc14acd5830888ed17
2019-07-15 17:20:47 +09:00
Jiyong Park
3b98a509f1 Don't use APEX prebuilts when asan is on
Some prebuilt APEXes are enabled with scudo, which causes crash on
devices with asan.

Bug: 137216042
Test: build walleye_hwasan and check if apexes are not from prebuilts
Change-Id: Ic436ad06e724af952d99fb8e66358a595450eb84
2019-07-11 12:11:24 +09:00
Jiyong Park
0a573d798f Don't use prebuilt_apex when TARGET_FLATTEN_APEX is set to true
When the device does not support non-flattened APEX (i.e.
TARGET_FLATTEN_APEX is set to true), then ignore the prebuilt_apex
modules even when `prefer: true`.

Bug: 136251130
Bug: 136662772
Test: build marlin, and check if /system/apex has flattened APEXes
Change-Id: I9f3dfefc3bd357d6750fbb1e418937d095720b04
2019-07-07 13:57:10 +09:00
Colin Cross
43377eeb38 Uncompress dex in unbundled privileged apps
Mainline builds privileged apps unbundled and then uses them as
prebuilts, so they need to respect the privileged flag when
deciding whether or not to uncompress the dex.

Bug: 135772877
Test: TestUncompressDex
Change-Id: I91da7116b779ae35c0617ef77dbcb9788902370c
Merged-In: I91da7116b779ae35c0617ef77dbcb9788902370c
(cherry picked from commit 53a87f523b)
2019-06-25 22:28:00 -07:00
Jaewoong Jung
d6585fe6e3 Embed NOTICE output as an APEX asset.
Instead of outputting an aggregated NOTICE file as an intermediate build
resource to allow Make to include it in the final system-wide NOTICE,
process and embed it as an asset in the final APEX. This allows us to
update the NOTICE contents automatically when an APEX is updated.

Fixes: 135218846
Test: Built mainline modules, apex_test.go
Change-Id: Ic851b330fe93be1f602907d44ecc7886c3b0171b
Merged-In: Ic851b330fe93be1f602907d44ecc7886c3b0171b
(cherry picked from commit 14f5ff62c9)
2019-06-25 21:08:32 +00:00
Jaewoong Jung
5c6572e53f Optionally embed NOTICE files in apks.
If embed_notices or ALWAYS_EMBED_NOTICES is set, collect NOTICE files
from all dependencies of the android_app, merge them with the app's own
one (if exists), transform it to HTML, gzip it, and put it as an asset
in the final APK output.

Bug: 135460391
Test: app_test.go + Built Mainline modules
Change-Id: I52d92e2fd19b3f5f396100424665c5cc344190d8
Merged-In: I52d92e2fd19b3f5f396100424665c5cc344190d8
(cherry picked from commit 5b425e2e20)
2019-06-25 20:56:17 +00:00
Jaewoong Jung
3ad00bf196 OverridableModuleBase shouldn't embed ModuleBase.
Individual module structs normally embed ModuleBase themselves. This
caused duplicate embedding, and so made common properties like notice
inaccessible.

Bug: 135460391
Test: app_test.go, TreeHugger
Change-Id: I5683b194e3de909d480c083a931cc7e871de1d74
Merged-In: I5683b194e3de909d480c083a931cc7e871de1d74
2019-06-19 15:04:27 -07:00
Steven Moreland
6df90831b7 Merge "neverallow: vintf to libhidltransport impl lib" into qt-dev 2019-06-14 22:54:21 +00:00
Steven Moreland
a1165d6958 neverallow: vintf to libhidltransport impl lib
Also delete useless testcase.

Bug: 134961554
Test: build

Change-Id: Ie76492f806757b86d94d29a736773f72ce2ab104
2019-06-14 22:04:53 +00:00
Roland Levillain
0dbeb666bc Allow arch-specific symlink_preferred_arch properties.
(cherry picked from commit d9bf9be007)

Test: m
Bug: 133864678
Change-Id: Ia6e62156adda2b3a51220552bbe4dab738753674
Merged-In: Ia6e62156adda2b3a51220552bbe4dab738753674
2019-06-07 18:00:23 +01:00
Colin Cross
ea68aad696 Fix data race and ordering consistency in apex modules
apexDepsMutator can be called on multiple apex modules in parallel,
and then two goroutines could call BuildForApex on the same module
in parallel, leading to a data race appending to apexVariations.
This also results in random ordering of the entries in
apexVariations.

Hold a mutex around appending to apexVariations, and sort it before
passing it to ctx.CreateVariations.

Fixes: 134425751
Test: m nothing
Change-Id: If5a3b53a778daacb3e26ac05cde872cf8eb980b3
Merged-In: If5a3b53a778daacb3e26ac05cde872cf8eb980b3
(cherry picked from commit cefa94bd27)
2019-06-05 11:32:50 -07:00
Colin Cross
9bd624c76d Support using cc_prebuilt_library_shared with cc_library
Allow a cc_prebuilt_library_shared to share the same name as a
cc_library by always creating static and shared variants of
prebuilts so that the variants of the source module are always
a superset of the variants of the target module.

Bug: 131709055
Test: TestPrebuilts
Change-Id: I4afd6d37e6a986d08ad25aee69eca6d994febc6b
Merged-In: I4afd6d37e6a986d08ad25aee69eca6d994febc6b
(cherry picked from commit 33b2fb7333)
2019-06-03 03:40:13 -07:00
Christopher Ferris
6e2b6aa89e Remove libc_scudo library when building asan.
Running any executable built with asan and libc_scudo results in crashes.

Bug: 131810078

Test: Built the media processes with the sanitizer enabled verifying
Test: that the libc_scudo.so shared library is not listed in the
Test: mediaextractor and the mediaswcodec binaries.
Test: Build the media processes without the sanitizer enabled verifying
Test: that the libc_scudo.so shared library is listed in the
Test: mediaextractor and the mediaswcodec binaries.
Change-Id: Ie55a0414088787ec11d85fffcb04592ed4f23c57
Merged-In: Ie55a0414088787ec11d85fffcb04592ed4f23c57
(cherry picked from commit 753d4a69d5)
2019-05-31 14:55:38 -07:00
Colin Cross
7b8a567f44 Don't build hiddenapi flags or encode dex for unbundled builds
Builds with TARGET_BUILD_APPS shouldn't build the hiddenapi flags
or encode dex files even if frameworks/base exists.

Bug: 133343287
Test: mainline modules build
Change-Id: I0647451420fd09bb680808b35e1ad3b8f514ba46
Merged-In: I0647451420fd09bb680808b35e1ad3b8f514ba46
(cherry picked from commit 9c74a1ee85)
2019-05-29 08:38:53 -07:00
Colin Cross
f2562eb417 Cut darwinStripPool from 10 to 5
Failures in strip.sh are still occurring with darwinStripPool set to
10, try 5.

Bug: 132822437
Test: none
Change-Id: I2df247c89b6d8f6e741d4e17057b06ff9ec72b40
Merged-In: I2df247c89b6d8f6e741d4e17057b06ff9ec72b40
(cherry picked from commit badf8d691f)
2019-05-23 09:42:18 -07:00
TreeHugger Robot
9a83367822 Merge "Limit calls to strip.sh on darwin" into qt-dev 2019-05-20 23:23:23 +00:00
Colin Cross
954bb27cd9 Limit calls to strip.sh on darwin
strip.sh can use a file descriptor per .o file when run on .a files,
which can hit the system file descriptor limit on darwin.  This
causes failures when manay variants of libgcc_stripped are built
simultaneously.  Put all strip rules on darwin into a pool that
limits them to 10 concurrent processes, which will limit the file
descriptor usage to ~7500.

Fixes: 132822437
Test: no mention of darwinStripPool in out/soong/build.ninja on linux
Test: m libgcc_stripped on darwin
Change-Id: I3d4fbbd8d44d2e9059a79df113ab95336ec2c658
Merged-In: I3d4fbbd8d44d2e9059a79df113ab95336ec2c658
(cherry picked from commit ee3ea31a24)
2019-05-20 15:13:47 -07:00
Sundong Ahn
a4a385f1d5 Add No_dist property
For the sysprop apis, we don't need dist. So the No_dist property is
added for it.

Bug: 132448761
Test: m -j dist
Merged-In: I51c6a6b87ab9dc90b6825c0d4d414e958dd7b265
Change-Id: I51c6a6b87ab9dc90b6825c0d4d414e958dd7b265
(cherry picked from commit 80a87b3309)
2019-05-16 19:23:39 +09:00
Evgenii Stepanov
2c6484e334 Disable malloc fill in HWASan.
HWASan has a feature to fill malloc() memory with non-zero pattern.
This has found a bug or two in the past, but it also keep causing hard
to debug issues. The main problem is lack of diagnostics - use of
pattern-initialized memory is not an immediate crash. More often than
not it manifests as a subtle change in system behavior.

Having MemorySanitizer on Android would be nice...

This change does not affect any shipping configuration, but improves
stability of testing-only SANITIZE_TARGET=hwaddress build.

Bug: 132803232
Bug: 132652537
Bug: 131438232
Bug: 132810685
Test: SANITIZE_TARGET=hwasan on crosshatch successfully boots in ~100%
      attempt (up from ~99% currently).

Change-Id: I7dcbcdf1b8a5b8556e32690327b32f04879e5db1
2019-05-15 13:53:37 -07:00
Ian Pedowitz
c91fcb46ed Merge "Revert "Revert "Android Q is API 29""" into qt-dev 2019-05-15 16:28:52 +00:00
Nicolas Geoffray
f489589521 Pass other boot classpath locations to the apex image.
In order to evaluate the impact of framework classes being in an image.

Test: m
Bug: 119800099
Exempt-From-Owner-Approval: this is only for an experimental config, which we would like to see
the performance before build snap.

(cherry picked from commit feef2ef4d7)

Change-Id: I44ea9d99985c3e9d21602f2c612364d0cef0d1ea
Merged-In: Ib0d3acf8d2718ee443b3bffe8122a54f92257691
2019-05-13 15:09:47 +01:00
Ian Pedowitz
851de71044 Revert "Revert "Android Q is API 29""
This reverts commit 9e2bf9ec51.

Reason for revert: Rolling forward for Q-Finalization

Bug: 129975435
Bug: 129943426
Change-Id: Ic8a09aca67c189edfda4b10e5deb13716eb66adc
Test: Build
2019-05-11 17:02:50 +00:00
Elliott Hughes
ecde55669f Go back to the host sed until we have a faster prebuilt.
Bug: https://issuetracker.google.com/131747477
Test: treehugger

(cherry picked from commit 18e0d5e0f0)

Change-Id: Ie17468f622ae9f995e86f08f692874fa1a722c74
Merged-In: I120fe1200216afdb492bd1353848d12a4be1f496
2019-05-09 17:38:46 -07:00
Yi Kong
57b77658bc Merge changes from topic "libgcc_stripped" into qt-dev
* changes:
  Exclude libgcc_stripped wherever libgcc is excluded
  Revert "Revert "Strip libgcc to only keep fallback symbols""
2019-05-07 21:13:04 +00:00
Yi Kong
94b9b2655d Exclude libgcc_stripped wherever libgcc is excluded
Test: manual testing
Bug: 130267141
Bug: 29275768
Change-Id: Idbe82ea4a3e5cb9a9a7c194dd0a4d8a282d56c03
Merged-In: Icc0d50e403dc4a3592e5bf389101cdef129042df
(cherry picked from commit 3d8792f7dd)
2019-05-07 21:12:49 +00:00
Yi Kong
b0e95c1e60 Revert "Revert "Strip libgcc to only keep fallback symbols""
This reverts commit 619cd098b6.

Test: manual testing
Bug: 130267141
Change-Id: Ie156d4a3255be0ad082cda35c22bac4359852f22
Merged-In: I5b349fa6138e51663bf3b67109b880b4356da8e8
Exempt-From-Owner-Approval: Cherry pick
2019-05-07 21:11:31 +00:00
Colin Cross
00d764f7a7 Merge "Revert "Strip libgcc to only keep fallback symbols"" into qt-dev 2019-05-06 19:33:02 +00:00
Colin Cross
619cd098b6 Revert "Strip libgcc to only keep fallback symbols"
This reverts commit bd475367c3.

Reason for revert: b/130267141
Bug: 29275768
Bug: 130267141
Merged-In: I5b349fa6138e51663bf3b67109b880b4356da8e8
Change-Id: Ieab56390b27240ef7f2f52a48a673809da7bcf8e
2019-05-06 17:29:49 +00:00
TreeHugger Robot
a6957eeb1b Merge "Allow the host expr." into qt-dev 2019-05-03 20:03:07 +00:00
TreeHugger Robot
92304882f4 Merge "Emit LOCAL_MODULE_TARGET_ARCH for prebuilt_etc" into qt-dev 2019-05-03 19:33:21 +00:00
Elliott Hughes
321dd2a411 Allow the host expr.
(Kernel builds require GNU unary + extension.)

Bug: https://issuetracker.google.com/131747477
Bug: http://b/35267372 (bogus)
Test: treehugger

(cherry picked from commit 3a653f419b)

Change-Id: Ia0a0d654d0ce30bb1e06bb789d52b311aa54b836
2019-05-03 17:29:10 +00:00
Yi Kong
bd475367c3 Strip libgcc to only keep fallback symbols
We use libgcc as fallback for symbols not present in libclang_rt
builtins, however we didn't know what exact symbols were being used,
some may not be intended to fallback.

Create libgcc_stripped, which only contains unwind symbols from libgcc.

Bug: 29275768
Test: bionic-unit-tests
Change-Id: I98df02ead7f6cca4e76ec92d4f880de4e03f5b5c
Merged-In: I5b349fa6138e51663bf3b67109b880b4356da8e8
(cherry picked from commit acee27cd72)
2019-05-03 08:24:10 +00:00
Jiyong Park
6c5318266d Emit LOCAL_MODULE_TARGET_ARCH for prebuilt_etc
Absense of the flag causes problem when prebuilt_etc is configured with
compile_multilib.

Bug: 130138217
Test: choosecombo to aosp_x86_64 and build
test_com.android.media.swcodec
Check that the test APEX has 32-bit artifacts.

Merged-In: Idd28443d129ff70053295015e69328a8fa3eca47
Change-Id: I6b90668d6effc9f82f7cf3a958d4964e8f06ac8e
2019-05-03 08:41:35 +09:00
TreeHugger Robot
ead8b42a1d Merge "Disable hwasan memory stats." into qt-dev 2019-05-02 22:25:21 +00:00