Commit graph

716 commits

Author SHA1 Message Date
Sasha Smundak
60d03bd7db Implement android_app_set module.
Bug: 152319766
Test: manual and builtin
Change-Id: I66edc5b423898a11dbba1c3d9796c7bd4d6b4428
Merged-In: I66edc5b423898a11dbba1c3d9796c7bd4d6b4428
2020-05-15 10:47:05 -07:00
Jiyong Park
7d40b59c4d Reland "mark platform un-availability""
This reverts commit 6e1fa4452b.

Reason for revert: relanding a reverted changed

Bug: 153073816
Test: m

Exempt-From-Owner-Approval: cherry-pick from AOSP

Merged-In: I3735866776cf6eb0320c9fb8c6be8ac0c48baa1c
(cherry picked from commit 403c255b6f)
Change-Id: I3735866776cf6eb0320c9fb8c6be8ac0c48baa1c
2020-05-06 21:42:25 +09:00
Jaewoong Jung
e2348338e4 Add signing certificate lineage file support.
Also add multi-cert support to prebuilt apps so that they can benefit
from the new lineage feature.

Test: m GoogleServicesFramework w/ modified build rules
Test: m PrebuiltGmsCore w/ modified build rules
Test: apksigner lineage -v --print-certs -in <built_module_path>
Fixes: 152897457
Change-Id: If7d5d4bd308629c8340231520214c76c8a568a65
2020-04-06 10:19:15 -07:00
Ivan Lozano
3cd1ebeaee 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: I08a054e903b202f513d3b3381afd606bb87cf257
2020-02-13 14:20:28 -05:00
Justin Yun
2bfe0a1a25 Restore "Linktype check for native:product"
Similar to native:vendor, native:product can use VNDK libs but not
vndk_private.
It is activated when PRODUCT_PRODUCT_VNDK_VERSION is set.

This restores the reverted commit
4e7e76fe5a (aosp/1197274).
The problem of the original CL was assuming no modules have both
LOCAL_PRODUCT_MODULE and LOCAL_USE_VNDK in the old implementations.
But many vendor modules in the targets without setting
PRODUCT_PRODUCT_VNDK_VERSION in old branches had both flags that
caused link failures.
To make it no-op without PRODUCT_PRODUCT_VNDK_VERSION, I defined
LOCAL_USE_VNDK_PRODUCT that is set to true if
PRODUCT_PRODUCT_VNDK_VERSION is defined and LOCAL_PRODUCT_MODULE is
true.

Bug: 146620523
Test: build with PRODUCT_PRODUCT_VNDK_VERSION := current
Change-Id: I344c7dc1c47f08706c101e486ff07c3f10aff8ac
2020-01-22 00:16:25 +00:00
Peter Collingbourne
b1d7545e1b Merge "Update make build system for dynamic unwinder." 2020-01-21 21:28:44 +00:00
Vic Yang
4873e65c8d Always check VNDK variant identicalness
Previously, we only check VNDK core and vendor variants are identical
when a VNDK library is not declared to have different variants AND the
target has TARGET_VNDK_USE_CORE_VARIANT set.  Therefore, it is fairly
easily to break a TARGET_VNDK_USE_CORE_VARIANT target as it needs to be
tested explicitly.

This change uses the new LOCAL_CHECK_SAME_VNDK_VARIANTS and expands the
check to run regardless of TARGET_VNDK_USE_CORE_VARIANT.  Also adds
support for VNDK-in-product.

Bug: 145157349
Test: Build success for targets with and without
      TARGET_VNDK_USE_CORE_VARIANT.
Test: With the corresponding change in build/make, remove libbinder
      from build/soong/cc/config/vndk.go and check build fails even
      when TARGET_VNDK_USE_CORE_VARIANT is not set.

Change-Id: Iec708b971072e6580f77a03e243b30b89b3b054d
2020-01-14 20:05:49 -08:00
Peter Collingbourne
86cdf9c2f4 Update make build system for dynamic unwinder.
Change the unwinder linking logic to match soong.

Bug: 144430859
Change-Id: I739980e479d14707b7a3afd6e9d2c817c9b43f81
2020-01-10 11:09:52 -08:00
Yifan Hong
88adfc6349 Mark BOARD_HAL_STATIC_LIBRARIES as obsolete.
No device in our tree use this obsolete thing now.
OEM devices with libhealthd should define health HAL
2.1 instead.

Test: builds
Fixes: 127677771
Change-Id: I1861452a3f7fc97ee20615c8f9f25422f9f507e2
2019-12-04 14:50:59 -08:00
Mitch Phillips
3adbcb31ea Make backend for shared library fuzzing.
Additional context (for Googlers): go/android-fuzzing-shared

This patch adds the Make support for automatically installing sanitized
dependent shared libraries. 'make $module' will find all the shared
library dependencies in soong, and create the rules to install them. We
simply need to add the <install sanitized shared library> rule that's
made by Soong as a dependency of the module's phony.

We also now change 'm fuzz' to not just build the fuzz packages, but to
build all fuzz targets into the respective
$ANDROID_PRODUCT_OUT/data/fuzz and $ANDROID_HOST_OUT/fuzz directories.

Bug: N/A
Test: Build fuzz target with shared libs, note the contents of
$ANDROID_PRODUCT_OUT/data/fuzz/lib and out/soong/fuzz-target-*.zip now
has shared libraries.

Change-Id: I74def02fee663ef788ee25ec0d5106faf474c2a6
2019-11-07 15:39:34 -08:00
Nicolas Geoffray
8567331a4f Merge "Remove support for stripping dex." 2019-10-22 09:48:06 +00:00
Nicolas Geoffray
2ca0e49f61 Remove support for stripping dex.
Stripping is incompatible with ART module updatability.

Bug: 65154345
Bug: 138851227

Test: build and observe no change in output (stripping is not used by
default).

Change-Id: Ic2d9738ef393814c3af3cad116071f7b5938aa84
2019-10-21 09:36:45 +01:00
Jerome Gaillard
a0171af06f Allow files generated by droidstubs to be copied in the SDK
We need to get files generated by a droidstubs target into the SDK. So
we first copy them into the out/target/common/obj/PACKAGING folder where
they can be picked up by the SDK build.

Bug: 142480924
Test: m sdk
Change-Id: I7a0b22907603e1d17ac05901ee7f8bb9cff89f7f
2019-10-15 17:27:43 +01:00
Mitch Phillips
fd6d9022fe Add backend for LOCAL_FUZZ_DATA for cc_fuzz corpus/dict.
Adds the backend makefile parser for the LOCAL_FUZZ_DATA vars generated
by the cc_fuzz target.

Bug: 141026328
Test: m example_fuzzer, fuzz target should have adjacent corpus/dict
files.

Change-Id: Ide2c34318f11be132992650ce5cc1fd27895915c
2019-09-18 18:58:28 -07:00
Colin Cross
70bfe07e6c Support injecting boringssl hash in Make
Add LOCAL_INJECT_BSSL_HASH for the two modules in Make that
statically link libcrypto.

Bug: 137267623
Test: m checkbuild
Change-Id: I5d21c262ff388aeb2dbd02595706c5531a628b7e
2019-09-05 15:31:31 -07:00
Ivan Lozano
d62e7123d8 Make support for rust modules from Soong.
Support for rust modules built in Soong.

Bug: 136189233
Test: Test module builds.
Test: crosvm builds.
Change-Id: Idf2e4a4f760cbcee1d35fe6567ef8e12d4855094
2019-08-27 11:23:35 -07:00
Dan Willemsen
829abaefee Add dependencies for files in LOCAL_PROGUARD_FLAGS
Do this by introducing a new LOCAL_PROGUARD_FLAGS_DEPS variable that we
can modify anytime we add a file reference to LOCAL_PROGUARD_FLAGS.

An alternative would have been to switch to LOCAL_PROGUARD_FLAG_FILES,
but that would have been much harder to ensure the same command line
ordering.

Bug: 130111713
Test: treehugger
Change-Id: If367197b30d563e0796f0cafa00be1f275f2c406
2019-08-09 09:19:52 -07:00
Justin Yun
6151e3f1ea Rename product_services to system_ext
Bug: 134359158
Test: build and check if system_ext.img is created
Change-Id: I67f2e95dd29eac6a28e07e24ea973d3a134c3bfc
2019-07-09 08:57:19 +00:00
Jooyung Han
9340a673cd make: Add support to skip current VNDK install
You can get a system.img without current VNDK libs.
This may help when you want a smaller system.img given that the image
will be used with a specific version (not current) of vendor image.

Bug: 132140714
Test: m TARGET_SKIP_CURRENT_VNDK=true && see if current VNDK is not
installed

Change-Id: Ie0815e6dd6ce2f861b6c42e637da4bb146320673
2019-05-25 02:06:08 +09:00
Colin Cross
e6210f6eb2 Remove AAPT1 support
AAPT2 is used everywhere now, remove support for AAPT1.  Also
removes dpi_specific_apk.mk, it was never updated to use AAPT2
and has been generating bad APKs (resource ID mismatch between
the dex files and the resources) since AAPT2 was made the default
in May 2018 (I9b67fd2a9b3234798b2aac879b5242c2097b3863).

Bug: 80450981
Test: m checkbuild
Change-Id: I2ff768897360ff866dbae5562455bab22be270f7
Merged-In: I2ff768897360ff866dbae5562455bab22be270f7
2019-04-17 16:50:30 -07:00
Anton Hansson
cece1e03af Merge "Read product/device RRO dirs separately from soong" 2019-03-21 11:28:19 +00:00
Vic Yang
51512c558c Add support for no-vendor-variant VNDK
When TARGET_VNDK_USE_CORE_VARIANT is set to true, the vendor variant of
VNDK libraries are by default not installed.  Instead, the core variant
will be used by vendor binaries at runtime.

To ensure the core variant of VNDK libraries are installed, we also add
a flag LOCAL_VNDK_DEPEND_ON_CORE_VARIANT to indicate that the vendor
variant module depends on the core variant module.  This flag should be
set by Soong for all VNDK libraries without the vendor variant
installed.  When the flag is set, the vendor variant binary is also
compared against the core variant binary to ensure they are
functionally identical.

As we are merging the two variants for some libraries, we need a new
link type to denote a module is usable as both native:vndk and
native:platform.  We add native:platform_vndk for this.

Bug: 119423884
Test: With the corresponding Soong change, build with
      TARGET_VNDK_USE_CORE_VARIANT set to true.
Test: Add a dummy VNDK library and a dummy vendor binary that depends
      on it.  Build with no-vendor-variant VNDK and check the core
      variant is installed.
Test: Add conditional compilation based on __ANDROID_VNDK__ in the
      dummy VNDK library and check build fails.

Change-Id: I40000f2728e8193212113c1ee950e9d697f2d40d
2019-03-20 10:23:04 -07:00
Jiyong Park
a32f00e553 Add LOCAL_SOONG_SYMBOL_PATH
The soong-only variable is used to specify the location where the symbol
file is located. When unspecified, LOCAL_MODULE_PATH is used instead as
before.

This is needed when the path that a file is installed to is different
from the path that the file is accessed from at runtime. For example, if
TARGET_FLATTEN_APEX=true, a file lib/libX.so in an APEX com.android.foo
is installed to /system/apex/com.android.foo/lib/libX.so. However, it's
runtime path is /apex/com.android.foo/lib/libX.so as
/system/apex/com.android.foo is bind-mounted to /apex/com,android.foo.

Bug: 120846816
Test: m and inspect that symbol files exist under
$(PRODUCT_OUT)/symbols/apex/com.android.runtime/

Change-Id: I1b39f6e0cde115d442f14380c365796feff3437b
2019-03-20 06:56:20 +09:00
Anton Hansson
dc017122fb Read product/device RRO dirs separately from soong
This change splits the LOCAL_SOONG_RRO_DIRS into two,
representing RRO dirs that originated from device and
product overlay configs, respectively.

Also plumb the device/product configs in separately.

Bug: 127758779
Test: verify noop on presubmit targets
Change-Id: Iddee1b4d7303b7ecaeced91216ea82fe29123770
2019-03-18 19:39:51 +00:00
Yu Shan
655f17cf88 Add 32BIT and 16BIT nanopb library.
Add 32BIT and 16BIT compile time flag for nanopb library to support
16BIT or 32BIT size, default is 8BIT. User need to use the corresponding
library when define the PB_FIELD_* flag during compilation.

Change-Id: I0d25bcdf62d6b47733e1ad4bddbd4dfce2192b5d
Test: None
Bug: 122292884
2019-02-19 12:01:43 -08:00
Colin Cross
87378f1888 Move dexpreopt image selection out of dexpreopt_gen
Instead of passing both the module and global dexpreopt image
selection into dexpreopt_gen, determine the correct dexpreopt
image in Make.  This allows the Make dexpreopt rule to only
depend on the necessary boot images, preventing an order-only
dependency on the 32-bit boot image for a 64-bit only module.

Also stop using the boot image "location" as an input, only
track the real path, which will be converted to the "location"
that dex2oat expects when constructing the command line in
dexpreopt_gen.

Removes support for the unused LOCAL_DEX_PREOPT_IMAGE_LOCATION
variable.

Test: m checkbuild
Change-Id: I2e3e1d30fdfed92fb08e6cc1c9515edf8d99c7f0
2019-02-11 15:25:07 -08:00
Colin Cross
ead7b66590 Make manifest and APK agree on uncompressed native libs
Only put uncompressed native libs in an APK if the min_sdk_version
supports it (>= 23, Marshmallow), and set
android:extractNativeLibs="false" in the AndroidManifest.xml so
that the platform won't extract them anyways.

Bug: 117618214
Test: m checkbuild
Change-Id: Iae26e4676c29c68fa3f76187512c82786bfa0522
2019-02-07 21:44:12 -08:00
Dan Willemsen
f264690860 Remove support for building Windows modules in Make
These now must be defined in Android.bp files.

Bug: 122618577
Test: compare build-aosp_arm.ninja before/after
Test: codesearch for LOCAL_MODULE_HOST_OS.*windows
Change-Id: I14451c7753299692940e026f85687b4c3331bb07
2019-02-05 00:19:41 -08:00
Treehugger Robot
badde7ced7 Merge changes I0bee792d,I2b7c3c8f
* changes:
  Build aar files for m <module name>
  Add LOCAL_ADDITIONAL_CHECKED_MODULE
2019-01-30 18:26:24 +00:00
Colin Cross
0162cc8bea Add LOCAL_ADDITIONAL_CHECKED_MODULE
Adding an intermediate file to LOCAL_ADDITIONAL_CHECKED_MODULE will
cause the file to be built for m <module name>, mma, or m checkbuild.

Test: m checkbuild
Change-Id: I2b7c3c8f01960ce2f9176c8a2108f759fd8fc704
2019-01-29 15:04:39 -08:00
Victor Hsieh
06769c7efb Rename preferCodeIntegrity to useEmbeddedDex
Test: build and run testing apps
Bug: 112037137
Change-Id: Ie8cd8e141df097095310ecc57b6460308210dea5
2019-01-29 13:03:22 -08:00
Logan Chien
0e53d887d6 Add prebuilt ELF binaries checker
This commit introduces a prebuilt ELF binaries checker.  The checker
will check:

1. Whether all DT_NEEDED shared libraries are specified in
   `shared_libs` (Android.bp) or `LOCAL_SHARED_LIBRARIES` (Android.mk).

2. Whether all undefined symbols in the prebuilt binary can be resolved
   to defined symbols exported by its dependencies.

This ensures that prebuilt binaries won't silently become ABI
incompatible.

To check the prebuilt binaries, all of the dependencies must be
specified in `shared_libs` (Android.bp) or `LOCAL_SHARED_LIBRARIES`
(Android.mk).

If your prebuilt binaries cannot be checked for some reason, you may add
the following property to Android.bp:

    check_elf_files: false,

Or, add the following setting to Android.mk:

    LOCAL_CHECK_ELF_FILES := false

Bug: 119084334
Test: CHECK_ELF_FILES=true make check-elf-files
Change-Id: I523d3083f22fd4053c096d26f61f8375800281c8
2019-01-21 21:35:01 +08:00
Jeongik Cha
83c50324ca Define non-system module as variable
Define non_system_module in base_rules.mk when the module is product, vendor,
product_services or proprietary module.

Bug: 74699609

Test: m -j
Change-Id: Iebdd3ec8c643be3d9877b7a96cbdd83465fa3878
2019-01-18 18:24:30 +09:00
Yigit Boyar
a53f680352 Remove data binding from master build
Data Binding only works as part of tools. It also only builds there
(in studio-master-dev branch). This CL removes references to the data
binding checkout which will be followed by removal of data binding
from master manifest.

Bug: 122478832
Change-Id: I338cc1aa10a5ad39114bc0ed14a529365016e9a4
2019-01-08 00:43:03 +00:00
Victor Hsieh
330d21d53b Rename to LOCAL_PREFER_CODE_INTEGRITY
During code review, the name change was suggested.

Test: local CTS passed
Bug: 112037137
Change-Id: I1782c532ad6dd36ee8aad7987e47a14f5c1895ee
2019-01-03 09:48:39 -08:00
Colin Cross
6db5b0ea9a Move dexpreopting to Soong
Move the dexpreopting logic into Soong.  Make modules will be
dexpreopted by executing the Soong logic in the standalone
dexpreopt_gen binary, which will generate scripts that will
perform dexpreopting for each module.  Export global configuration
as JSON to $OUT/dexpreopt.config, which will be used by
dexpreopt_gen and Soong, and per-module JSON configuration that
will be used by dexpreopt_gen.

This relands I59b20c931ee3e5a8d35eb30da4148691c5095502,
I39d580999947ee54cfefe875b57a028be5333bd7,
Ie7daa94e107d53eff075ca58dbe721bd9d7fc8c2 and
Ica006a007d112c232311435aaac0c0e476232b67, with a minor
update to match the changes made to dexpreopt_gen arguments
and a fix to correctly keep dexpreopt disabled on mac builds.

Bug: 119412419
Bug: 120273280
Test: no differences to dexpreopt outputs on aosp_sailfish system/,
      only expected changes to dexpreopt outputs on system_other
      (.vdex files for privileged Soong modules no longer incorrectly
      contain .dex contents).
Change-Id: I25163e91886cea6941afa25cdb529ed053278dcb
2018-12-17 13:46:17 -08:00
Colin Cross
b8901d7fb8 Revert "Move dexpreopting to Soong"
This reverts commit e736c58043.

Test: none
Bug: 119412419
2018-12-14 11:49:55 -08:00
Ivan Lozano
00997c2ac2 Merge "Add make var to avoid recovering with diagnostics." 2018-12-13 20:56:18 +00:00
Colin Cross
e736c58043 Move dexpreopting to Soong
Move the dexpreopting logic into Soong.  Make modules will be
dexpreopted by executing the Soong logic in the standalone
dexpreopt_gen binary, which will generate scripts that will
perform dexpreopting for each module.  Export global configuration
as JSON to $OUT/dexpreopt.config, which will be used by
dexpreopt_gen and Soong, and per-module JSON configuration that
will be used by dexpreopt_gen.

Bug: 119412419
Bug: 120273280
Test: no differences to dexpreopt outputs on aosp_sailfish system/,
      only expected changes to dexpreopt outputs on system_other
      (.vdex files for privileged Soong modules no longer incorrectly
      contain .dex contents).
Change-Id: I59b20c931ee3e5a8d35eb30da4148691c5095502
2018-12-12 17:21:22 -08:00
Ivan Lozano
5fb2de7086 Add make var to avoid recovering with diagnostics.
Add a LOCAL_SANITIZE_NO_RECOVER variable that allows specifying which
sanitizers running in diagnostics mode shouldn't recover. This can help
debugging as we test enabling sanitizers in new libraries since it'll
cause tombstones to be generated along with the diagnostics information.

Bug: 80195448
Bug: 110791537
Test: Compiled test module with this flag, checked compiler command.
Test: Test module crashed, tombstone contained diagnostics information.
Change-Id: I441b9c873e54bf6404325f4d0ac59835350c2889
2018-12-12 10:22:30 -08:00
Ivan Lozano
fda9a6f38e Add support for AArch64 XOM binaries.
Adds build system support for generating AArch64 binaries with
execute-only memory layouts via a new LOCAL_XOM property. Also adds
support for an ENABLE_XOM build flag for global builds.

Bug: 77958880
Test: make -j ENABLE_XOM=true
Change-Id: I6af9e3615d0a9fdff802eae50e6ad94311ec8046
2018-11-21 09:05:08 -08:00
Yi Kong
2b7e980cbd Allow projects to exclude from libcrt_builtins
Some projects can't be built with libcrt_builtins yet.

Bug: 29275768
Test: m checkbuild
Change-Id: I52805f5dece6395024683d07809c4b8905dab631
Merged-In: I52805f5dece6395024683d07809c4b8905dab631
(cherry picked from commit 2a401bea9e)
2018-11-08 13:41:05 -08:00
Yi Kong
95fd9d171d Move libgcc to libcrt.builtins
libgcc is kept behind libcrt.builtins to provide unwinder symbols and
any other missing symbols.

Bug: 29275768
Bug: 119007754
Test: m checkbuild
Change-Id: Ifb16ed87afc3391f8830d771971315515f929235
Merged-In: Ifb16ed87afc3391f8830d771971315515f929235
(cherry picked from commit b9d8932279)
2018-11-08 13:40:34 -08:00
Colin Cross
74e4cf10bf Store AAR path from Soong for dist
Store the path to the AAR file from Soong so that it will be picked
up by dist if requested in TARGET_BUILD_APPS.

Test: m checkbuild
Change-Id: Ifeaf2b5ca3f405fbe79a966ceee9989a38d77f6e
2018-10-30 15:48:33 -07:00
Colin Cross
0fb8c97b02 Dist bundle modules from Soong
Dist bundle modules when requested by TARGET_BUILD_APPS.

Bug: 117295826
Test: tapas RecoveryLocalizer && m dist
Change-Id: Iad63ceafc2a60e6735b50eca65cc4859f9d71b52
2018-10-30 15:47:59 -07:00
Treehugger Robot
73b998ad2e Merge "Revert "ATest: GTest auto gen config support run-test-as."" 2018-10-25 08:53:24 +00:00
Bill Yang
a8fcf6c893 Revert "ATest: GTest auto gen config support run-test-as."
This reverts commit fab820c5f1.

Reason for revert: sed -i requires an argument on mac, break build on mac.

Change-Id: I0b72e28968072afbbb862bd827ee59764dd8a0be
2018-10-25 07:11:26 +00:00
Victor Hsieh
e53dd7b20b Allow target to specify LOCAL_PREFER_INTEGRITY
The option will:
 - Produce APK with uncompressed dex
 - Declare to prefer integrity in manifest

Test: unzip -vl, dex compression looks correct with the option provided
      or not.
Test: similarly, aapt dump correct attribute
Bug: None

Change-Id: I16b9a37255150c2ad84af84087dfabb536a3b07a
2018-10-24 11:40:07 -07:00
Colin Cross
aefeae367e Merge "Reduce the propagation of LOCAL_DEX_PREOPT := nostripping" 2018-10-24 16:47:12 +00:00
Colin Cross
fc782ad949 Reduce the propagation of LOCAL_DEX_PREOPT := nostripping
nostripping causes confusing double negatives, allow nostripping
in LOCAL_DEX_PREOPT and DEFAULT_DEX_PREOPT, but convert to
LOCAL_STRIP_DEX outside of dex_preopt_odex_install.mk.

Test: m checkbuild
Change-Id: I996e9258ce20c394900d9fe937d638bc2ab8589d
2018-10-23 22:33:07 -07:00