Commit graph

5786 commits

Author SHA1 Message Date
Justin Yun
732aa6afdf Set __ANDROID_API__ for vendor modules 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: I383c76a36101e39c70575b463880b52d3e9d90bb
2018-03-27 08:21:19 +09:00
Martijn Coenen
eab15645fe Add trace flag for cpp/Java AIDL generation.
The AIDL code generator can now include trace code in every generated
AIDL call. We don't want to enable this by default for all interfaces
for two reasons:
1) Potential performance overhead
2) For Java targets, the code depends on @hide APIs in android.os.Trace,
   and I haven't found a clean way to determine whether a target is
   allowed to use @hide stuff in the SDK. LOCAL_PRIVATE_PLATFORM_APIS
   is almost it, but it's not set for the core framework (which is
   exactly one of the things we'd like to trace).

Bug: 74416314
Test: verify correct code is generated when flag is set
Change-Id: Ic6ab8aee3e708207813da3e803911a844ff3e52b
Merged-In: Ic6ab8aee3e708207813da3e803911a844ff3e52b
2018-03-26 09:59:02 +02:00
Jiyong Park
924d35b926 Handle prebuiltDepTag for java modules
When there is a prebuilt java lib defined and there is a java library
with the same name, the reverse dependency from the java lib to the
prebuilt lib is added. However, the java library didn't recognize the
dependency type and causes error. Fixing the problem by not panicking on
such dependency.

Test: m -j
Test: m -j dist DIST_DIR=out/dist ANDROID_BUILDSPEC=vendor/google/build/app_build_spec.mk
Merged-In: I79673b2bb382100e42c5336e8041daa8c86fa857
Change-Id: I79673b2bb382100e42c5336e8041daa8c86fa857
(cherry picked from commit 46dbf9c63e)
2018-03-24 15:12:37 +09:00
Treehugger Robot
8e10408ccf Merge "Use PlatformVndkVersion to find ABI dump by default" 2018-03-23 21:31:27 +00:00
Rahul Chaudhry
fd5059ff10 Merge "Revert "Disable relocation_packer and migrate to SHT_RELR sections."" 2018-03-23 19:45:22 +00:00
Rahul Chaudhry
ccf4f83887 Revert "Disable relocation_packer and migrate to SHT_RELR sections."
This reverts commit fa00dfda13.

Reason for revert: New Build Breakages in git_pi-dev-plus-aosp-without-vendor/aosp_walleye-userdebug and git_pi-dev-plus-aosp/aosp_crosshatch-userdebug

Change-Id: Iec9e695cccc3f206df67f0c01cfd4c2c3023dcec
2018-03-23 19:02:56 +00:00
Treehugger Robot
71bfb262b9 Merge "Disable relocation_packer and migrate to SHT_RELR sections." 2018-03-23 17:28:08 +00:00
Nan Zhang
b8fa197878 Add Python protobuf support.
Python protobuf std libs will be wrapped in final binary/test par file.

Bug: b/70568913
Test: manually create real examples.
Change-Id: I7376ec9175f3e03d1adbd20858a7f74e826387ad
2018-03-22 15:56:51 -07:00
Rahul Chaudhry
fa00dfda13 Disable relocation_packer and migrate to SHT_RELR sections.
Proposal for adding SHT_RELR sections in the generic-abi is at
https://groups.google.com/forum/#!topic/generic-abi/bX460iggiKg

Comparison with relocation_packer for aosp_marlin-userdebug:
$ du -B1 -s */out/target/product/marlin/system
 996958208      base/out/target/product/marlin/system
1008340992      no_pack/out/target/product/marlin/system
 997801984      sht_relr/out/target/product/marlin/system

base contains a build with current settings.
no_pack contains a build with relocation_packer disabled.
sht_relr contains a build with SHT_RELR sections enabled.

relocation_packer was saving 11,382,784 bytes (no_pack - base).
SHT_RELR sections are saving 10,539,008 bytes (no_pack - sht_relr).

Bug: None
Test: Built aosp_marlin-userdebug image, boots on device.
Test: Built aosp_x86_64-userdebug image, boots in emulator.
Change-Id: I448dc95baa4976b68ce2659b80498539426775f9
2018-03-22 15:17:34 -07:00
Colin Cross
628d55d7ef Make zipsync list file output empty if there are no files
The make javac rule uses [ -s srcjar-list ] to decide whether or
not to run javac.  zipsync was putting a trailing "\n" in the
list file, so the file was never empty.  There was one case of a
package that contained no source files (so java-source-list was
empty) and had a res directory with an xml file that declared no
resources (so aapt.jar was created but empty).  The 1-byte
srcjar-list file caused javac to run and error with:
javac: no source files

Test: m checkbuild
Change-Id: I26b394b66bf81e4f5abbd27e4dc06bee1d9420a8
2018-03-22 13:02:39 -07:00
Victor Khimenko
9f66306050 Merge "Make arm_on_x86 symmetric" 2018-03-22 06:13:34 +00:00
Nan Zhang
9cbe677024 Fix the issue for incorrect logic of "no_framework_libs"
Fortunately Android stubs jar generation didn't get affected by this
issue since "framework" and "ext" were explicitly added to the "libs"
property:

https://cs.corp.google.com/aosp-master/frameworks/base/Android.bp?rcl=72fa61b3250529504a9f5dab2e927a0d2e873f58&l=876

Test: m -j android_stubs_current and check the build.ninja to see if
addtional "framework" and "lib" are shwon there.
Bug: b/70351683

Change-Id: I9f1eec0d7f8baff6361efef064b7a09a5b2d4a58
2018-03-21 17:56:39 -07:00
Victor Khimenko
5eb8ec1e72 Make arm_on_x86 symmetric
We only define arm_on_x86 in the x86 code, but sometimes arm code needs
to know that it's working in the emulated mode, too.

Test: CtsRsCppTestCases

BUG=75971275

Change-Id: I99564fbe9aeb284e2f11ffb593b18536a7755ea5
2018-03-21 20:30:54 +01:00
Przemyslaw Szczepaniak
170ab730ec Merge "Add support for renamed kotlin stdlib." 2018-03-21 10:16:19 +00:00
Logan Chien
a8f5158594 Use PlatformVndkVersion to find ABI dump by default
This commit changes "current" to ctx.DeviceConfig.PlatformVndkVersion().
This change make it possible to place ABI dumps in
prebuilts/abi-dumps/vndk/${version} instead of
prebuilts/abi-dumps/vndk/current.

If BOARD_VNDK_VERSION is not specified or is equal to "current",
PLATFORM_VNDK_VERSION (either PLATFORM_SDK_VERSION or
PLATFORM_VERSION_CODENAME) will be chosen.  Currently,
BOARD_VNDK_VERSION is always equal to "current" because both system and
vendor images are built in a single source tree.

In the future, if the system image and vendor images are separately
built in different source trees, BOARD_VNDK_VERSION will be set to other
values and we should respect that value.

Test: Create an ABI dump under
prebuilts/abi-dumps/vndk/${PLATFORM_VNDK_VERSION}, make some ABI
breakages, and see whether the checks are working.

Bug: 76036094
Change-Id: I6242e0c71ebd9acd5c4a3497c67539cb3e6663f3
2018-03-21 14:54:31 +08:00
Nan Zhang
28c68b9a76 Changes *api_filename properties droiddoc.go
Test: check build.ninja, and compare file content.
Bug: b/70351683
Change-Id: I385100f5c5c5354bec04a6435b735e92834a3512
Merged-In: I385100f5c5c5354bec04a6435b735e92834a3512
2018-03-20 11:40:50 -07:00
Przemyslaw Szczepaniak
66c0c4067f Add support for renamed kotlin stdlib.
Added new CompilerProperty flag, rename_kotlin_stdlib, which
allow to build kotlin libraries/binaries that use platform internal
version of kotlin stdlib (com.android.kotlin.*). This way, app-provided
kotlin standard library won't collide with version used internaly.

+ remove kotlinc-build.xml after compilation so it won't end up in the
result jar file

+ remove *.kotlin_module and *.kotlin_bultin filesfrom result jar file.
These files are needed only by kotlin-reflect library and
need more work to support kotlin-stdlib renaming.

Bug: 73281388
Test: java_test.go
Change-Id: Iae7ccb919e2ae9853b3f30f3dd447ebd01a1bed0
2018-03-20 12:55:19 +00:00
Treehugger Robot
bfe65a32bb Merge "Mark generated renderscript header files as implicit outputs" 2018-03-20 08:04:32 +00:00
Colin Cross
80e6054eab Mark generated renderscript header files as implicit outputs
If a generated renderscript header is referenced by a cpp file
clang will insert a depsfile dependency on the header.  If the
generator rule does not include the header as an output, ninja
will not consider the cpp file dirty after the generator runs,
and not rebuild it.  On the next build, it will see that the
timestamp of the generated header is new and consider the cpp
file dirty.

Mark the header files as implicit outputs of the generator.

Bug: 75982985
Test: m libstagefright_mediafilter
      touch frameworks/av/media/libstagefright/filters/saturationARGB.rs
      m libstagefright_mediafilter
      m libstagefright_mediafilter

Change-Id: I3ac899322fe9cae2a6e4171092740339ef844494
2018-03-19 22:44:29 -07:00
Yi Kong
04a0fe3245 Merge "Add opt-in option to turn on ThinLTO caching" 2018-03-19 22:03:15 +00:00
Treehugger Robot
4d693a7a27 Merge "Use armv7a-linux-androideabi for arm device triple." 2018-03-19 20:36:46 +00:00
Colin Cross
21f8080d86 Merge "Replace extract-srcjars.sh with zipsync tool" 2018-03-19 20:33:08 +00:00
Chih-Hung Hsieh
1e7d1bf1c7 Use armv7a-linux-androideabi for arm device triple.
* This is a workaround of llvm LTO bug.
* Keep using current NDK include directory path.
  NDKTriple is default ClangTriple but kept as GccTriple for arm device.

Bug: 72619014
Test: make checkbuild
Change-Id: I5dc63c99760325c60bc2da98fd6a3125cef7267d
2018-03-19 11:19:06 -07:00
Logan Chien
45d4f09f2f Merge changes I406c5bef,Ibde685d7,I1c09412d
* changes:
  Allow VNDK extensions under vendor or device
  Add unit tests for android/neverallow.go
  Extract failIfErrored() to android/testing.go
2018-03-16 01:57:31 +00:00
Colin Cross
436b76564d Replace extract-srcjars.sh with zipsync tool
extract_srcjars.sh uses zipinfo and unzip, which fail with an
error on an empty zip file.  Instead of trying to hack around
this (which is hard to make guarantees for since they are
non-hermetic host tools), replace them with a go tool to unzip
a set of zip files into a directory.

Bug: 73885582
Test: m checkbuild
Change-Id: I151fed347ed5196726e36866ffc27bc831799afb
2018-03-15 16:42:43 -07:00
Colin Cross
1eb9f090e0 Merge "Update turbine command line flags" 2018-03-15 22:39:28 +00:00
Logan Chien
af29bada75 Allow VNDK extensions under vendor or device
This commit allows VNDK extensions (vndk.enabled:true and vendor:true)
to reside under vendor/* or device/*.  VNDK extensions will be installed
into /vendor/lib[64]/vndk[-sp].  It is reasonable for their source being
under vendor/* or device/*.

Bug: 74506774
Test: lunch aosp_walleye-userdebug && make  # runs unit tests
Change-Id: I406c5bef10f5c549371dd978b8ecc16c65a7af4b
2018-03-15 11:02:38 +08:00
Logan Chien
ee97c3ed75 Add unit tests for android/neverallow.go
Bug: 74506774
Test: lunch aosp_walleye-userdebug && make  # runs unit tests
Change-Id: Ibde685d7213713be219681cb039ad58a43d9c377
2018-03-15 11:02:38 +08:00
Logan Chien
4203971351 Extract failIfErrored() to android/testing.go
Bug: 74506774
Test: lunch aosp_walleye-userdebug && make  # runs unit tests
Change-Id: I1c09412d5988dca2cc1c5f041893b313ab1c163a
2018-03-15 11:02:38 +08:00
Colin Cross
924a0aa7d5 Update turbine command line flags
The latest version of turbine requires a -- after the javac
options, and uses multiple --bootclasspath arguments instead
of a javac-style colon separated list.

Test: m javac-check
Bug: 74339924
Change-Id: Ib7096294a43e9bd30abc36751299bfac7879f765
2018-03-13 22:22:49 -07:00
Yi Kong
8aeaa7158a Add opt-in option to turn on ThinLTO caching
Allow developers to enable ThinLTO caching on their local build by
setting USE_THINLTO_CACHE environment variable.

This significantly speeds up incremental ThinLTO builds by caching
intermediate results. An incremental ART build (by `touch
compiler/compiler.cc`) reduced from 01:32 to 00:45.

We put the cache under out/soong/thinlto-cache as the cache can be
valid across different targets, and allows us to set a global cache
pruning policy.

The current cache policy is sufficient for current list of
ThinLTO-enabled projects, we can tune it up/down in the future.

Test: USE_THINLTO_CACHE=true m
Bug: 62839002
Change-Id: I4838fe833a1d8fbc73d743da6d19e3698dc89600
2018-03-12 16:54:58 -07:00
Dan Willemsen
bc0c509267 Add DistPath to reference the dist folder
Instead of open-coding the logic of whether there is one, or where to
find it.

Test: diff out/soong/build.ninja without dist
Test: diff out/soong/build.ninja with dist specified
Change-Id: Ia3f1ef335e2d6e2175343338d04867d778a50300
2018-03-12 15:48:30 -07:00
Dan Willemsen
54daaf0371 Switch PackageContext functions to take a ctx
So that the Path and similar functions can be used directly, without
manually adding something like configErrorWrapper (it just uses it all
the time now).

Test: out/soong/build.ninja is identical
Change-Id: I8cb524b09a84d0b8357d7c3501c71270af411e17
2018-03-12 15:48:26 -07:00
Dan Willemsen
a052599bb6 Remove obsolete Brillo variable
Test: none
Change-Id: I6a5ce57b317f0cdae1abef15def01e6a31e18d3e
2018-03-10 15:29:03 -08:00
Treehugger Robot
9c6bc37da1 Merge "Use xz prebuilt" 2018-03-10 03:00:29 +00:00
Treehugger Robot
8b00247b66 Merge "Remove timestamp based filelist file for tracking Python dependencies" 2018-03-10 00:42:37 +00:00
Treehugger Robot
0b9be36339 Merge "Fetch generated srcs from java libs for droiddoc." 2018-03-09 22:33:27 +00:00
Nan Zhang
1db85407aa Remove timestamp based filelist file for tracking Python dependencies
Each Python module will generate a zip file containing source & data
files. The Python binary will collect all its dependencies and use
merge_zips to merge each zip file to create a final .par file.

Test: m -j checkbuild && real examples:
Bug: b/70568913

Change-Id: I9ff232d461d33e1c06026e7dcb5b124bf02c3ce5
2018-03-09 14:12:48 -08:00
Treehugger Robot
19e62e5ebf Merge "Revert "Fix absolute paths in clang debug output"" 2018-03-09 20:59:33 +00:00
Nan Zhang
b2b33de3c0 Fetch generated srcs from java libs for droiddoc.
api-stubs, system-api-stubs and etc need generated sources and srcjars from "framework",
so add a property that tell module to fetch srcs and srcjars from its
dependency libraries. The libraries in that property has to be in the
module's classpath.

Also add doc_defaults targets.

Bug: b/70351683
Test: m -j
Change-Id: I05831fbcad488037710950e4f05dc8fb2a12f403
2018-03-09 10:53:42 -08:00
Dan Willemsen
8fec83a8b9 Use xz prebuilt
Instead of whichever xz happens to be on the PATH.

Bug: 36130900
Test: prebuilts/build-tools/build-prebuilts.sh
Change-Id: Ic9b66062ca7947f0eca9d839c0864da492d4ef71
2018-03-09 10:53:26 -08:00
Pirama Arumuga Nainar
8aed42c798 Use a versioned profile file if available
Bug: http://b/74395273

Update profile-search logic to look for profile files named
<profile_file>.<arbitrary-version> in the profileProject and use that if
available.  This works around an issue where ccache serves stale cache
entries when the profile file has changed.

Test: touch toolchain/pgo-profiles/art/dex2oat.profdata.foo and check it
gets used.

Change-Id: I3de095c263b952cede25af7d0b63dc7280914d76
2018-03-09 16:05:54 +00:00
Treehugger Robot
e9b02776f4 Merge "Rename stubsjar to stubsSrcjar for droiddoc" 2018-03-09 09:42:29 +00:00
Logan Chien
5a8d428dc7 Merge changes I9bec563c,I34f06abd
* changes:
  RemoveFromList() should remove all matches
  Add unit tests for android/util.go
2018-03-09 08:23:08 +00:00
Logan Chien
7922ab8da6 RemoveFromList() should remove all matches
RemoveFromList() should remove all matches.  Before this commit,
RemoveFromList() only removes the first match.  This commit rewrites
RemoveFromList() so that it will remove all matches.  Besides, a unit
test is written.

Note: aosp/461936 wants to make sure libc.so precedes libdl.so in
DT_NEEDED entries.  However, if there are two "libdl" in shared_libs,
aosp/461936 won't achieve its goal because RemoveFromList() (prior to
this commit) only removes the first "libdl".

Bug: 62815515
Test: Build sailfish and check libstagefright.so
Change-Id: I9bec563cbf800bff4bd508fb21e28869a92cfe56
2018-03-09 13:41:56 +08:00
Dan Willemsen
32a669b01b Use our own TMPDIR
Some people have run into issues where /tmp is on a smaller partition
than their main source tree, and if it fills up (or only has a few GB
free), their builds can start failing.

There may also be a subset of people whose /tmp may be slower than their
out directory -- if they put their src and out trees on a SSD, but keep
/tmp on a spinning HDD.

Bug: 71755844
Test: check out/soong.log for TMPDIR
Test: do a build, watch out/soong/.temp
Change-Id: Ib749ec736ad0f6c8ce7453861a91b3e99ddbd92d
2018-03-08 19:42:00 -08:00
Treehugger Robot
0343d020b3 Merge "Use turbine's native source jar support" 2018-03-09 03:35:22 +00:00
Jayant Chowdhary
7ebe5d10ad Merge "Consider binder bitness while looking for abi references." 2018-03-09 03:11:01 +00:00
Logan Chien
5e877b1a86 Add unit tests for android/util.go
Bug: 62815515
Test: lunch aosp_sailfish-userdebug && make   # runs soong unit tests
Change-Id: I34f06abdc78bfb28af3b5250491bbcddb7595c9b
2018-03-09 10:44:14 +08:00
Nan Zhang
ccff0f78ba Rename stubsjar to stubsSrcjar for droiddoc
Test: m -j core-docs
Bug: b/70351683
Change-Id: I65f310d68a5a940fe88ccce4a22110548c15c306
2018-03-08 17:29:32 -08:00