Commit graph

6839 commits

Author SHA1 Message Date
Dan Willemsen
e9216117dd Add DistPath to reference the dist folder
Instead of open-coding the logic of whether there is one, or where to
find it.

Bug: 76168832
Test: diff out/soong/build.ninja without dist
Test: diff out/soong/build.ninja with dist specified
Change-Id: Ia3f1ef335e2d6e2175343338d04867d778a50300
Merged-In: Ia3f1ef335e2d6e2175343338d04867d778a50300
(cherry picked from commit bc0c509267)
2018-04-17 10:34:23 -07:00
Dan Willemsen
bf4f0a0965 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).

Bug: 76168832
Test: out/soong/build.ninja is identical
Change-Id: I8cb524b09a84d0b8357d7c3501c71270af411e17
Merged-In: I8cb524b09a84d0b8357d7c3501c71270af411e17
(cherry picked from commit 54daaf0371)
2018-04-16 19:27:14 -07:00
Dan Willemsen
0c1f7bd956 Remove obsolete Brillo variable
Unlike the original change on master, this does not remove
product_variables.brillo, as I'm not backporting all of the other
removal CLs.

Bug: 76168832
Test: none
Change-Id: I6a5ce57b317f0cdae1abef15def01e6a31e18d3e
Merged-In: I6a5ce57b317f0cdae1abef15def01e6a31e18d3e
(cherry picked from commit a052599bb6)
2018-04-16 19:27:14 -07:00
TreeHugger Robot
0f7e692fff Merge "Fix module rename inside namespace" into pi-dev 2018-04-17 01:07:32 +00:00
Colin Cross
2071266b28 Fix module rename inside namespace
Rename was expecting fully qualified names, but context.go always
passes it short names.

Bug: 77922456
Test: TestRename in namespace_test.go
Change-Id: I552ff39fd8ed6ba6da4262925060b45104840ff7
Merged-In: I552ff39fd8ed6ba6da4262925060b45104840ff7
(cherry picked from commit eafb10c23a)
2018-04-16 16:06:53 -07:00
Wale Ogunwale
0148f91348 Finalizing P SDK
Bug: 77588754
Test: builds
Change-Id: I07930ba9ca1f8b60a45109c4cc08ed2f17ea19fa
2018-04-12 06:43:59 -07:00
TreeHugger Robot
13a828764c Merge "Fixing protoOutParams concatenation." into pi-dev 2018-04-11 23:02:14 +00:00
Jayant Chowdhary
195f53c0f2 Merge "Add informational message to help with updation of VNDK abi references." into pi-dev 2018-04-10 17:35:27 +00:00
Kweku Adams
62158b433d Fixing protoOutParams concatenation.
ParseGeneratorParameter delimits based on commas, not colons:
external/protobuf/src/google/protobuf/compiler/code_generator.cc

Bug: 72570104
Test: flash device with new build
Change-Id: I00042782a718d288ca6b0cb78f856d0fb223a926
(cherry picked from commit fb5b31ce96)
2018-04-09 12:04:49 -07:00
Jayant Chowdhary
e3ee2f5e67 Add informational message to help with updation of VNDK abi references.
Bug: 64267858

Test: create reference dump for libjpeg; add exported function to libjpeg;
      m -j libjpeg.vendor, build fails with helpful message.

Test: create reference dump for libjpeg; add exported function to libjpeg;
      m -j libjpeg.vendor dist DIST_DIR=dist, build fails with helpful message.

Merged-In: Iae25374fe937a0cbe8a8ddf9e23c3bc1f62bbb2a
Change-Id: Iae25374fe937a0cbe8a8ddf9e23c3bc1f62bbb2a
(cherry picked from commit d8b70a39d1)
(cherry picked from commit 301aa8a8dcb0a92e96ffbf1aa2da3ca49ce2bda9)
2018-04-09 09:46:49 -07:00
Alan Viverette
d95159cb33 Always include JAR dependencies (not just with --static-deps) in Makefile
Bug: 76692459
Test: ./update_current.py -x <build-id>
Change-Id: Ie0f77e52089adbe153d668fe39902545f469f2d2
Merged-In: Ie0f77e52089adbe153d668fe39902545f469f2d2
2018-04-06 13:20:44 -04:00
Ryan Prichard
d2cc96c24a Fix mini_debug_info stripping when no symbols should be kept.
If there are no symbols to keep (i.e. all function symbols are also in
the dynsym table), then the "${outfile}.keep_symbols" file has size 0.
When objcopy parses a --keep-symbols file, it has a special case for
0-sized files where it silently fails (exits with status 1, no error
message). On the other hand, objcopy is happy with a file containing no
symbols, as long as there is some whitespace or a comment. Avoid the
special case by appending a newline to keep_symbols.

Bug: b/62815515
Bug: b/77242617
Test: manual
Change-Id: I90fd3258426176dc18aa5a8c19389c55fe6329c7
(cherry picked from commit afefacf196)
2018-04-04 15:56:28 -07:00
Yifan Hong
d452a42d9d Add overrides to cc_binary
Test: use it for healthd, it is not installed.
Bug: 77541952

Change-Id: I170a31d1b4d15f20de6a6b6279a2eeda49ca7447
Merged-In: I170a31d1b4d15f20de6a6b6279a2eeda49ca7447
2018-04-03 16:15:37 -07:00
Yi Kong
c410909550 [DO NOT MERGE] Switch to clang-4691093
Test: Build/boot marlin, sailfish, x86/arm/arm64 emulators
Bug: 68397894
Change-Id: Ic255b0b578838786f2bf54b53831f151187eaab0
2018-04-02 14:34:24 -07:00
TreeHugger Robot
75c0008d7d Merge "Allow platform modules to link to vendor public libraries" into pi-dev 2018-03-31 00:24:16 +00:00
Logan Chien
6010adbbbb Allow VNDK-SP extensions to use vendor lib
This commit changes the VNDK-SP dependencies check.  With the commit,
VNDK-SP-Ext can link to non-VNDK vendor shared libs.  This commit also
refines the "cc_test" so that more error handling cases are properly
tested.

Before this commit, VNDK-SP-Ext could not depend on vendor libs.  It
was disallowed because there were no correct way to load vendor libs.
The fallback link had to specify the shared lib names.  On the other
hand, adding "/vendor/${LIB}" to search paths will lead to
double-loading issue.

In aosp/595067, "allow_all_shared_libs" was added to bionic dynamic
linker.  Now, we can link the "vndk" namespace to "sphal" namespace.
Thus, like VNDK-Ext, VNDK-SP-Ext can link to vendor libs now.

Bug: 77249955
Test: lunch aosp_walleye-userdebug && make -j8  # runs unit tests
Test: lunch aosp_sailfish-userdebug && make -j8  # runs unit tests
Test: Create a VNDK-SP-Ext, link to vendor libs, and run it.
Change-Id: I5511204539a22c998528111076f46756807faf29
Merged-In: I5511204539a22c998528111076f46756807faf29
(cherry picked from commit d3c59a2b3a)
2018-03-30 13:29:34 +08:00
Jiyong Park
ca700f704f Allow platform modules to link to vendor public libraries
Normally, when building with VNDK, platform modules are not allowed to
link against vendor libraries, because the ABI of the vendor libraries
are not guaranteed to be stable and may differ across multiple vendor
images.

However, the vendor public libraries are the exceptions. Vendor public
libraries are vendor libraries that are exposed to 3rd party apps and
listed in /vendor/etc/public.libraries.txt. Since they are intended to
be exposed to public, their ABI stability is guaranteed (by definition,
though it is up to the vendor to actually guarantee it).

This change provides a way to make a vendor lib as public by defining a
module of type 'vendor_public_library' with a map file that enumerates
public symbols that are publicized:

cc_library {
   name: "libvendor",
   proprietary: true,
   ...
}

vendor_public_library {
   name: "libvendor",
   symbol_file: "libvendor.map.txt",
}

This defines a stub library module named libvendor.vendorpublic from the
map file. `shared_libs: ["libvendor"]` is redirected to the stub library
when it is from the outside of the vendor partition.

Bug: 74275385
Test: m -j
Test: cc_test.go passes
Merged-In: I5bed94d7c4282b777632ab2f0fb63c203ee313ba
Change-Id: I5bed94d7c4282b777632ab2f0fb63c203ee313ba
(cherry picked from commit 374510bcb6)
2018-03-30 12:59:06 +09:00
TreeHugger Robot
be6b6a63f8 Merge "Fix data race on cfiExportsMap" into pi-dev 2018-03-29 04:52:31 +00:00
Colin Cross
fe6edc9a70 Fix data race on cfiExportsMap
cfiExportsMap was reinitialized for every module, which caused
data races.  Create the path from the string on each use
instead.

Bug: 77234104
Test: m nothing with race detector turned on
Change-Id: Ibca3149dcbe8a9d4d9f7ec6dd0b164697e7ae5cd
Merged-In: Ibca3149dcbe8a9d4d9f7ec6dd0b164697e7ae5cd
(cherry picked from commit 1218a19f0d)
2018-03-28 19:18:07 -07:00
TreeHugger Robot
601ab89103 Merge "Fix the flaky build breakage for droiddoc target." into pi-dev 2018-03-29 00:00:35 +00:00
Justin Yun
2497d5f9ce 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
Merged-In: I383c76a36101e39c70575b463880b52d3e9d90bb
(cherry picked from commit 732aa6afdf)
2018-03-28 23:02:41 +00:00
Nan Zhang
2e9f9a2220 Fix the flaky build breakage for droiddoc target.
ExpandSourcesSubDir was calling SourceFileProducer.Srcs(), and then
doing:
moduleSrcs = append(moduleSrcs[:j], moduleSrcs[j+1:]...)
This modifies the backing store of the slice, which may affect the
original data stored in the SourceFileProducer.  Make all Srcs
implementations return slice that points to a copy of the backing
array.

Test: m out/target/common/obj/PACKAGING/checkpublicapi-current-timestamp
Bug: b/76179848 b/76397326
Change-Id: I2432ce196984814daafc5aa9a2746e81de74494c
Merged-In: I2432ce196984814daafc5aa9a2746e81de74494c
(cherry picked from commit e42777a05a)
2018-03-28 14:54:50 -07:00
Jayant Chowdhary
6049368014 Fix omission of llndk libraries during abi dump creation.
We omit vendor unavailable modules. This should not apply to llndk
libraries since currently, we do abi checks on their system variants.

Bug: 77101345

Test: m -j libc creates libc.so.lsdump

Test: m -j libjpeg.vendor creates libjpeg.so.lsdump

Test: m -j external/cblas still does not create libblas.so.lsdump

Merged-In: I5522c1cd471bfba8a1f632270ab2f167b4b17117
Change-Id: I5522c1cd471bfba8a1f632270ab2f167b4b17117
(cherry picked from commit fa920fabda)
2018-03-28 10:10:33 -07:00
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