Commit graph

3981 commits

Author SHA1 Message Date
Pirama Arumuga Nainar
6aeed8b439 Add enable_profile_use property
Bug: http://b/65598278

This property defaults to 'true' and setting it to false skips profile
use.  This escape hatch lets us disable PGO for a module without
completely removing the 'pgo' property.  Additionally, this also helps
selectively disabling PGO for some architectures, if desired.

Test: Test that -fprofile-use is not added for a test module if
'enable_profile_use: false' is set.

Change-Id: Ifcf1a48c194bc86efd88a529cc2d66a47b7ab080
2017-10-16 13:36:29 -07:00
Pirama Arumuga Nainar
0fdfc459cf Do not use profiles if ANDROID_PGO_NO_PROFILE_USE is set
Bug: http://b/65598278

Non-PGO builds (with this environment variable set) can be used to
measure the performance difference induced by PGO.

Test: Build PGO modules with ANDROID_PGO_PROFILE_USE set.
Change-Id: Ib23bad5208ac7f54894c7768d7532f53b6b91179
2017-10-10 15:41:25 -07:00
Pirama Arumuga Nainar
3f5bb9c89b Refactor methods to be on PgoProperties struct
These methods only need the 'PgoProperties' struct.  Avoid the extra
indirection by directly using this struct.

Test: Build modules with PGO property.
Change-Id: I1923ebde4b0d546810de8e696514d218b3a4f54b
2017-10-10 10:58:37 -07:00
Dan Willemsen
89479facb9 Get some more debugging for ckati crashes
The crash we're following is likely a stack overflow. Use an alternate
stack to actually get the backtraces.

Also write out ulimit to reference what the stack size should be.

Bug: 36182021
Test: ulimit -s 768; build/soong/build_test.bash
Change-Id: I8826e5e53f38af552c8b80a1a8a490fde55f2d4b
2017-10-10 01:31:21 +00:00
Treehugger Robot
2675f5648b Merge changes I5400e4b0,Ia6760b01,I8a076c99
* changes:
  Add test for java generated sources
  Fix doubled generated source files
  Fix mixing genrule dependencies with globs
2017-10-10 01:14:49 +00:00
Colin Cross
54190b3b13 Add test for java generated sources
Bug: 67364649
Test: TestGeneratedSources
Change-Id: I5400e4b013dc47c04b9d32787e50c5281033484d
2017-10-09 15:36:06 -07:00
Colin Cross
52b1e4cf06 Fix doubled generated source files
Generated source files were being included twice, once manually
and once by ctx.ExpandSources.  Remove the manual one.

Bug: 67364649
Test: TestGeneratedSources in later patch
Change-Id: Ia6760b01a34a96767a914bdcb911a39fa6683300
2017-10-09 15:35:57 -07:00
Colin Cross
05a39cbacc Fix mixing genrule dependencies with globs
Putting a genrule dependency after a glob in a srcs property
was causing the generated files to be treated as globbed files
and hitting an interface conversion panic.

Bug: 67364649
Test: TestGeneratedSources in later patch
Change-Id: I8a076c9998fdd07e53769922be433a793ca575a9
2017-10-09 15:35:47 -07:00
Jeff Gaston
4ddac411cb Merge "have build_test.bash work when run as ./build_test.bash" 2017-10-09 18:33:00 +00:00
Treehugger Robot
29b41ed830 Merge "multiproduct_kati: Support skipping known-broken products" 2017-10-07 00:38:27 +00:00
Jeff Gaston
e2128d3468 have build_test.bash work when run as ./build_test.bash
Test: ./build_test.bash
Bug: 67478260

Change-Id: I027dcf7505def2253b9e41721aa6c226239f69c7
2017-10-06 15:52:36 -07:00
Dan Willemsen
9957b9ccdc multiproduct_kati: Support skipping known-broken products
This can make it easier to add build/soong/build_test.sh to continuous
build branches to catch new breaks, but where some products are known to
be broken.

Test: build/soong/build_test.bash --skip-products aosp_arm,aosp_arm64
Change-Id: Ib240570b68957077047ca75b78658429cb8c6a49
2017-10-06 15:05:05 -07:00
Treehugger Robot
1658f994ec Merge "Add usage message to androidmk" 2017-10-06 21:31:19 +00:00
Dan Willemsen
9d93e33b1e Merge "Add target.linux for linux kernel based targets" 2017-10-06 19:43:34 +00:00
Jeff Gaston
4b9ef72fe2 Add usage message to androidmk
Test: androidmk 2>&1 | grep usage && androidmk --help 2>&1 | grep usage && echo ok
Bug: 67426255
Change-Id: I1e5033321c62c6744672f2ea435a422a4b9bd3da
2017-10-06 11:48:44 -07:00
Treehugger Robot
c7ba6a2e46 Merge "Use correct flags for host-side assembly" 2017-10-06 11:48:24 +00:00
Treehugger Robot
ac1c64e2f3 Merge "Use prebuilts/jdk/jdk9 if EXPERIMENTAL_USE_OPENJDK9 is set" 2017-10-06 04:34:52 +00:00
Treehugger Robot
a221b16e02 Merge "Correctly add dependencies to java_resource_dirs files" 2017-10-06 00:56:19 +00:00
Treehugger Robot
9d7bee729a Merge "Honor resource exclusions in java_resources properties" 2017-10-06 00:54:19 +00:00
Colin Cross
e2ad230989 Use prebuilts/jdk/jdk9 if EXPERIMENTAL_USE_OPENJDK9 is set
Bug: 62123342
Test: m -j EXPRIMENTAL_USE_OPENJDK9=1.8 checkbuild
Change-Id: I2a5a0f0962bca050a087340f7c6a262448c54a94
2017-10-06 00:08:46 +00:00
Treehugger Robot
c21d11850d Merge changes I5f6f3da7,Ia37b8b93,Ie79a2e78
* changes:
  Get dex jar resources from classpath jar
  Add -stripFile argument to merge_zips
  Change default jar time to match ziptime
2017-10-05 23:20:17 +00:00
Colin Cross
647aa4f009 Allow full protos in host modules
Test: m -j checkbuild
Change-Id: I9dd076fea3e0544b8bdeeac9b040a8ee9d818715
2017-10-05 20:56:51 +00:00
Greg Hartman
09302bee38 Use correct flags for host-side assembly
BUG: 67434336
Test: Built libjpeg-turbo, confirmed flags
Change-Id: I54c1cc968d0a08d3a221ef4c46f2572269420c6a
2017-10-05 13:08:28 -07:00
Pirama Arumuga Nainar
6fc8d9126c Check if "instrumentation" and "sampling" are set together
Setting these simultaneously is an error.

Test: Check error generation in a test module

Change-Id: I2ee127fa1b7157fa5f4489d2541ff023c64f9ba5
2017-10-05 10:33:57 -07:00
Pirama Arumuga Nainar
49b53d5c7c Explicitly link the profile runtime during PGO
Bug: http://b/65598278

The profile runtime depends on libgcc for some symbols (only under some
circumstances - armv5, ndk r14, static executables).  Since Android
build passes -nostdlib and adds libgcc manually, the profile runtime
gets passed to the linker later than libgcc.

Instead, explicitly add the profile runtime to the linker command (and
pass one other flag added by the clang driver to the link).

Test: Build a library with profile instrumentation that otherwise fails
instrumented build.

Change-Id: I24b34cebd2c3bb6a540f8f4c465ace1be4eb90f3
Signed-off-by: Pirama Arumuga Nainar <pirama@google.com>
2017-10-04 22:25:19 -07:00
Colin Cross
af9c55b780 Correctly add dependencies to java_resource_dirs files
java_resource_dirs was using a file list file that was generated
at ninja time to get the list of files to include, which meant
there were no dependencies on the files to cause res.jar to get
rebuilt.  Switch to using a glob at soong time instead.  This
is substantially similar to a glob in java_resources, except that
java_resource_dirs strips the listed directories off the paths
that end up in the jar.

Test: TestResources in java_test.go
Change-Id: I4b9b38f7b6b38a013cbb4e211187e7282a6795c0
2017-10-04 17:19:43 -07:00
Colin Cross
2372923fe0 Honor resource exclusions in java_resources properties
Honor the default resource exclusions in java_resources properties
including *.java.

Test: m -j checkbuild
Change-Id: Ia117a000680161b54c189758926ddb2068a2a2c3
2017-10-04 17:19:43 -07:00
Colin Cross
7db5d6332f Get dex jar resources from classpath jar
Dex jars were getting their resources from the res.jar files of
their transitive static dependencies.  This accidentally bypassed
jarjar on resources, since the jarjar pass only happened once the
resources jar was combined into the classpath jar.  Switch to
getting the resources out of the classpath jar by merging it
with the dex jar while skipping *.class.

Test: m -j checkbuild
Test: compare ext.jar to one generated by make
Change-Id: I5f6f3da738dcb0af56ab9a1bd7174ed5359de2b2
2017-10-04 17:19:43 -07:00
Colin Cross
0cf45cdc1e Add -stripFile argument to merge_zips
Putting resources in dex jars is going to need to pull files from
classpath jars that do not match *.class.

Test: m -j checkbuild
Change-Id: Ia37b8b9387e5f5636769afc6937b9aa3c9ec1ced
2017-10-04 17:19:43 -07:00
Colin Cross
bddcf13555 Change default jar time to match ziptime
Ziptime uses Jan 01 2008, use the same in soong_zip and merge_zips.

Test: manual
Change-Id: Ie79a2e7864a5ed5a74833caec0a50c25a451859e
2017-10-04 17:19:43 -07:00
Jeff Gaston
60e38b613f Merge "Revert "Some clarifications in preparation to automatically order linker dependencies"" 2017-10-04 21:09:29 +00:00
Jeff Gaston
7b6118be6b Revert "Some clarifications in preparation to automatically order linker dependencies"
This reverts commit 2370af0e23.

Reason for revert: New Build Breakage: aosp-master/aosp_arm64_ab-userdebug @ 4376965

Change-Id: Ibe4b819c4292457c454bf42e6d94fba3071ec04b
2017-10-04 21:07:42 +00:00
Jeff Gaston
2ade0243ae Merge "Some clarifications in preparation to automatically order linker dependencies" 2017-10-04 17:45:40 +00:00
Colin Cross
c157a8d0e5 Allow libraries with no sources to be installed
Libraries with no source files but static lib dependencies should
still be installable.

Test: m -j checkbuild
Change-Id: Ibc91aa3153241092ce86888dbf90e99b66069ff2
2017-10-04 15:00:27 +00:00
Colin Cross
8b30a5599d Merge "Fix bootclasspath for host variants of java_library modules" 2017-10-04 14:43:10 +00:00
Pirama Arumuga Nainar
c144b86014 Merge "Pass -Wno-backend-plugin when using profiles" 2017-10-04 05:55:14 +00:00
Colin Cross
965714f139 Fix bootclasspath for host variants of java_library modules
The partial hostdex support was causing the host variant of
java_library modules to depend on core-oj and core-libart,
which caused the tagsoup jar to use the wrong
java.lang.System.arraycopy signature.  Remove the hostdex
code that was causing the problem, and add a test.

Test: java_test.go
Change-Id: I4f7b1f29c99aae328ba19b042538d9d35544aa43
2017-10-04 05:50:00 +00:00
Jeff Gaston
2370af0e23 Some clarifications in preparation to automatically order linker dependencies
Test: Browse the code and determine whether it's easier to understand
Bug: 66260943
Change-Id: Ia3fdb8f38e83ad8225a72c8de2804db23a90ef9b
2017-10-03 17:18:01 -07:00
Colin Cross
19ab372dd8 Merge "Add support for .proto files in java modules" 2017-10-03 23:02:51 +00:00
Dan Willemsen
86fc1ebac3 Add target.linux for linux kernel based targets
This includes android, linux_bionic, and linux_glibc currently.

Test: m nothing
Change-Id: I088eab583eee695c1f61a65a79a302837e5f4577
2017-10-03 14:44:06 -07:00
Pirama Arumuga Nainar
f4c0baf317 Pass -Wno-backend-plugin when using profiles
Bug: http://b/63768402

Wno-backend-plugin warnings are generated by IR-based PGO when sources
evolve and the profiles become stale.  Disable these warnings when
profiles are passed to the compiler.

Test: Build a module with a PGO property when profiles are used.
Change-Id: I462bbf55aafd8770a90c2c23462bf71607ac9108
2017-10-03 14:35:18 -07:00
Dan Willemsen
5746bd481e Remove target.linux
Once this is submitted and we don't have any more references to
target.linux, it can be added back as a common target for all
linux-kernel based targets.

Test: m nothing
Change-Id: Iae5e82eaed65f58950115f21530ae04afd0602b9
2017-10-03 19:44:54 +00:00
Colin Cross
6af17aa022 Add support for .proto files in java modules
Test: m -j checkbuild
Change-Id: Ia03429948baebff85164a91a34507866c97a08ef
2017-10-03 10:25:15 -07:00
Colin Cross
47ff2521c6 Relax SDK checks for unbundled builds
Unbundled builds might not have the prebuilt/sdk files, allow
the build to continue and then fail if the module is actually
built.

Test: m -j checkbuild
Change-Id: I21163778f1cc50945c7a12e57da0e39ba963aa7c
2017-10-02 23:18:32 -07:00
Colin Cross
d5934c8bb7 Fix arch specific properties for java modules
Arch specific properties were not being applied to modules
with OS set to Common.

Test: java_test.go
Change-Id: I8f1b49ca51b0cf96f78006dfcd121672e581d9c5
2017-10-02 23:18:19 -07:00
Colin Cross
a60ead85fc Make java_library_static uninstallable by default
Static libraries are not dexed and are not installable on a
device.

Test: m -j checkbuild
Change-Id: Iea01df381e6c8cf2439fdb87200895db6aac99e2
2017-10-02 23:01:02 -07:00
Treehugger Robot
e81315b3b8 Merge "Fix excluding resource directories" 2017-10-03 04:15:27 +00:00
Dan Willemsen
9bc52012c1 Merge changes from topic "linux_glibc"
* changes:
  Change androidmk to use linux_glibc instead of linux
  Rename target.linux[_x86[_64]] to target.linux_glibc[_x86[_64]]
2017-10-03 02:30:07 +00:00
Colin Cross
0532fb0d4c Fix excluding resource directories
Using a glob as a path failed the existence check.  Append the
glob after converting the path to a string.

Test: TestExcludeResources in java_test.go
Change-Id: Ic1fd40aa283f3b0d59c1c589dbeec411583eddf1
2017-10-03 02:13:16 +00:00
Treehugger Robot
5a727dfa11 Merge "Add no_framework_libs property" 2017-10-03 01:39:13 +00:00