Commit graph

6866 commits

Author SHA1 Message Date
Victor Khimenko
9c9894febf Merge "Make arm_on_x86 symmetric" into pi-dev 2018-03-28 10:58:26 +00:00
Martijn Coenen
4ed6f97d8f Merge "Add trace flag for cpp/Java AIDL generation." into pi-dev 2018-03-28 06:53:35 +00:00
Victor Khimenko
b11219db87 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: b/75971275

Change-Id: I99564fbe9aeb284e2f11ffb593b18536a7755ea5
(cherry picked from commit 5eb8ec1e72)
2018-03-27 20:06:00 +02:00
Martijn Coenen
22071ca4b4 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-27 07:22:55 +00:00
TreeHugger Robot
f65a99cee1 Merge "Add product_variables.Use_lmkd_stats_log." into pi-dev 2018-03-26 23:14:23 +00:00
Logan Chien
b7515421d1 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

Merged-In: I6242e0c71ebd9acd5c4a3497c67539cb3e6663f3
Change-Id: I6242e0c71ebd9acd5c4a3497c67539cb3e6663f3
(cherry picked from commit a8f5158594)
2018-03-23 16:31:04 -07:00
Rajeev Kumar
423e2db0f9 Add product_variables.Use_lmkd_stats_log.
Bug: 74443701
Test: Tested manually
Merged-In: I512d1a4b5e796b459a7ecdd3649ffd147bcf4cbf
Change-Id: I512d1a4b5e796b459a7ecdd3649ffd147bcf4cbf
(cherry picked from commit 1e6056a380)
2018-03-23 19:47:10 +00:00
Dan Willemsen
b785b61621 Allow proto properties in cc/java_defaults
(cherry picked from commit 6424d17a2d)

Bug: 73175642
Test: Add proto.canonical_path_from_root: true in a cc_defaults
Test: Add proto.canonical_path_from_root: true in a java_defaults
Merged-In: I9ddfc8af0025705a34b6e487225f1f98915054c3
Change-Id: I9ddfc8af0025705a34b6e487225f1f98915054c3
2018-03-22 20:51:04 -07:00
Ivan Lozano
3cc0480d16 Merge "Add minimal-runtime support for integer overflows." into pi-dev 2018-03-22 20:17:38 +00:00
Logan Chien
7921d2d265 Merge changes I406c5bef,Ibde685d7,I1c09412d,I9bec563c,I34f06abd into pi-dev
* changes:
  Allow VNDK extensions under vendor or device
  Add unit tests for android/neverallow.go
  Extract failIfErrored() to android/testing.go
  RemoveFromList() should remove all matches
  Add unit tests for android/util.go
2018-03-22 07:36:51 +00:00
Ivan Lozano
954f430e97 Add minimal-runtime support for integer overflows.
Adds Soong support for -fsanitze-minimal-runtime when using
the integer overflow sanitizers. This makes the crashes due to these
sanitizers less mysterious.

Bug: 64091660
Test: Compiled and checked the generated compiler commands
Test: Checked program that overflows for the abort reason

Change-Id: Ieeceaf6c35c8371592952d3b8b977aefc11601c5
Merged-In: Ieeceaf6c35c8371592952d3b8b977aefc11601c5
(cherry picked from commit 30c5db2f47)
2018-03-21 10:04:53 -07:00
Colin Cross
0a7d85a896 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
Merged-In: I151fed347ed5196726e36866ffc27bc831799afb
(cherry picked from commit 436b76564d)
2018-03-20 11:21:42 -07:00
Colin Cross
f2986f067b Use turbine's native source jar support
Turbine doesn't need extract_srcjars.sh, just pass the source jars
with --source_jars.

Bug: 74339924
Test: m checkbuild
Change-Id: Ie7fe06f5a9f5e29287cf79c2d46b23a676a03d41
Merged-In: Ie7fe06f5a9f5e29287cf79c2d46b23a676a03d41
(cherry picked from commit 6981f658ef)
2018-03-20 11:21:42 -07:00
Logan Chien
24e716e603 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

Merged-In: I406c5bef10f5c549371dd978b8ecc16c65a7af4b
Change-Id: I406c5bef10f5c549371dd978b8ecc16c65a7af4b
2018-03-16 17:45:42 +08:00
Logan Chien
b1ed497ca8 Add unit tests for android/neverallow.go
Bug: 74506774
Test: lunch aosp_walleye-userdebug && make  # runs unit tests

Merged-In: Ibde685d7213713be219681cb039ad58a43d9c377
Change-Id: Ibde685d7213713be219681cb039ad58a43d9c377
2018-03-16 17:45:42 +08:00
Logan Chien
d44aa3b5c8 Extract failIfErrored() to android/testing.go
Bug: 74506774
Test: lunch aosp_walleye-userdebug && make  # runs unit tests

Merged-In: I1c09412d5988dca2cc1c5f041893b313ab1c163a
Change-Id: I1c09412d5988dca2cc1c5f041893b313ab1c163a
2018-03-16 17:45:42 +08:00
Logan Chien
3985402d74 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

Merged-In: I9bec563cbf800bff4bd508fb21e28869a92cfe56
Change-Id: I9bec563cbf800bff4bd508fb21e28869a92cfe56
2018-03-16 17:45:34 +08:00
Logan Chien
3b33eaa1c9 Add unit tests for android/util.go
Bug: 62815515
Test: lunch aosp_sailfish-userdebug && make   # runs soong unit tests

Merged-In: I34f06abdc78bfb28af3b5250491bbcddb7595c9b
Change-Id: I34f06abdc78bfb28af3b5250491bbcddb7595c9b
2018-03-16 17:45:25 +08:00
Jayant Chowdhary
070f605485 Consider binder bitness while looking for abi references.
Binder bitness does not always correlate directly with primary arch, as
assumed earlier. For example: it is possible to have devices with
primary arch 'arm' and use 64 bit binder.

Bug: 74362434

Test: utils/create_reference_dumps.py;
      m -j vndk_package for aosp_arm64_ab, aosp_arm_ab invokes
      header-abi-diff on both arm and arm64 arches.

Test: mm -j64 in system/libhwbinder on troublesome internal target.

Merged-In: Iea0a24b57cdb3033e25b6fe126c5d5d717f45b4e
Change-Id: Iea0a24b57cdb3033e25b6fe126c5d5d717f45b4e
(cherry picked from commit 34ce67d454)
2018-03-12 16:56:03 -07:00
Pirama Arumuga Nainar
fb7f985c84 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
Merged-In: I3de095c263b952cede25af7d0b63dc7280914d76
(cherry picked from commit 8aed42c798)
2018-03-09 13:18:28 -08:00
Stephen Hines
c5a4f3be45 Switch back to clang-4639204.
Bug: http://b/68397894
Test: build/run sailfish.
Change-Id: I4ca7336cacf78d64b5e91d5bd93dedce9b13d91b
2018-03-08 13:36:22 -08:00
TreeHugger Robot
d34ca7f986 Merge "No abi diffing for vndk libraries which are not vendor available." into pi-dev 2018-03-07 21:23:10 +00:00
Jayant Chowdhary
bb0a8bd5ee No abi diffing for vndk libraries which are not vendor available.
Vendor binaries cannot directly link with vndk libraries which are not vendor
available. We don't need them to be abi stable.

Bug: 66301104

Test: cd external/cblas; touch src/cblas_cher.c; mm -j64 does not
      produce an lsdump for libblas, since it isn't vendor available,
      even though it is vndk_enabled: true.

Change-Id: Ib2e1eaa06c4dc2e05623bd7b9aa3a83010f76bd1
Merged-In: Ib2e1eaa06c4dc2e05623bd7b9aa3a83010f76bd1
(cherry picked from commit 22963cda0e)
2018-03-07 11:12:41 -08:00
Pirama Arumuga Nainar
28f56ee5d6 Switch to clang-4630689
Bug: http://b/73127367
Bug: http://b/68659946

These new prebuilts have fixes for the bugs mentioned above.

Test: Build and verify that issues in both bugs above are fixed.
Change-Id: I410a43b70920d509118f8e6fdb012ef6b078d657
Merged-In: I410a43b70920d509118f8e6fdb012ef6b078d657
(cherry picked from commit 4a825ee14a)
2018-03-06 16:45:36 +00:00
Colin Cross
d2fc244b06 Merge changes I6f7d40b7,I25654032 am: 83a495830b am: dfcdeec8b2
am: 4335ca3cd6

Change-Id: I9a9e3adfb61a27fc387f90bf56571ec5dbdf512d
2018-03-03 03:52:06 +00:00
Colin Cross
4335ca3cd6 Merge changes I6f7d40b7,I25654032 am: 83a495830b
am: dfcdeec8b2

Change-Id: Ida245504ae6e7074e800ce809fae12e1d6957ee3
2018-03-03 03:48:25 +00:00
Colin Cross
dfcdeec8b2 Merge changes I6f7d40b7,I25654032
am: 83a495830b

Change-Id: Ie7c908f45fcd7e9d8858e77035700d67cee009fe
2018-03-03 03:38:04 +00:00
Treehugger Robot
83a495830b Merge changes I6f7d40b7,I25654032
* changes:
  add a library to report build numbers without causing rebuilds
  Rewrite symbol_inject to be testable
2018-03-03 03:16:48 +00:00
Jayant Chowdhary
4c26b78183 Disable abi diffs for sanitized variants of modules. am: ea0a2e1928 am: 1ce7bf12b7
am: 2c3225a1ac

Change-Id: I157a6665d1799792472dcf184e125c256ab1fc5a
2018-03-03 03:03:24 +00:00
Jayant Chowdhary
2c3225a1ac Disable abi diffs for sanitized variants of modules. am: ea0a2e1928
am: 1ce7bf12b7

Change-Id: I8f1bb1d97dca7dce25c3fa39a1ba97ff2c86015b
2018-03-03 02:55:28 +00:00
Jayant Chowdhary
1ce7bf12b7 Disable abi diffs for sanitized variants of modules.
am: ea0a2e1928

Change-Id: I790236678fea78c379ab1d7c32e8a5ae2cd0446b
2018-03-03 02:48:21 +00:00
Colin Cross
86803cfe6e add a library to report build numbers without causing rebuilds
Allow native modules to specify use_version_lib, which will make
an android::build::GetBuildNumber() function available.  For host
builds, the function will return the build number at the time that
the module was linked.  For device modules it will return the
value of the ro.build.version.incremental property.

Bug: 71719137
Test: build_version_test
Test: m build_version_test && touch build/make/core/Makefile build/soong/cc/libbuildversion/tests/build_version_test.cpp && m build_version_test shows different build numbers for binary and library tests.
Change-Id: I6f7d40b7574bb8206866c4e39bad9c710c796e32
2018-03-02 16:55:51 -08:00
Colin Cross
8673b5b959 Rewrite symbol_inject to be testable
Parse the machine-specific symbol tables into a custom symbol table
object and use a single function to find the offset and size of the
symbol in the custom table.  Make the functions to convert a
machine-specific symbol table into the custom table also take mocks,
and provide functions to dump mocks from real files.  Add tests
that take the mocks and verify they produce the right offset and
size.

Test: cmd/symbol_inject/*_test.go
Change-Id: I25654032b5017dd13a9a1fe29f8b8826ce5bc82b
2018-03-02 16:47:13 -08:00
Jayant Chowdhary
ea0a2e1928 Disable abi diffs for sanitized variants of modules.
asan variants can sometimes have extra exported symbols (this is a vndk
extension violation). Since asan variants are only used for testing,
don't do abi diffs for them.

Bug: 66301104

Test: Without the change, libc++.so.lsdump exists for the asan variant;
      with the change, it does not.

Test: make -j64.

Change-Id: I61a4c7a3e9aa0028a54ad0ca8715e8c77aebad94
2018-03-02 22:13:15 +00:00
Jayant Chowdhary
8b9897b143 Create a make variable for all lsdump files. am: dcd33b6c29 am: eccf4774b1
am: 3f6efacf22

Change-Id: I9ce27eeeb7748a8ac289bebbbd8f5fca3e41c771
2018-03-02 02:01:35 +00:00
Jayant Chowdhary
aa05ae5521 For abi diffing, factor in arch variant and primary arch. am: ac066c6b90 am: 1bb2bac825
am: 4486c87ccb

Change-Id: I706b4d853a8220788e9acd39cb11f37be95e9754
2018-03-02 02:01:27 +00:00
Jayant Chowdhary
3f6efacf22 Create a make variable for all lsdump files. am: dcd33b6c29
am: eccf4774b1

Change-Id: I656f89e51ba05322e0f5603e500cc41e3cb6e75e
2018-03-02 01:55:07 +00:00
Jayant Chowdhary
4486c87ccb For abi diffing, factor in arch variant and primary arch. am: ac066c6b90
am: 1bb2bac825

Change-Id: Iaa18d9e58082ab2b78d4dadd4c73c5762f65a7b2
2018-03-02 01:54:57 +00:00
Jayant Chowdhary
eccf4774b1 Create a make variable for all lsdump files.
am: dcd33b6c29

Change-Id: Id08bc4331950a9198705f7fcbcb171e731e89965
2018-03-02 01:50:09 +00:00
Jayant Chowdhary
1bb2bac825 For abi diffing, factor in arch variant and primary arch.
am: ac066c6b90

Change-Id: Ifb7df61cee156e4578bf8af90b7d9263335c4448
2018-03-02 01:50:05 +00:00
Jayant Chowdhary
dcd33b6c29 Create a make variable for all lsdump files.
This is needed so that we can embed the paths of lsdump files in a file,
in order to make lookup faster, while creating reference dumps.

Test: mm -j64 in external/libjpeg-turbo for aosp_arm64_ab;
      out/soong/make_vars-aosp_arm64_ab.mk contains
      SOONG_LSDUMP_PATHS := <list of lsdump paths>

Change-Id: I04608429e1add307cc1ee79d2f0c348fb041613c
2018-03-01 17:19:25 -08:00
Jayant Chowdhary
ac066c6b90 For abi diffing, factor in arch variant and primary arch.
binder_size_t has a different size for builds with different primary
arches.

Also maintain seperate reference dumps for different arch variants,
since different cflags may be legally specified for them (similar to
what GSI does)

Test: create reference dump for libjpeg at
      prebuilts/abi-dumps/vndk/current/arm64/arm64_armv8-a/source-based/libjpeg.so.lsdump.gz
      mm -j64; header-abi-diff gets invoked.

Change-Id: I55eae4d4811c9754fe8dbd1009c7929fea119eeb
2018-03-01 17:19:25 -08:00
Dan Willemsen
f66010de07 Turn GlobFiles into a Glob for files, use it am: 540a78c1ce am: f49ff89266
am: a7070c158c

Change-Id: I06f6cc4481f826de7f7923630c2de344c84603a6
2018-03-02 00:29:39 +00:00
Dan Willemsen
a7070c158c Turn GlobFiles into a Glob for files, use it am: 540a78c1ce
am: f49ff89266

Change-Id: I291699269cdf463bd6ccbf0ed6cdda67cfb3a298
2018-03-02 00:24:07 +00:00
Dan Willemsen
f49ff89266 Turn GlobFiles into a Glob for files, use it
am: 540a78c1ce

Change-Id: Ia5811eb2fe2db20d4ab8e554341b875392cc345a
2018-03-02 00:18:04 +00:00
Dan Willemsen
540a78c1ce Turn GlobFiles into a Glob for files, use it
GlobFiles had allowed results to be anywhere in the source tree,
restrict it to results within the current module directory.

Then use it for ExpandSources and other places where we only want files.
This fixes using '*' in cc_test's `data` property, which can only
support files.

The only thing this changes today is that java_resource_dirs and
java_resources no longer pass directories to soong_zip's -f argument.
core-libart previously added some icu directories, now it only passes
files.

Bug: 71906438
Test: only expected changes in out/soong/build.ninja
Test: add data: ["**/*"] to a cc_test, build successfully
Change-Id: Iff1bd8c005a48e431c740706d7e23f4f957d8b1d
2018-03-01 14:05:20 -08:00
Dan Willemsen
003e0f3d2a Merge "Add droiddoc_template" am: f6366cc0a1 am: 1ba2989d4f
am: 6f535b5476

Change-Id: I83324c0727741921d549b4435916b98087b07a83
2018-03-01 18:16:27 +00:00
Dan Willemsen
6f535b5476 Merge "Add droiddoc_template" am: f6366cc0a1
am: 1ba2989d4f

Change-Id: Id872ecbf0e3ad835b89a171000938789aaf0a3c0
2018-03-01 18:10:16 +00:00
Dan Willemsen
1ba2989d4f Merge "Add droiddoc_template"
am: f6366cc0a1

Change-Id: I0b977eea1f67813615ca3eadb02bb4456f0abf3e
2018-03-01 18:04:47 +00:00
Dan Willemsen
f6366cc0a1 Merge "Add droiddoc_template" 2018-03-01 17:53:25 +00:00