Commit Graph

4558 Commits

Author SHA1 Message Date
Colin Cross
9a8965007d Remove jarSpec structure
am: 40a3671416

Change-Id: I35f90159217677ebe10851933cd94da686ebd49c
2017-09-29 23:41:45 +00:00
Colin Cross
270499474e Move errorprone dependency to compiled classes jar
am: d689143f1d

Change-Id: If4a4160d5512b5ad6e874f2bf30562c70c52e5c1
2017-09-29 23:41:37 +00:00
Colin Cross
2825cb3f8d Correctly set date and mode fields for MANIFEST.MF
The file header returned by jar.ManifestFileContents had unset
date and mode fields.  The unset date field resulted in the
"Last Mod Time" field in the zip file being set to 0, which
OpenJDK 9's jar implementation treats as an error:
java.time.DateTimeException: Invalid value for MonthOfYear (valid values 1 - 12): 0

Bug: 67095392
Test: zipdetails out/host/linux-x86/framework/tradefed.jar
Change-Id: I0a818d57420f5e5de57e8ff57791951c1b538443
2017-09-29 21:52:58 +00:00
Colin Cross
0f37af0c15 Add java file resources and flag to include sources
Add a properties to allow including files as resources, including
support for filegroups.  Also add a flag that causes module sources
to be included in the final jar.

Test: java_test.go TestResources
Change-Id: Ida8ee59b28df9fe66952170f46470d3a09fd5d65
2017-09-29 14:02:22 -07:00
Colin Cross
8649b2653c Use pre-desugar classes in classpath
Follow the make change in I87aee34940937dbde33a977f55d1faf2c8054561
to use classes before desugar in the classpath.

Test: java_test.go
Change-Id: I1054f4aea1eb349b6f687e1af0adb92a944fd8c5
2017-09-29 14:02:22 -07:00
Colin Cross
59f1bb66ea Only desugar/dx installable libraries
Don't waste time running dx on libraries that will never end up
on the device.

Test: m -j checkbuild
Change-Id: Iad1750823d3261cd6ad6eb6aa00c74d45b9737a3
2017-09-29 14:02:22 -07:00
Colin Cross
40a3671416 Remove jarSpec structure
It's not doing anything anymore, and the next patch will need more
complex jar arguments.  Just remove it.

Test: m -j checkbuild
Change-Id: I96d15995e86263ec04fd5c13ab0fd54d8b85c788
2017-09-29 14:02:22 -07:00
Colin Cross
d689143f1d Move errorprone dependency to compiled classes jar
The resources jar and the combined jar are not always used, so
add the errorprone dependency to the compiled jar.

Test: m -j checkbuild
Change-Id: Iaa10a04347758c676bb704969b86f9442e6c3175
2017-09-29 14:02:22 -07:00
Colin Cross
2f3ea06caa Rename resource_dirs to java_resource_dirs
am: 86a63ff366

Change-Id: I70c4efb0c3a5f63b58f8a2626c77bdcdf30499fd
2017-09-28 23:32:24 +00:00
Colin Cross
86a63ff366 Rename resource_dirs to java_resource_dirs
For consistency with make, rename java resources to
java_resource_dirs and android resources to resource_dirs.

Test: m -j checkbuild
Change-Id: Ie9aac50fef40f6a9093b4b98759e79cd086bb797
2017-09-27 23:21:36 -07:00
Dan Willemsen
773987ac1c Don't use the platform copy of libz
am: bd42549743

Change-Id: Ic1c85b865c8fcbc9c4e397b2ea2c2d4cc303a3a9
2017-09-28 00:58:18 +00:00
Dan Willemsen
bd42549743 Don't use the platform copy of libz
We'll always provide our own.

Test: m nothing
Change-Id: I4749c0fc3ec0922e975fc5f60976bee964ed3d5e
2017-09-27 15:35:29 -07:00
Dan Willemsen
ef1707d08c Merge "Add target.linux_glibc and target.bionic"
am: c2992232ca

Change-Id: I19d1218ce2d285c76be1d23afbe3547489226230
2017-09-27 22:10:03 +00:00
Dan Willemsen
c2992232ca Merge "Add target.linux_glibc and target.bionic" 2017-09-27 22:03:02 +00:00
Dan Willemsen
02218c2844 Add -lm to the default libs for Linux & Darwin
am: 27991b7652

Change-Id: I43e84cf0a2f3b7da56ba308e4bd1e03d5c91a8a7
2017-09-27 07:14:34 +00:00
Dan Willemsen
866b563d4c Add target.linux_glibc and target.bionic
target.linux_glibc will apply to host builds with glibc, which is
identical to the current target.linux. In a future change, target.linux
will change to affect all targets using the Linux kernel (android,
linux_bionic, and linux_glibc).

target.bionic will apply to all OS variants using Bionic.

Bug: 31559095
Test: Add target.linux_glibc, target.bionic sections to an Android.bp, build
Test: m host
Change-Id: I677a67c22fba148fec264132311e355283f9d88d
2017-09-26 22:41:37 -07:00
Dan Willemsen
27991b7652 Add -lm to the default libs for Linux & Darwin
libm is a default library for device builds, so default it for host
builds as well.

Also removes duplicate additions of -ldl, -lpthread, -lm and -lrt.

Test: m host
Change-Id: I8f7e799d48a1f427e48dcfb1d0ccba93c5f9780b
2017-09-26 20:25:09 -07:00
jdesprez
0416ddbbb3 Allow to build Android.bp in tradefed project
am: 1596e6ee11

Change-Id: I667725a3390da21555699e4d95075f854528ddc2
2017-09-27 02:14:28 +00:00
jdesprez
1596e6ee11 Allow to build Android.bp in tradefed project
We want to start using some Soong Android.bp in tradefed so
enabling our project to be seen too.

Test: build a Android.bp target in tradefed
Bug: 66908811
Change-Id: Ia4543fc27d124442912e3a05d7bd3fd2f9850a1f
2017-09-26 16:10:49 -07:00
Colin Cross
b4d7126547 Merge "Remove duplication of bootclasspath in DefaultLibraries"
am: 3bea186bc5

Change-Id: I6ffaed12fdbc5439d783f584b527c8e0042beec8
2017-09-26 01:18:08 +00:00
Treehugger Robot
3bea186bc5 Merge "Remove duplication of bootclasspath in DefaultLibraries" 2017-09-26 01:12:30 +00:00
Nathan Harold
ba232074b1 Merge "Add 10.13 Mac SDK to whitelist"
am: fdb573147e

Change-Id: I7ad6685ab406ce88a32d91f00f9f51750d3e28f1
2017-09-26 00:41:25 +00:00
Treehugger Robot
fdb573147e Merge "Add 10.13 Mac SDK to whitelist" 2017-09-26 00:37:55 +00:00
Dan Willemsen
e423a65eb7 Expose host AvailableLibraries to Make
am: 652b383a3f

Change-Id: Id6e5500fa10ec71f83dd98d9e7b4b194b16bff83
2017-09-25 23:51:52 +00:00
Dan Willemsen
652b383a3f Expose host AvailableLibraries to Make
Test: Check out/soong/make_vars-aosp_arm64_ab.mk
Change-Id: I8410942698f3c142b03a2e1e447c880184ab82bf
2017-09-25 22:00:41 +00:00
Dan Willemsen
7d1681a174 Use python2.7 instead of python2
Ubuntu has both aliases, but Mac only declares python2.7, not python2.

Test: `m sepolicy_tests` on internal master
Change-Id: Ia2b5d2d95195f307befbc1893a465752f14b8a7b
2017-09-25 21:48:34 +00:00
Nathan Harold
01abb0948b Add 10.13 Mac SDK to whitelist
Add the latest Mac SDK to the version
whitelist.

Test: compilation
Change-Id: I86fcbf2bb100a0af6a2cfea62f524a17ba1a67b9
2017-09-24 01:51:26 -07:00
Colin Cross
cb2c92961c Remove duplication of bootclasspath in DefaultLibraries
Don't add bootclasspath libraries as classpath dependencies too.

Test: m -j checkbuild
Change-Id: Icb45e45536ce3babab73f67d281ca593edd4ab7f
2017-09-23 22:36:16 -07:00
Dan Willemsen
92eeebeb22 Merge changes I28a15bcc,I86cccefc
am: 968df27a9c

Change-Id: I7a3f7fe6aaccfb8beae1f8a4305fbe2308cf1764
2017-09-22 19:40:08 +00:00
Treehugger Robot
968df27a9c Merge changes I28a15bcc,I86cccefc
* changes:
  Add (host|host-cross|target)[-<OS>] phony targets when not using make
  Fix mma/mmma when soong is not embedded in make
2017-09-22 19:33:08 +00:00
Pirama Arumuga Nainar
4301618b13 Add PGO support to soong
am: ada83ec0a6

Change-Id: I8816689345af37c155cad8e7156c48415c3dff42
2017-09-21 21:45:57 +00:00
Pirama Arumuga Nainar
ada83ec0a6 Add PGO support to soong
Bug: http://b/63768402
Bug: http://b/65598278

Add support for the 'pgo' property to specify how a module is processed
under PGO.  A sample property is below:

pgo: {
    instrumentation: true, // could be "sampling: true" when supported
    profile_file: "pgo_simple.profdata",
    benchmarks: ["pgo_simple"],
}

1. Runtime profiles can be gathered using "sampling" or
"instrumentation".  Sampling is not supported initially.

2. If 'toolchain/pgo-profiles' project is found,
'toolchain/pgo-profiles/${profile_file}' is passed to the compiler and
linker when building this module.

3. If ANDROID_PGO_INSTRUMENT environment variable is set, and includes a
benchmark in the 'benchmarks' list, appropriate flags (for e.g.
-fprofile-generate for instrumentation) are passed to the compiler and
linker when building this module.

Test: Add example modules that specify the pgo property and verify
appropriate flags and dependencies in the Ninja file.  Some
tests/examples are in https://android-review.googlesource.com/474805

Change-Id: I6242e0c904497a115e367dea6927ba1c4b906355
2017-09-21 12:37:19 -07:00
Colin Cross
71a91f36e3 Merge "Don't generate dex jars for host modules"
am: d685385c6b

Change-Id: I852fed179313dc80eeaa804948b88c1ffb54e4c7
2017-09-21 05:16:56 +00:00
Treehugger Robot
d685385c6b Merge "Don't generate dex jars for host modules" 2017-09-21 05:10:52 +00:00
Colin Cross
dcceaa48bb Merge "Remove android_prebuilt_sdk modules"
am: 5012c81888

Change-Id: Iebbfa1a3fecac0feafa8f8c83d2d051368535aee
2017-09-21 04:47:20 +00:00
Treehugger Robot
5012c81888 Merge "Remove android_prebuilt_sdk modules" 2017-09-21 04:42:19 +00:00
Dan Willemsen
61d88b8fca Add (host|host-cross|target)[-<OS>] phony targets when not using make
Test: m --skip-make host-linux_bionic
Test: m --skip-make host
Change-Id: I28a15bcc690245f1a544a051868340b1dc818bb3
2017-09-20 18:23:32 -07:00
Dan Willemsen
d2e95fb295 Fix mma/mmma when soong is not embedded in make
Now `mma --skip-make` works.

Test: mmma --skip-make external/googletest
Change-Id: I86cccefc3c5174773d185c6e16bc52fe2c2010b3
2017-09-20 18:23:32 -07:00
Colin Cross
a713a6f6bd Don't generate dex jars for host modules
Hostdex support isn't working yet, and we are accidentally producing
a dex jar for host modules, which confuses soong_java_prebuilt.mk.

Test: m -j checkbuild
Change-Id: Ie2c331fa697f49dab23c380a5c6e0490d67c9f74
2017-09-20 18:08:04 -07:00
Dan Willemsen
dbc20c3bed Merge changes from topic "host_bionic"
am: 691ad1490c

Change-Id: I60846275ef5d68a408280a0e86034adb4a8689cc
2017-09-21 00:52:10 +00:00
Treehugger Robot
691ad1490c Merge changes from topic "host_bionic"
* changes:
  Extract the linker and embed it into host bionic binaries
  Add prefix_symbols support to cc_object
  Fix ToolchainClangCflags for host bionic
  Don't add a rpath to the linker
2017-09-21 00:46:41 +00:00
Colin Cross
4a053a938d Fix java sdk tests
am: 2acdae8853

Change-Id: Ic048a6b5666663c4666667a2803b29d31bbdb970
2017-09-20 22:57:49 +00:00
Colin Cross
3bea0a6abd Convert java tests to NewTestArchContext
am: 4c428dfb28

Change-Id: I51ffc977a2b5ce08d36aa44efc3ef7db46c6112a
2017-09-20 22:57:47 +00:00
Colin Cross
58a730c123 Add test infrastructure for running the arch mutator
am: ae4c6180a7

Change-Id: If80851709f4d388524c83a3e6eacb6bda1f38e94
2017-09-20 22:57:40 +00:00
Colin Cross
1bd1cccb64 Initial device java support
am: 6ade34f641

Change-Id: Ia4b3752ef473fea34965c4c0682bcfb8da616013
2017-09-20 22:57:36 +00:00
Dan Willemsen
c77a0b3f9c Extract the linker and embed it into host bionic binaries
The linux kernel requires that the ELF interpreter (runtime linker)
that's referenced by PT_INTERP be either an absolute path, or a relative
path from the current working directory. We'd prefer a relative path
from the binary, similarly to how we handle looking up shared libraries,
but that's not supported.

Instead, extract the load sections from the runtime linker ELF binary
and embed them into each host bionic binary, omitting the PT_INTERP
declaration. The kernel will treat it as a static binary, and we'll use
a special entry point (linker_wrapper) to fix up the arguments passed by
the kernel before jumping to the embedded linker. From the linker's
point of view, it looks like the kernel loaded the linker like normal.

Bug: 31559095
Test: Enable host bionic,
      out/soong/host/linux_bionic-x86/nativetest64/libdemangle_test/libdemangle_test
Change-Id: I8d0aea9790b5e86fcc3ea6e2d00cfa33907e2853
2017-09-20 15:34:33 -07:00
Colin Cross
935981f113 Rearrange manifest file handling in merge_zips and soong_zip
am: 635acc9446

Change-Id: Ieb10e3a688cdcdae700ace71f7c58550c9677025
2017-09-20 22:23:54 +00:00
Colin Cross
fc3674a607 Remove android_prebuilt_sdk modules
Forcing sdk modules to be declared explicitly is unnecessary, just
add the required dependencies on the jar and aidl files.

Test: java_test.go
Change-Id: Ib28bdc1051c5825e7c0efb6adff1f9282675560e
2017-09-20 13:20:45 -07:00
Colin Cross
2acdae8853 Fix java sdk tests
Fix the java module sdk tests, and expand them to cover testing
all classpaths including for the host.

Test: java_test.go
Change-Id: I71be13cc5545f5c4d5b377c4c8de3dccbb09abf9
2017-09-20 13:20:45 -07:00
Colin Cross
4c428dfb28 Convert java tests to NewTestArchContext
Java tests will need to test code inside if ctx.Device() blocks,
switch to using TestArchConfig and NewTestArchContext.

Disable TestSdk for now, just registering modules that depend
on the SDK triggers panics because of previously untested code
that is now executed.

Test: java_test.go
Change-Id: Iff2c814af56cc830327db8d951c4350034c00361
2017-09-20 13:20:45 -07:00