Commit graph

1334 commits

Author SHA1 Message Date
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
Treehugger Robot
5546a543ce Merge "Put maxTargetSdk=P APIs onto light greylist." 2018-10-22 15:56:49 +00:00
Mathew Inwood
bcde1c52a6 Put maxTargetSdk=P APIs onto light greylist.
Since the per-SDK level enforcement support is not ready in ART yet, we
can't implement the correct enforcement for maxTargetSdk=P. Putting these
APIs on the dark greylist causes problems for existing apps, so put them
on the light greylist instead.

Test: m
Bug: 117899984
Change-Id: Ib3dad2f50eb6a769ba9f21cec4bac01275888ef6
2018-10-22 13:44:15 +01:00
David Brazdil
6a038d662b Merge "Add UNSAFE_DISABLE_HIDDENAPI_FLAGS to skip hiddenapi processing" 2018-10-22 12:43:39 +00:00
Dan Willemsen
7ddc50a066 Refactor common makefile fragments
In preparation for setting up another Kati stage, move some common
settings and tools into a common folder. This way it's a bit easier to
see that they're safe to use, and that they shouldn't depend on anything
outside of the common folder.

Bug: 117463001
Test: build-aosp_arm.ninja is the same before and after
Change-Id: Ief4b75a4dbe45b73ffd03bf32c60695c816d979d
2018-10-20 14:43:58 -07:00
David Brazdil
8a6b9a7baf Add UNSAFE_DISABLE_HIDDENAPI_FLAGS to skip hiddenapi processing
Setting environment variable UNSAFE_DISABLE_HIDDENAPI_FLAGS=true
will skip the build step which annotates dex files with information
about public and non-public API membership. This is meant to speed
up incremental local builds.

USE AT OWN RISK: Dex files built with this flag will execute with
hidden API access checks disabled and therefore may exhibit different
behaviour compared to production code.

WARNING: Some JARs cannot be compiled with this flag as ART hardcodes
hidden API access flags of intrinsified methods. Attempting to compile
dex files containing such methods will trigger an assertion.

Test: UNSAFE_DISABLE_HIDDENAPI_FLAGS=true mmm frameworks/base
Bug: 113278235
Bug: 112388925
Change-Id: I51fe99ab53e1bb2aa0db64b22a321dd1e1ed47e1
2018-10-19 20:16:49 +01:00
Mathew Inwood
8c96298a92 Write greylist annotation metadata to a csv file.
Also add support for merging these into a single file elsewhere in the
build.

Test: m, inspect generated greylist.csv
Bug: 117314178
Change-Id: If28110fc1ed090222e55c274e8363110753d10f1
2018-10-16 12:06:02 +01:00
Treehugger Robot
0443b46066 Merge "Remove extra JNI libs from prebuilt APKs" 2018-10-09 22:35:26 +00:00
Colin Cross
0e8a2ee172 Remove extra JNI libs from prebuilt APKs
If an APK specifies LOCAL_PREBUILT_JNI_LIBS embedded in the prebuilt
APK, remove any that aren't listed.  Restores the behavior from before
I82dd3aa441712772a1d1ddd6aaf5f41179facaa7.

Bug: 69500920
Test: m checkbuild
Change-Id: I971a9c4206604c172d77144df4c0ed9a8b1c5dd0
2018-10-09 13:06:01 -07:00
nelsonli
c91284dcd8 Build System: Ignore copies in copy-many-files if src == dst
BUG: 117224272

Test: 1. Modify build/core/base_rules.mk
         Add the following line after line 617
	  $(eval my_compat_dist_$(suite) += out/a:out/a))
      2. touch out/a
      3. make -j BluetoothInstrumentationTests
      4. It should build pass without any dependency errors.

Change-Id: I40372eab5b74e042f605c3cb38e72942531ed69a
2018-10-09 14:46:40 +08:00
Colin Cross
dac94fff8f Use zip2zip for uncompress-dexs and uncompress-shared-libs
Unzipping and rezipping files causes the umask of the host machine
to affect the permissions in the APK.  Use the new zip2zip -0 feature
to rewrite the zip file with selected files uncompressed.

Bug: 69500920
Test: m checkbuild
Change-Id: I82dd3aa441712772a1d1ddd6aaf5f41179facaa7
2018-10-08 12:49:11 -07:00
Colin Cross
c3c62fba96 Don't zip hiddenapi output jar into jar
Zip classes*.dex so that the jar does not contain an empty
classes.jar.

Test: m out/target/common/obj/JAVA_LIBRARIES/android.test.base.impl_intermediates/javalib.jar
Change-Id: I53bdd2035b2963dd781734da64058c95e1cff9d4
2018-10-08 11:23:59 -07:00
Anton Hansson
d6e5cb1add Merge "Move a few more string functions to strings.mk" 2018-10-04 13:47:55 +00:00
Anton Hansson
4967b34ddd Move a few more string functions to strings.mk
So they can be used in product.mk

Bug: 80410283
Test: make
Change-Id: Ic94754f6b48a3281ca1dd8c195a3410b543eb366
2018-10-03 15:59:39 +01:00
Anton Hansson
a0f91bd506 Fix TWS requirement in definitions.mk
Removing this TWS breaks the build. Add a backslash to avoid
needing it.

Test: make
Change-Id: I4f8e127218ffbf55a3e11600569f0100e914d2e2
2018-10-03 13:38:00 +01:00
Treehugger Robot
1ac080e9e5 Merge "Pass classpath to d8" 2018-09-27 23:27:45 +00:00
Yifan Hong
c49bddfb67 to-upper and to-lower move to strings.mk
So that config.mk can use these functions.
Test: builds

Change-Id: I6634226cbed56c34977803ff9c75b8d481c21c34
2018-09-24 14:45:41 -07:00
Colin Cross
ec17af3364 Pass classpath to d8
d8 requires the full classpath if --min-api requires default method
or try-with-resources desugaring.  Always pass the full classpath,
since it will already have been built to generate the input jar.

Bug: 116243313
Test: m checkbuild
Change-Id: I363b4d3145e23d4eed77455c1897430206f3ac22
2018-09-21 12:36:53 -07:00
Treehugger Robot
abda944667 Merge "Pass the intermediate dir to appcompat.sh" 2018-09-20 00:00:54 +00:00
Colin Cross
a70669e4a5 Merge "Don't set -pie for windows modules" 2018-09-20 00:00:42 +00:00
Dario Freni
75266ab671 Pass the intermediate dir to appcompat.sh
For ASAN build the intermediate dir might differ from the default
directory.

Test: m (on an affected ASAN build)
Bug: 116020783
Change-Id: Ie4f282ea651d710351799f3fc24dba42e79ee63d
2018-09-19 23:18:38 +01:00
Colin Cross
feb4a7e4ae Don't set -pie for windows modules
Adding -pie to LOCAL_LDFLAGS for host linking leaves it around
when doing the host cross Windows linking, resulting in a warning:
clang-7: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]

Add it later in binary.mk after the flags have been copied to the
single-use my_ldflags.

Bug: 115776263
Test: m checkbuild
Change-Id: I70d71fa1ec6445631dc7e89ef61927a3304375e2
2018-09-19 15:18:17 -07:00
Dan Willemsen
c4af7d75dc Merge "Remove *_OUT_INTERMEDIATE_LIBRARIES" 2018-09-19 17:19:37 +00:00
Treehugger Robot
c55b42358d Merge "Fix installclean incremental builds w/veridex" 2018-09-18 09:16:14 +00:00
Søren Gjesse
75e1c77f1b Merge "Don't include data resources when running R8" 2018-09-18 06:22:21 +00:00
Dan Willemsen
b73ccb7a25 Fix installclean incremental builds w/veridex
$(HOST_OUT)/obj/PACKAGING is cleaned via `installclean`, so regular
built modules should not be depending on it. Explicitly call out the
dependencies instead.

Test: m; m installclean; m
Change-Id: I0f318257e4742d6b7bd099dc06958ca8aba0cfb8
2018-09-17 16:01:14 -07:00
Dan Willemsen
8cf6b65445 Remove *_OUT_INTERMEDIATE_LIBRARIES
Always use the exact libraries like Soong does instead.

Test: m
Change-Id: Ifd48020073dd045247f76f84627c497e94562286
2018-09-15 10:52:13 -07:00
Colin Cross
c9e4976832 Replace some uses of zip with merge_zips, soong_zip, and zip2zip
zip maintains permissions when adding files to zips, which causes
the final jars and apks to change based on the umask of the build.
Move some of the rules that were using zip to soong_zip instead.

Since soong_zip doesn't support adding files to existing zips,
create a new zip file for each part of the package creation
process and then merge them together at the end with merge_zips.

Bug: 69500920
Test: m checkbuild
Change-Id: Id253df776ce19ec4cac3a36fa470a50461ea3cad
2018-09-15 09:16:26 -07:00
Colin Cross
7b226865c1 Make package functions take an argument
In preparation for rearranging the way jars and apks are built.

Relands Ib9f0da132196942062c58fd5b12e84588106724e with a fix to
correctly include classes.dex in hostdex jars.

Test: m checkbuild
Change-Id: I397544456b8ce5827716fcd1828de707b719c2bb
2018-09-15 09:10:37 -07:00
Treehugger Robot
d55eb7643d Merge "Revert "Make package functions take an argument"" 2018-09-15 16:05:39 +00:00
Roland Levillain
70bd104353 Revert "Make package functions take an argument"
This reverts commit 5ea65dcc5e.

Reason for revert: Breaks some ART gtests on host.

Change-Id: I314692e31628a14d824e28544fdb3c765fc100f6
2018-09-15 12:46:44 +00:00
Colin Cross
dcfdb91c07 Merge "Make package functions take an argument" 2018-09-15 03:16:56 +00:00
Treehugger Robot
7f583f1e57 Merge "Remove LOCAL_DONT_DELETE_JAR_DIRS" 2018-09-15 02:14:24 +00:00
Colin Cross
5ea65dcc5e Make package functions take an argument
In preparation for rearranging the way jars and apks are built.

Test: m checkbuild
Change-Id: Ib9f0da132196942062c58fd5b12e84588106724e
2018-09-14 16:55:18 -07:00
Colin Cross
405b30fb4f Remove LOCAL_DONT_DELETE_JAR_DIRS
There are no users left in Make.

Test: m checkbuild
Change-Id: I896fc6b889aab556c6983c374421e4c5381af54d
2018-09-14 16:55:08 -07:00
Søren Gjesse
c81798f2a2 Don't include data resources when running R8
The change https://r8-review.googlesource.com/c/r8/+/26482 made R8
process data resources by default. This is not expected for the
Android Platform build

Test: m -j PRODUCT-aosp_x86-userdebug core-oj
Change-Id: I8936a39ea3cc0f46e455087076635a8fa2c9e0d3
2018-09-14 15:26:44 +02:00
Anton Hansson
948615083a Re-write the module override logic.
This makes the product-installed-files macro more accurately reflect
the files installed for a given product, as well as fixing bugs in
the previous implementation.

Specifically, the complete list of overrides found so far is stripped
in each round of expanding required modules. Previously, overrides were
stripped out *after* expanding required modules. This meant that for a
scenario where B depends on C, and A overrides B, C could get installed.
It's unclear if this was a problem in practice.

The other effect is that the offending artifacts txt is more accurate,
since overridden modules are now correctly removed.

Bug: 80410283
Test: build_test downstream
Change-Id: I8bfc7c40bedd5cb2afba567bae4b998f51770793
2018-09-13 07:51:08 +01:00
Colin Cross
830eed81ab Use build/soong/scripts/strip.sh for Make modules
Replace the complicated rules in Make with calls the same strip.sh
script that Soong uses.

Bug: 113936524
Test: m checkbuild
Change-Id: If7beeb8381b5a9bc6e9ba15d443a834eb43fc0d4
2018-09-10 11:05:32 -07:00
Mathew Inwood
edb1c84f03 Support for adding dark greylist members from annotations.
Currently, we support maxTargetSdk values of 26 & 28, corresponding to
the P blacklist (existing dark grey list) and upcoming Q blacklist.

For now, just put the two into the same list, as the runtime support to
distinguish between the two does not exist yet.

Bug: 114361293
Test: m
Change-Id: I2f8d206e8dd22afc6c0e98fb5e53b1d78a534125
2018-09-07 16:52:16 +01:00
Dan Willemsen
f063839de9 Remove GCC support from Make
Test: out/build-aosp_arm64.ninja is the same before/after
Test: build_test on downstream branches
Change-Id: If7f8c12f2f288b1e589689361f9457acae634882
2018-09-06 15:40:00 -07:00
Dan Willemsen
5771e8cbf1 Switch protoc javastream plugin to using explicit path
The previous PATH=$PATH:out/... logic was incorrect, since the version
in $PATH would override the one out. And now that we're limiting what's
accessible via $PATH, that caused an error.

Instead, ensure that all protoc plugins are specified explicitly with
--plugin, then remove the PATH modification.

Test: cd frameworks/base/cmds/am; mma    (with protoc-gen-javastream in $PATH)
Change-Id: I6690727504f67f84fdc95ed93eabdf3351e5cb0b
2018-08-31 15:59:23 -07:00
David Brazdil
cf163d38d6 Adjust build rule for hidden API list generation
Associated CL in frameworks/base/ migrates hidden API list generation
logic from Makefile/Bash to Python. Instead of four different build
targets, there is now just one. Adjust definitions.mk accordingly.

Bug: 113278235
Test: m appcompat
Change-Id: I01130729a0f783ff37cb4e942bc9ad179fe24e4e
2018-08-30 13:45:22 +01:00
Chih-hung Hsieh
385ba5c434 Merge "Filter out unknown arguments with clang-tidy.sh." 2018-08-28 18:18:32 +00:00
Chih-Hung Hsieh
be5dd2023e Filter out unknown arguments with clang-tidy.sh.
* Call clang-tidy.sh defined in PATH_TO_CLANG_TIDY_SHELL.
* Add dependency to clang-tidy and clang-tidy.sh.

Bug: 110538415
Test: build with WITH_TIDY=1
Change-Id: I90175ea1489272d8d4fc0f9ba4e5bbfdc7399d82
2018-08-28 09:45:39 -07:00
David Brazdil
7c76579e7a Merge "Support hidden API whitelist generated by class2greylist" 2018-08-27 21:41:04 +00:00
Søren Gjesse
6601397608 Merge "Ensure that the R8 minification map (ProGuard dictionary) file exists" 2018-08-27 16:06:07 +00:00
Søren Gjesse
b22934382f Ensure that the R8 minification map (ProGuard dictionary) file exists
R8 no longer outputs an empty map file when minification
(obfuscation) is turned off.

Test: m -j PRODUCT-aosp_x86-eng
Change-Id: I3bd3f2900225dca05a972f46a3b882041e17ba49
2018-08-27 11:19:35 +02:00
David Brazdil
b67402ecce Support hidden API whitelist generated by class2greylist
Libcore has support for annotating a virtual method which is known
to change its return type in a future release. This annotation is
recognized by the dexer and a future-proof bridge method is created.
This patch integrates changes in class2greylist to support this
annotation into the build system and generation of hidden API lists.

Calling class2greylist on each boot classpath module now produces two
text files instead of one: signatures for greylisting and now also
whitelisting. They are passed on to the hidden API list generating rules
in frameworks/base.

Bug: 112186571
Test: m appcompat, diff public-list.txt whitelist.txt
Change-Id: I9861203e6e07a17d50850892ec13880971457d11
2018-08-23 10:38:03 +01:00
Chih-Hung Hsieh
4275dcf866 Define CLANG_TIDY_UNKNOWN_CFLAGS in tidy.mk
* Moved from build/soong because the list is used only in make rules.

Bug: 111885396
Test: build with WITH_TIDY=1
Change-Id: I6ca7420e7ed1e342a5b92996724c6659a406d5ae
2018-08-22 09:21:53 -07:00
Treehugger Robot
36ea50d760 Merge "Add "hwaddress" sanitizer." 2018-08-20 23:22:35 +00:00