Commit Graph

34545 Commits

Author SHA1 Message Date
Mathieu Chartier fcc8d8b26d Default profile usage based on the existence of the profile
Currently this only checks vendor/google_data/art_profile, but the plan
is to use a per product directory in the near future.

(cherry picked from commit 6324c2d291)

Bug: 38032017
Test: make and make sure the profile was used (calculator).

Merged-In: I8de6484dbcac5fc040ad70f97e97d193b317af8c
Change-Id: I8de6484dbcac5fc040ad70f97e97d193b317af8c
2017-07-28 11:16:53 -07:00
Mathieu Chartier 229d0534dc Use speed-profile instead of quicken for the profile case
Reduces calculator launch from 354 -> 325 with a profile.

(cherry picked from commit c5536ffbd3)

Bug: 38032017

Test: mm

Merged-In: I795a2d3f4db5546be4d77c3716e69d20d8f23549
Change-Id: I795a2d3f4db5546be4d77c3716e69d20d8f23549
2017-07-28 11:16:43 -07:00
Tobias Thierer 1d9689b3e7 Merge "Allow builds with costum toolchains." 2017-07-27 10:41:18 +00:00
Tobias Thierer 67352ffa1f Merge "Build: Experimental option to default to -source 1.9 -target 1.9" 2017-07-27 10:40:43 +00:00
Colin Cross 9143549df7 Merge "Revert "Compile with javac by default"" 2017-07-27 06:04:02 +00:00
Colin Cross 36062e8076 Revert "Compile with javac by default"
This reverts commit 268dfa4d91.

Bug: 36902714
Change-Id: I69edf1a52300b50c45bd02c203f8843963357506
2017-07-27 06:02:15 +00:00
Treehugger Robot 28989a9a22 Merge "Don't add .vendor suffix for vendor-only modules" 2017-07-26 23:57:41 +00:00
Jiyong Park a9c4c71756 Don't add .vendor suffix for vendor-only modules
Soong now adds .vendor suffix only for modules having both core and
vendor variants. Furthermore, names listed in LOCAL_SHARED_LIBRARIES
are correct (= have .vendor suffix when the dependent lib has variants).
Therefore, make does not need to force add .vendor suffix when parsing
modules from soong.

Bug: 37480243
Test: BOARD_VNDK_VERSION=current m -j <name> is successful, where <name>
is one of the vendor-only libraries in Soong. (i.e.
android.hardware.renderscript@1.0-impl)
Test: m -j does not break anything

Change-Id: Id8d0d01313c63496a10de4cd3ddb9f75180efef6
2017-07-27 08:54:43 +09:00
Colin Cross 262d597530 Merge "Compile with javac by default" 2017-07-26 23:52:34 +00:00
Colin Cross 268dfa4d91 Compile with javac by default
javac is replacing jack as the default compiler for platform builds.

Bug: 36902714
Test: m -j checkbuild
Test: https://android-build.googleplex.com/builds/view-workplan?viewType=Table&workplanId=L50600000086240009&nodeType=Trybot
Test: sailfish-userdebug boots and basic interactions work
Test: art tests pass
Test: libcore tests pass
Change-Id: I1c3857f64eafa445ad1b9dd94eff85bef05f4649
2017-07-26 23:42:23 +00:00
Dan Willemsen 76a75aa72d Merge "Only run Kati twice on a clean build due to clean_steps.mk" 2017-07-26 23:28:00 +00:00
Dan Willemsen 770a498e99 Merge changes I863200b2,Ifdd9663b
* changes:
  Run `uname -sm` once, don't use python for HOST_OS_EXTRA
  Stop calling `java -version`, remove HOST_JDK_IS_64BIT_VERSION
2017-07-26 21:31:05 +00:00
Tobias Thierer d61f28bf56 Build: Experimental option to default to -source 1.9 -target 1.9
Enabled via:

export EXPERIMENTAL_USE_OPENJDK9=true

Other nonempty values of EXPERIMENTAL_USE_OPENJDK9 will
allow OpenJDK 9 toolchains, but will still default to
-source 1.8 and -target 1.8.

Note that -source 1.9 and -target 1.9 does not currently
successfully build.

Test: Treehugger.
Bug: 38177569

Experimental flag to set LOCAL_JAVA_LANGUAGE_VERSION := 1.9

Change-Id: I9eb881b3fbd1806984a132f6da7b5a4cc6612247
2017-07-26 22:24:15 +01:00
Dan Willemsen ce7f8dd15a Run `uname -sm` once, don't use python for HOST_OS_EXTRA
This saves 20-50ms for `lunch` (~7-10%), and double that for every build
execution.

Test: Check HOST_OS_EXTRA on Linux & Mac
Change-Id: I863200b2287c8867f40606237895b1d3ad91e1b3
2017-07-26 10:49:22 -07:00
Dan Willemsen dc068b0762 Stop calling `java -version`, remove HOST_JDK_IS_64BIT_VERSION
All users of this variable have been removed. This command was adding
50-175ms to `lunch` (~15-30%), and was running at least twice (serially)
in every build too.

Test: cs/HOST_JDK_IS_64BIT_VERSION
Test: prebuilts/jdk/jdk8/linux-x86/bin/java -version, is 64-bit.
Change-Id: Ifdd9663b010ec45918b29ac037849f49c8cd8f69
2017-07-26 10:49:04 -07:00
Tobias Thierer 1b53ea0908 Allow builds with costum toolchains.
Android bundles an OpenJDK-derived toolchain to avoid issues with
unsupported toolchains. For development / experiment purposes, this
CL the toolchain to be overridden via OVERRIDE_ANDROID_JAVA_HOME.

It is an error for OVERRIDE_ANDROID_JAVA_HOME to be set but not
point to a valid toolchain, but this error is not explicitly
checked for.

Bug: 38177295
Test: Treehugger

Change-Id: I72f641f560501e498f9c86a4380f19941fca11ad
2017-07-26 17:54:11 +01:00
Treehugger Robot 2aef19528e Merge "Apks are again allowed to use vendor libs as before" 2017-07-26 00:45:24 +00:00
Colin Cross 1907b9905e Merge "Enable ubsan check flag in build" 2017-07-25 17:48:06 +00:00
Treehugger Robot 194893ee6c Merge "Make JAVA_HOME absolute inside build" 2017-07-25 04:37:40 +00:00
Dan Willemsen e6f756091c Only run Kati twice on a clean build due to clean_steps.mk
Write into a temp file, then use `cmp` to determine whether to update
the actual file. This means that we'll only run Kati twice on a clean
build, since we'll omit the redundant write during the regeneration
check.

Simplify writing using $(file >) instead of $(shell), which doesn't have
character count limitations.

Bug: 35970961
Test: m clean; m -j nothing; m -j nothing; m -j nothing
Test: Ensure clean_steps.mk is equivalent before/after
Change-Id: Id574f416647434ab8d11ed3481da21b55e8797b7
2017-07-24 21:16:38 -07:00
Colin Cross 3a1544ab1a Make JAVA_HOME absolute inside build
Export JAVA_HOME as an absolute path to commands running inside
a build.

Should fix errors invoking gradle from inside a build:
ERROR: JAVA_HOME is set to an invalid directory: prebuilts/jdk/jdk8/linux-x86
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.

Test: treehugger
Change-Id: I16e4482b2d74ede0843715be3b08c65ce33cf403
2017-07-24 19:27:31 -07:00
Colin Cross 45d2ef40f2 Merge "Use java prebuilts" 2017-07-25 00:39:42 +00:00
Steve Muckle 7397b59cca Merge changes I49e4a1a6,I668a396c
* changes:
  fix builds on macOS when kernel modules are used
  package modules.alias onto device
2017-07-24 21:40:21 +00:00
Treehugger Robot 1385e481cd Merge "sepolicy: remove all use of domain_deprecated" 2017-07-24 16:49:25 +00:00
Jeff Vander Stoep 9a8f6775ec sepolicy: remove all use of domain_deprecated
This attribute has been removed from public policy and is no longer
available.

Bug: 38316109
Test: build policy
Change-Id: I3407ced2d725de982e19b77345827de03d93c426
(cherry picked from commit ec488e1fee)
2017-07-24 08:17:39 -07:00
Steve Muckle fb2714e61c fix builds on macOS when kernel modules are used
The mac implementation of sed has different requirements for the -i
option. Instead of using that, just redirect the output to the final
location of modules.dep, since it's being copied in the very next
line anyway.

Bug: 38268091
Test: run build with kernel modules on macOS
Merged-In: I49e4a1a69f01139ef47711ab1223d3a8e5cda568
Change-Id: I49e4a1a69f01139ef47711ab1223d3a8e5cda568
2017-07-21 15:24:51 -07:00
Tri Vo ecf83a839f package modules.alias onto device
Test: device builds and boots, vendor/lib/modules/modules.alias appears
on device.
Merged-In: I668a396ccd11e4eb599e1f6aa2906400ac78f02b
Change-Id: I668a396ccd11e4eb599e1f6aa2906400ac78f02b
2017-07-21 15:24:21 -07:00
Colin Cross 28794da1c0 Merge "Disable desugaring try-with-resources" 2017-07-21 20:48:45 +00:00
Treehugger Robot 5180c3b97b Merge "Look for non-existent files listed in avb_vbmeta_args." 2017-07-21 20:47:01 +00:00
Ivan Lozano b549e826dd Merge "Fix exclusion overriding local integer_overflow." 2017-07-21 20:15:01 +00:00
Tao Bao 9a5f419ecf Look for non-existent files listed in avb_vbmeta_args.
In BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS, if we have defined
"--include_descriptors_from_image" with an image file whose path points
to source tree, add_img_to_target_files.py or sign_target_files_apks.py
may fail to find the file. Because these scripts may run without a
source tree, by taking target_files.zip as the only input.

This CL scans additional locations in the input target_files.zip to find
those missing files in avb_vbmeta_args. As long as the files are included
in the target_files.zip, they get a second chance to be found.

Bug: 63910867
Test: As follows:
 1. Setup BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS with a local file path;
 2. Remove the local file;
 3. sign_target_files_apks.py fails without this CL;
 4. sign_target_files_apks.py works.
Change-Id: I3c58f80a5535db02b74cfe40d0c0beff72587cf8
(cherry picked from commit 1dc5d47653)
2017-07-21 11:57:00 -07:00
Ivan Lozano b4749cb0fc Fix exclusion overriding local integer_overflow.
INTEGER_OVERFLOW_EXCLUDE_PATHS should only apply to the global sanitizer
setting, and should not override local module settings. This pulls out
the check so it occurs earlier and does not interfere with local
settings. This makes Make consistent with Soong's behavior as well.

Bug: 30969751
Test: Created a test build file with this explicitly set, excluded the
path, and checked if it was still being sanitized.

Change-Id: I9020d92bae136b6087d37f71d5337acaefe850b4
2017-07-21 10:53:13 -07:00
Tobias Thierer 40594041f4 Merge "droiddoc: Fix trailing ':' in -classpath, -sourcepath values" 2017-07-21 09:43:30 +00:00
liuchao bb2b4bce5b Enable ubsan check flag in build
Ubsan is currently support ARM/ARM64,
so It's OK to enable the build Flag

Test: build test module with flags in Android.mk:
      LOCAL_SANITIZE := undefined
      LOCAL_SANITIZE_DIAG := undefined

BUG:38250996
Change-Id: I6c640bad67353cc736640b2e3c4a0b1812dde3fc
2017-07-21 02:31:09 +00:00
Colin Cross bf4ac7a82f Disable desugaring try-with-resources
Desugaring try-with-resources is not necessary for platform builds,
and triggers some problems for apps built as part of the platform
that target SDK versions before 19.  Disable all try-with-resource
desugaring.

Bug: 63180735
Bug: 63900665
Bug: 63901645
Test: m -j ANDROID_COMPILE_WITH_JACK=false checkbuild
Change-Id: I98b827aa1e80b43e6eb7b58254c23c7a4f7dc52d
2017-07-20 15:07:22 -07:00
Tobias Thierer 75ebdd6e7d droiddoc: Fix trailing ':' in -classpath, -sourcepath values
full_java_lib_deps has trailing whitespace if $(LOCAL_CLASSPATH)
is empty. Because the calculation of PRIVATE_CLASSPATH was
missing a $(strip ...), this resulted in an (unintentional)
trailing ':' in the values of the -classpath and -sourcepath
arguments to the javadoc tool, which that tool is documented
to interpret as '.' (the working directory).

This CL converts the expression to a call to normalize-path-list,
from definitions.mk, which contains the $(strip ...):

define normalize-path-list
$(subst $(space),:,$(strip $(1)))
endef

After this CL, an empty $(LOCAL_CLASSPATH) no longer gets
misinterpreted as the current working directory.

This issue was minor (it made no difference in practice).

Test: Treehugger
Bug: 62049770

Change-Id: Ia0e3e5657d0fa057fe998515f34bc7b8df5f6f16
2017-07-20 19:46:18 +01:00
Colin Cross e97e69359a Use java prebuilts
Point the make java variables at JDK prebuilts in
prebuilts/jdk/jdk8, add them to the path, and clean up
some old overrides.

Reapplies Ibbeb30fab96e45aedd5bb6d710d1170f85789982 after updating
some more manifests to include the prebuilts.

Bug: 62956999
Test: m -j checkbuild
Change-Id: I9e27aa5cb04d1ed09e43b798e5d654843afc000f
(cherry picked from commit 1931750940)
2017-07-20 15:14:26 +00:00
Tobias Thierer 43440c22dd Merge "Drop obsolete javac -extdirs commandline arg." 2017-07-20 08:17:34 +00:00
Jiyong Park 5ae0097f6f Apks are again allowed to use vendor libs as before
When BOARD_VNDK_VERSION is set, native libs that were labeled as
native:platform are now divided into native:platform and native:vendor
sets depending on their install locations. In order to keep the existing
apks to use all the libraries that they have been using, native:vendor
is also added to the allowed types for apks.

However, in the future when we have vendor SDK and enforce all vendor
apks to use the vendor SDK, we will disallow native:vendor to
app:platform and native:vendor will be allowed only to those vendor apks
(probably labeled as app:vendor).

Bug: 33241851
Test: BOARD_VNDK_VERSION=current m <a vendor lib using vendor jni>
(e.g. ModemDiagnosticSystem in internal master)

Change-Id: I6ad0967ab17f07be9657b58c20fa9b96bd1a342b
2017-07-20 13:48:56 +09:00
Colin Cross 4d69df5191 Merge "Revert "Use java prebuilts"" 2017-07-19 22:44:12 +00:00
Colin Cross 02112900cc Revert "Use java prebuilts"
This reverts commit 1931750940.

Change-Id: I7a99fd6c53d35a2a674f2d60b113a727f3c453ce
2017-07-19 22:42:46 +00:00
Colin Cross 26e1b6d6c2 Merge "Use java prebuilts" 2017-07-19 22:08:48 +00:00
Tobias Thierer 8003d944a1 Merge "Make 'make docs' work on OpenJDK 9 toolchain." 2017-07-19 09:49:33 +00:00
Treehugger Robot cc96704ad2 Merge "Remove JNI_H_INCLUDE from make." 2017-07-19 01:33:50 +00:00
Ivan Lozano ad9dde8a86 Merge "Allow integer_overflow sanitizer path exclusion." 2017-07-19 01:06:28 +00:00
Ivan Lozano 9a82bfdc68 Allow integer_overflow sanitizer path exclusion.
Add support for excluding paths from having integer_overflow applied to
them when using SANITIZE_TARGET=integer_overflow via an
INTEGER_OVERFLOW_EXCLUDE_PATHS make and product variable. This covers
the make side of the change.

Bug: 30969751
Test: Build with SANITIZE_TARGET=integer_overflow
SANITIZE_TARGET_DIAG=integer_overflow
INTEGER_OVERFLOW_EXCLUDE_PATHS=<path> and confirmed this was no
longer being applied to binaries in that path.

Change-Id: I24e328257bc5a7962024c8676a1e23d7d70a8666
2017-07-18 15:14:22 -07:00
Steven Moreland 5d3b159bfb Remove JNI_H_INCLUDE from make.
It's now specified and exported from Soong.

Bug: 63762847
Test: make libraries find their headers

Change-Id: Ica5afe7465d90230628f3a924e929df38d25cdd9
2017-07-18 14:44:21 -07:00
Tobias Thierer 78d2983566 Drop obsolete javac -extdirs commandline arg.
The extension directory defaults to lib/ext and does not
exist by default. Setting it to the empty string de facto
disables this obsolete feature.

AOSP is moving to a hermetic toolchain so this argument
will stop working soon. Further, OpenJDK 9 javac no longer
supports this command line argument when compiling for
-source 1.9 -target 1.9.

This command line argument has been around since the
earliest versions of Android, but is now obsolete.
This CL drops it.

Bug: 63746471
Test: Treehugger
Change-Id: Ia0214c1b192e3ffda10772d777557a81ce346c03
2017-07-18 16:17:15 +01:00
Tobias Thierer 0b05860556 Make 'make docs' work on OpenJDK 9 toolchain.
OpenJDK 9's javadoc tool doesn't support the -bootclasspath
command line option, even with -source 1.8.

Instead, under OpenJDK 9, javadoc needs to be passed a
--patch-module argument to tell it the location of the
classes patching packages from java.* modules.

The source files in libcore/{dalvik,libart,luni,ojluni} and
external/icu/android_icu4j that go into PRIVATE_BOOTCLASSPATH
patch packages from the modules java.base, java.desktop,
java.logging, java.prefs, java.sql, jdk.net, and
jdk.unsupported. However, this CL takes the simpler approach
of placing them all in java.base, which appears to work for
the purposes of the javadoc run.

Test: Ran the following both on OpenJDK 8 toolchain and on
      OpenJDK 9 (with EXPERIMENTAL_USE_OPENJDK9=true):
      rm -rf out/target/common/docs/ && make docs
Test: Compared (via meld) the contents of out/target/common/docs
      for the two toolchains (there were some differences, see bug).
Bug: 62049770

Change-Id: If3dd927477ca32dab7ffb528350de872e1017184
2017-07-18 16:03:35 +01:00
Treehugger Robot c7e3e962f8 Merge "Revert "Use dx.jar directly"" 2017-07-18 07:08:19 +00:00