Commit graph

15197 commits

Author SHA1 Message Date
Jiyong Park
49a5b9785f Allow native:vendor to vendor apks
Vendor apks should be able to reference native vendor libraries.
Vendor apks have worked around this by building without
LOCAL_SDK_VERSION, which then allowed to use all libs. However,
since vendor apks now needs to be built with SystemSDK, that
workaround can no longer be used.

Bug: 76398918
Test: BOARD_SYSTEMSDK_VERSION=P m -j
Change-Id: Idb13d5db71f4dfd542658483b6a24e7ece18ce26
2018-04-12 17:14:48 +09:00
John Muir
58d96b150e notice_files: Disable NOTICE files for FAKE modules.
Currently the build system will automatically attribute a NOTICE
file with the target of $(BUILD_PHONY_PACKAGE). This shouldn't
be the case.

Disable notice file inclusion for fake targets so that the
/fake_packages/blah_blah-timestamp paths don't show up in
NOTICE.xml.gz.

Bug: 77910458
Test: NOTICE files are not attributed to fake targets.
Change-Id: Ia942cac41b750efbd5a23d896d85ac0820ee8b4e
2018-04-11 13:07:13 -07:00
Anton Hansson
9b72b53a24 Merge "Consolidate the logic for the sdk prebuilt module names." 2018-04-11 09:10:33 +00:00
Treehugger Robot
2754a92f2c Merge "Don't depend on R.txt)" 2018-04-11 04:03:50 +00:00
Colin Cross
ac48f41ba5 Don't depend on R.txt)
There is an extra ) in the implicit output path for R.txt, which causes
the rule to rerun every time because of a missing output file.  There
is already an implicit output for R.txt on line 180 (which is why
the incorrect path didn't cause an immediate "No rule to generate R.txt"
error), so just remove the incorrect one.

Bug: 77244156
Test: m checkbuild && m checkbuild
Change-Id: Id960ee211b89a9a5f5104cdcac23bc3124742145
2018-04-10 16:27:53 -07:00
Dan Willemsen
eaacf5b285 Add variables for configuring Soong plugins
See the Soong commit for detailed usage.

Bug: 76168832
Test: define some variables, use them
Change-Id: Ia8af5b6ec1cb3f12cbc1fee582a309eebb340b7c
2018-04-10 15:51:53 -07:00
Anton Hansson
400673cf1e Consolidate the logic for the sdk prebuilt module names.
I'm making some changes to it, and found the names are scattered
in various places. Make a macro and re-use the logic instead.

Bug: 77525052
Test: make droid
Change-Id: I0f2da80b8b4d427353509b27ec720d024eee7a6e
2018-04-10 18:53:30 +01:00
Dan Willemsen
a4155e8512 Delay eval to save memory use in create-suite-dependencies
Instead of passing the entire contents of
$(COMPATIBILITY.$(suite).FILES) to eval, which may keep that string
around, delay the evaluation of that, and the new files until inside the
eval.

This saves ~2.8GB: 7.4GB -> 4.6GB of ckati max resident memory for a
relatively small internal build. It also saves ~10% of the makefile
loading time (81 -> 73 seconds).

Test: build-aosp_arm.ninja is identical
Change-Id: If45a4796f1bbf6d67dff388ea877a6115a4e06f4
2018-04-09 16:30:06 -07:00
Treehugger Robot
060067e341 Merge "Remove our binary of ccache" 2018-04-06 21:47:38 +00:00
Dan Willemsen
ac406f5c68 Allow boards to turn overriding commands into an error
Many boards have warnings like this, saying that we defined a build
rule, but later something else came in and overrode it with something
else:

art/build/Android.gtest.mk:677: warning: overriding commands for target `test-art-target-gtest-cmdline_parser_test'
art/build/Android.gtest.mk:674: warning: ignoring old commands for target `test-art-target-gtest-cmdline_parser_test'

Beyond the obvious problem of replacing the rule with something else,
target-specific variables can be combined as well, leading to some very
strange problems.

Since so many boards still have problems like this, but we don't
currently have any global problems, add a flag so that we can mark
boards as not broken. This should prevent regressions while we clean up
the individual problems.

Once the non-broken devices number significantly more than the broken
devices, we'll switch this default. And once they're all cleaned up this
variable will become obsolete, and these warnings will always be errors.

Bug: 77611511
Test: lunch aosp_arm-eng; m nothing
Test: lunch aosp_marlin-eng; m nothing
Test: build_test on all downstream branches
Change-Id: I43b645658f468c23a5b9ebcfcd9d4516537db540
2018-04-05 17:26:35 -07:00
Treehugger Robot
e543e409d2 Merge "Support manifest fragments." 2018-04-05 23:09:14 +00:00
Dan Willemsen
7556703f0d Remove our binary of ccache
Our binary was rather old, and for a variety of reasons we haven't kept
it updated. We've been running into a handful of reliability issues that
would have been fixed with an update, and a few reproducibility /
correctness issues that may or may not be fixed with newer versions.

For local no-change full rebuilds, ccache can still save ~35% of the
build time (but adds a few minutes to initially populate the cache). But
most local uses should be using incremental builds anyways, not clean
rebuilds. Or you're doing builds of different configurations, which
wouldn't be cache hits either, and would make your cache even larger.

At a large scale, we haven't seen a significant performance difference
between having ccache on or off. This may be different if you've got
very good build locality, or a very large cache -- but if you've got
good build locality, it's reasonable to do incremental builds (not for
release builds, and while running `m installclean` in between builds).

So for our cases, we'd prefer the stability and correctness of not using
ccache, but if you still want to use ccache, continue setting USE_CCACHE
and also set CCACHE_EXEC to the path of your ccache executable.

Bug: 32748498
Bug: 72408185
Test: performance testing of USE_CCACHE=false vs true locally
Test: turned off ccache for a collection of targets
Test: CCACHE_EXEC=/usr/bin/ccache USE_CCACHE=true m
Change-Id: I7117fe3107bd98521051ae343038a38f7e855502
2018-04-05 15:25:59 -07:00
Steven Moreland
3629aa77da Support manifest fragments.
LOCAL_VINTF_FRAGMENTS/vintf_fragments are
used to specify what manifest fragments should be installed
by a target.

Test: fragments get installed to the right location
Test: broken fragment gets detected
Test: boot device and verify service is working and manifest is updated
Test: verify OTA package contains fragments
Bug: 66917623
Change-Id: I21abe65a31b8c3d255c8ccd80e102ff3acb23105
2018-04-05 11:26:35 -07:00
Dan Willemsen
af2e1f8487 Start moving add_lunch_combo to Make
Start deprecating add_lunch_combo, preferring a list of common choices
in each AndroidProducts.mk file.

This list will be validated so that we don't have typos:

https://android-review.git.corp.google.com/c/device/generic/car/+/619533

Or targets that no longer exist.

Bug: 77599627
Test: lunch
Test: lunch 34
Test: lunch aosp_x86_64-eng
Test: lunch aosp_<tab>
Change-Id: Ie0ddaa94cbd6cee26584f56f1706a8ec1333f87e
2018-04-04 17:14:47 -07:00
Treehugger Robot
a77e2acd6b Merge "Fix mini_debug_info stripping when no symbols should be kept." 2018-04-04 04:28:52 +00:00
Treehugger Robot
fe3983963f Merge "Fix the comment for find-test-data-in-subdirs." 2018-04-02 23:14:11 +00:00
Treehugger Robot
a61f0042d1 Merge "Enable integer_overflow flag for static targets." 2018-04-02 22:36:42 +00:00
Treehugger Robot
c22e207c50 Merge "Add PRODUCT_PACKAGES_DEBUG_ASAN" 2018-04-02 21:15:59 +00:00
Tao Bao
160bb70c4c Fix the comment for find-test-data-in-subdirs.
The function along with LOCAL_TEST_DATA are very helpful, but it took me
some extra minutes to figure out the issue with the arguments.

Test: N/A
Change-Id: I2c2878fca99ab77ea881d86635c27c34f9ecf855
2018-03-30 20:06:36 -07:00
Zach Riggle
9323b7faf3 Add PRODUCT_PACKAGES_DEBUG_ASAN
This is a list of modules which should be installed by default, but only on
builds which are set up for Address Sanitizer (via SANITIZE_TARGET=address).

Additionally, add sanitizer-status to PRODUCT_PACKAGES_DEBUG so that all
userdebug builds will have the binary.  Currently, the module has the
"debug" tag but it may go away in the future.

Change-Id: I0bea4faf9c2a65380292471437e51ef8324b5af3
2018-03-30 21:09:50 +00:00
Treehugger Robot
802eecc01c Merge "Add TOT_SEPOLICY_VERSION = 10000.0" 2018-03-30 17:11:36 +00:00
Treehugger Robot
fb6389d720 Merge "Allow platform modules to link to vendor public libraries" 2018-03-30 03:41:22 +00:00
Vishwath Mohan
f39badf5f8 Merge "Revert "Change PRODUCT_CFI_INCLUDE_PATHS to opt-out (Make)"" 2018-03-30 02:58:32 +00:00
Vishwath Mohan
21204e4921 Revert "Change PRODUCT_CFI_INCLUDE_PATHS to opt-out (Make)"
This reverts commit f03a265786.

Change-Id: I3ca0e2f9e3938b49919a8530b393ba3dba4f118c
2018-03-30 02:55:05 +00:00
Jiyong Park
c3f1356a3a Allow platform modules to link to vendor public libraries
Normally, when building with VNDK, platform modules are not allowed to
link against vendor libraries, because the ABI of the vendor libraries
are not guaranteed to be stable and may differ across multiple vendor
images.

However, the vendor public libraries are the exceptions. Vendor public
libraries are vendor libraries that are exposed to 3rd party apps and
listed in /vendor/etc/public.libraries.txt. Since they are intended to
be exposed to public, their ABI stability is guaranteed (by definition,
though it is up to the vendor to actually guarantee it).

This change allows platform modules to link to vendor public libraries.
When the name of a vendor public libraries (whose stub is defined via
vendor_public_library in Android.bp) is listed in
LOCAL_SHARED_LIBRARIES, it is actually linked to the stub library which
is available to platform modules.

Bug: 74275385
Test: m -j
Change-Id: I063b43431196190b59332b1bcad59f267073f89f
2018-03-30 10:12:30 +09:00
Treehugger Robot
a143397aee Merge "Change PRODUCT_CFI_INCLUDE_PATHS to opt-out (Make)" 2018-03-29 22:55:35 +00:00
Elliott Hughes
e67bbf39fc Merge "Remove unused dalvik.vm.stack-trace-dir." 2018-03-29 21:15:16 +00:00
Vishwath Mohan
f03a265786 Change PRODUCT_CFI_INCLUDE_PATHS to opt-out (Make)
This CL changes PRODUCT_CFI_INCLUDE_PATHS to be included in all
product configs by default. To maintain the status quo, the sanitizer
logic has been modified to only respect this product config for Arm64
devices (where this was previously enabled).

Bug: 63926619
Test: m -j60 # the device still has CFI enabled thanks to the default
opt-in

Change-Id: I22788d92be881d3290568488f5458c85e02ee8c7
2018-03-29 13:07:10 -07:00
Ryan Prichard
a45f5833c0 Fix mini_debug_info stripping when no symbols should be kept.
If there are no symbols to keep (i.e. all function symbols are also in
the dynsym table), then the $@.keep_symbols file has size 0.
When objcopy parses a --keep-symbols file, it has a special case for
0-sized files where it silently fails (exits with status 1, no error
message). On the other hand, objcopy is happy with a file containing no
symbols, as long as there is some whitespace or a comment. Avoid the
special case by appending a newline to keep_symbols.

Bug: b/62815515
Bug: b/77242617
Test: manual
Change-Id: I348593164fe78ece5c85db3d28c7daccce3a52fb
2018-03-29 01:39:07 +00:00
Treehugger Robot
df2a21794c Merge "Allow addition of recovery DTBO to recovery image" 2018-03-29 00:02:57 +00:00
Elliott Hughes
f12e8f81bd Remove unused dalvik.vm.stack-trace-dir.
Bug: http://b/73140330
Test: boots
Change-Id: I6145b7af8224165546b1fbdb95b4d2ac2c1f0997
2018-03-28 14:57:58 -07:00
Alexey Polyudov
e98e5625ad Do not use UBSAN library on HOST or AUX targets
AUX modules are not necessarily using the same toolchain
as the TARGET modules. they don't have to depend on
this library.

Change-Id: Ib50cf0eb26c257ae3eb69a43aa1a12c41d5d39b0
Signed-off-by: Alexey Polyudov <apolyudov@google.com>
2018-03-27 17:21:23 -07:00
Tri Vo
d9c8e956ac Add TOT_SEPOLICY_VERSION = 10000.0
This variable is equal to the sepolicy version for tip-of-tree development.

Bug: 74622750
Test: ./build/soong/soong_ui.bash  --dumpvars-mode -vars PLATFORM_SEPOLICY_VERSION
is unchanged.
Change-Id: I2a62f7399fe245ec0c681e9a789da6b1b83dd9d8
2018-03-27 17:11:38 -07:00
Tobias Thierer
c209fb1799 Merge "javadoc/droidoc: Don't add .jar files to sourcepath." 2018-03-27 09:54:13 +00:00
Treehugger Robot
1f7bf445e7 Merge "Products launching with API 28 needs system-as-root" 2018-03-27 03:40:22 +00:00
Treehugger Robot
73b009e96c Merge "RRO for framework-res.apk is not force built against SystemSDK" 2018-03-27 03:28:32 +00:00
Jiyong Park
c0ece103ec RRO for framework-res.apk is not force built against SystemSDK
When BOARD_SYSTEMSDK_VERSIONS is set, any apk in the vendor partition
is force built against SystemSDK (or Android SDK if LOCAL_SDK_VERSION is
set to current). However, there should be one exception to this: RRO for
framework-res.apk. This is because the RRO is currently overriding
resources that are not part of SystemSDK. Until SystemSDK is expanded to
cover resources that are eligible for overriding, let's allow the direct
dependency from RRO to framework-res.apk.

Bug: 35859726
Bug: 76398918
Test: m -j
Merged-In: Ib9981b107d78691eef21f4525ebdac9866d5c50e
Change-Id: Ib9981b107d78691eef21f4525ebdac9866d5c50e
(cherry picked from commit d8c4c30ba4)
2018-03-27 09:40:11 +09:00
Tobias Thierer
e5665cdb4e javadoc/droidoc: Don't add .jar files to sourcepath.
javadoc expects directories on the sourcepath, not jar files.
The original commit 88b607994a
in 2009 was already passing the jar files, and every revision
since then seems to have kept this habit through cargo cult.

This CL removes the superfluous jar file arguments from the
sourcepath argument to javadoc.

Test: Treehugger
Bug: 76436487

Change-Id: I44b4b8ba248ad4deafbb6462e6f7398f15bd2845
2018-03-27 00:33:18 +01:00
Justin Yun
65c680e285 Set __ANDROID_API__ for vendor binaries to vndk version.
When building vendor modules with BOARD_VNDK_VERSION=current, the
API of the vendor modules will be current PLATFORM_VNDK_VERSION.
__ANDROID_API_FUTURE__ will be used as before if the version is a
CODENAME.

If BOARD_VNDK_VERSION is not "current", that means the VNDK version
of the vendor modules is BOARD_VNDK_VERSION.

Bug: 74833244
Test: Build and check boot.
Change-Id: Iccc603f1b5ffa066e74ba1357f3fbbcc13c58f76
2018-03-27 08:22:11 +09:00
Hridya Valsaraju
e74a38bc6d Allow addition of recovery DTBO to recovery image
Non-A/B devices need to include the DTBO image
within the recovery partition to be self-sufficient
and prevent OTA failures.

Test: Ran 'm dist' and verified that the DTBO image
was included in recovery.img using unpack_bootimg.
Also ran 'make' and verified that the DTBO image was
included in recovery.img using unpack_bootimg.
Also tested that aosp_angler-userdebug could
boot into recovery(including a fake dtbo.img
in recovery image).

Bug: 74763691

Change-Id: I38c9c395c95d21f4da42cfa646063bd4416f6bd8
2018-03-26 22:54:55 +00:00
Bowgo Tsai
ed3b1ca12c Products launching with API 28 needs system-as-root
With project Treble, it's possible to only update system.img across
Android major releases without changing other partitions. However,
for non-A/B devices, ramdisk cannot be updated via a system-only OTA
because it resides in /boot partition.

This leads to two major incompatibility issues:
  - The older /init in ramdisk might not be able to parse the *.rc files
    on /system.
  - The ramdisk contains /init.rc, which also may be out of date compared to
    what is required for the new /system.

Therefore, for new devices launched in P with full Treble support, ramdisk
should be merged into system.img by setting
BOARD_BUILD_SYSTEM_ROOT_IMAGE := True.

Upgrading devices can keep using non-system-as-root configuration.

Bug: 64194858
Test: manual makefile prodding
Change-Id: Ic04c63bd2aac3afa686a6f5cb124beebbcd6a5ee
2018-03-26 23:16:06 +08:00
Andreas Gampe
c3e151954f Build: Amend minidebug odex setup
Add PRODUCT_OTHER_JAVA_DEBUG_INFO similar to PRODUCT_SYSTEM_SERVER_DEBUG_INFO.
Use WITH_DEXPREOPT_DEBUG_INFO as global default, and allow the product
to opt out by setting the above to "false."

Bug: 75259124
Test: m
Change-Id: Id4a2e5d00a1b73a7e7a0a65146042c0aa0c1b411
2018-03-23 10:40:10 -07:00
Treehugger Robot
c0811e291c Merge "Products launching with API 28 need 64-bit binder interface." 2018-03-22 21:52:26 +00:00
Ivan Lozano
702e8bdaba Enable integer_overflow flag for static targets.
This allows the integer_overflow LOCAL_SANITIZE setting to be used with
static targets, to mirror Soong.

Bug: 73283972
Test: make SANITIZE_TARGET{,_DIAG}=integer_overflow
Test: Enabled sanitizer in a static target and tested for SIGABRT.
Change-Id: I0103dc3485b63b86a3dd36a7277b5001813b37fd
2018-03-22 14:36:27 -07:00
Tao Bao
b4ec6d752a Remove the hard-coded path of build_verity_metadata.py.
build_image.py used to invoke build_verity_metadata.py with a hard-coded
path of 'system/extras/verity/build_verity_metadata.py', which makes it
hard to run unittests from non-$(ANDROID_BUILD_TOP) directory.

This CL adds the dependency on the tool, so that it gets installed to
$(HOST_OUT_EXECUTABLES), then removes the hard-coded path.

Bug: 74544459
Bug: 76015688
Test: `m dist`
Test: python -m unittest test_validate_target_files
Change-Id: I0dcf4eb067a0db6f099cb589eb99a151a05c7f2b
2018-03-21 21:15:59 +00:00
Colin Cross
2a63439a31 Merge changes I54b8ec9c,Ibef28507,Ia858de22,Ide3050ec,Ib6e00be4, ...
* changes:
  Add asan-specific CleanSpec
  Use a srcjar for aapt and aapt2 output
  Move R.txt and make aapt2 generate it
  Move aapt2.mk before java.mk
  Remove redundant renderscript_target_api computation
  Move java renderscript support to java_renderscript.mk
  Use srcjar and resource zip as output of renderscript rules
2018-03-21 19:59:41 +00:00
Treehugger Robot
d39eeb44f1 Merge "Includes odm SELinux contexts files for recovery" 2018-03-21 07:02:36 +00:00
Colin Cross
f6d68cf6fe Use a srcjar for aapt and aapt2 output
Dumping files in the *_intermediates/src causes incremental build
problems, because we don't know when to delete them if they are
no longer generated.  Switch to outputting a srcjar instead, and
pass it in to the turbine and javac compiles.

Bug: 73885582
Test: m checkbuild
Change-Id: Ibef28507522339d930c09426d0c98372eb864cb6
Merged-In: Ibef28507522339d930c09426d0c98372eb864cb6
(cherry picked from commit 2d1cddd567)
2018-03-20 15:26:27 -07:00
Colin Cross
2ae710c29f Move R.txt and make aapt2 generate it
Move R.txt from $(intermediates.COMMON)/src to $(intermediates.COMMON)
in preparation for moving aapt/aapt2 java files out of src.  Also
make aapt2 generate R.txt, and make it an implicit output of the rule
and and input to the aar rule.

Bug: 73885582
Test: m out/target/common/obj/JAVA_LIBRARIES/SettingsLib_intermediates/javalib.aar
Test: m checkbuild
Change-Id: Ia858de226355965b69794c002f841333df16a612
Merged-In: Ia858de226355965b69794c002f841333df16a612
(cherry picked from commit 7c24f8ec85)
2018-03-20 15:26:27 -07:00
Colin Cross
7a28158b90 Move aapt2.mk before java.mk
aapt2.mk will export a srcjar that will be compiled by java.mk, so
it needs to be evaluated first.  Also move java_renderscript.mk
before aapt2.mk so that the generated resoures are available.

Bug: 73885582
Test: m checkbuild
Test: rm -rf out/target/common/obj/APPS/RsHelloCompute_intermediates &&
      m out/target/common/obj/APPS/RsHelloCompute_intermediates/src/R.stamp
Change-Id: Ide3050ec993a945f7077b75e952c3b3532306ede
Merged-In: Ide3050ec993a945f7077b75e952c3b3532306ede
(cherry picked from commit 8528eabbba)
2018-03-20 15:26:27 -07:00