Commit graph

5968 commits

Author SHA1 Message Date
Dan Willemsen
3d60b115a0 Allow boards to turn overriding commands into an error
Many board still have this problem, but if we can switch some over,
we'll prevent global problems and have the ability to clean boards up
one-by-one.

Bug: 77611511
Test: lunch aosp_arm-eng; m nothing
Test: lunch aosp_marlin-eng; m nothing
Test: build_test on all downstream branches
Change-Id: I78bee44adde2059d01188658b9050927748d2028
2018-04-05 16:23:10 -07:00
Treehugger Robot
51ba4a7970 Merge "Add vintf_fragments." 2018-04-05 23:09:14 +00:00
Treehugger Robot
fdc24d2f91 Merge changes I3079cb4e,I55a786e9
* changes:
  Have pom2mk list all duplicates modules
  Have pom2mk include runtime deps too
2018-04-05 21:10:31 +00:00
Steven Moreland
57a23d2f20 Add vintf_fragments.
Bug: 66917623
Test: fragments are loaded in the right place
Test: boot device which is depending on fragments
Test: androidmk file which uses LOCAL_VINTF_FRAGMENTS properly
    converted
Change-Id: I366b731cf8d5ecf51851866f441ff1c517da75cf
2018-04-05 20:33:01 +00:00
Jayant Chowdhary
bc30a77591 Merge "Add informational message to help with updation of VNDK abi references." 2018-04-04 23:40:06 +00:00
Treehugger Robot
4c65916c4e Merge "Fix mini_debug_info stripping when no symbols should be kept." 2018-04-04 04:28:52 +00:00
Yifan Hong
946e32e184 Add overrides to cc_binary
Test: use it for healthd, it is not installed.
Bug: 77541952

Change-Id: I170a31d1b4d15f20de6a6b6279a2eeda49ca7447
2018-04-03 16:02:29 -07:00
Ivan Lozano
a9255a8378 Support integer_overflow static lib diagnostics.
This extends the minimal runtime dependency mutator to allow signed
and unsigned integer overflow diagnostics in static libraries and
binaries. This also enables the integer_overflow flag for static
libraries and binaries.

Note compilation will fail if the static library is a dependency
of a Make module that does not also have diagnostics enabled.

Bug: 66952339
Bug: 73283972
Test: make SANITIZE_TARGET{,_DIAG}=integer_overflow
Test: Enabled diagnostics in a static lib, saw results in logcat.
Test: Checked showcommands output for ubsan runtime library inclusion.

Change-Id: Ic52881a0f74cdcac0e4a15335df493b59b002ae5
2018-04-02 12:54:52 -07:00
Jayant Chowdhary
d8b70a39d1 Add informational message to help with updation of VNDK abi references.
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.

Change-Id: Iae25374fe937a0cbe8a8ddf9e23c3bc1f62bbb2a
2018-03-30 11:08:00 -07:00
Logan Chien
d3c59a2b3a 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
2018-03-30 11:46:26 +08:00
Treehugger Robot
01b715e94e Merge "Allow platform modules to link to vendor public libraries" 2018-03-30 03:41:22 +00:00
Vishwath Mohan
f895051c85 Merge "Revert "Change PRODUCT_CFI_INCLUDE_PATHS to opt-out (Soong)"" 2018-03-30 02:58:32 +00:00
Vishwath Mohan
3af8ee0288 Revert "Change PRODUCT_CFI_INCLUDE_PATHS to opt-out (Soong)"
This reverts commit 289d548c3e.

Change-Id: Ic284687157d5cb4122899c84a37c5db507aaee2a
2018-03-30 02:55:23 +00:00
Jiyong Park
374510bcb6 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
Change-Id: I5bed94d7c4282b777632ab2f0fb63c203ee313ba
2018-03-30 10:22:52 +09:00
Treehugger Robot
3ab49a2927 Merge "Change PRODUCT_CFI_INCLUDE_PATHS to opt-out (Soong)" 2018-03-29 22:55:35 +00:00
Jeff Gaston
af2191e201 Have pom2mk list all duplicates modules
For easier debugging if there are multiple duplicates

Bug: 76692459
Test: ./update_current.py -x <build-id>

Change-Id: I3079cb4ed1cfd365d792a7b41c9cdb4e7a1e148f
2018-03-29 17:44:36 -04:00
Jeff Gaston
8f08482957 Have pom2mk include runtime deps too
It still excludes test deps though

Bug: 76692459
Test: ./update_current.py -x <build-id>

Change-Id: I55a786e9feab31f99b95b7cebe84869757e46270
2018-03-29 17:44:33 -04:00
Ryan Prichard
b1703659a8 Use Soong modules for the NDK's extra STL libraries
* The extra STL libs are:

       libc++abi.a [needed for ndk_libc++_static]
       libandroid_support.a [always needed in NDK r16]
       libunwind.a [needed for ARM32]

 * The existing STL-dependency logic in linkShared only applies to shared
   libraries. By moving it to STL deps, the extra STL libs are linked into
   both shared libraries and executables.

 * Remove the ndk_prebuilt_library/ndkPrebuiltLibraryFactory module type,
   which is unused now.

 * Reuse the ndk_prebuilt_static_stl module type to describe the extra
   static libraries that are linked with both the static and shared libc++
   STLs.

Bug: b/73133405
Test: manual
Change-Id: I3f73e4f882d39e6efa470073bb4fc8c42dff8253
2018-03-29 21:26:06 +00:00
Vishwath Mohan
289d548c3e Change PRODUCT_CFI_INCLUDE_PATHS to opt-out (Soong)
This CL changes PRODUCT_CFI_INCLUDE_PATHS to be included in all
product configs by default. To maintain the status quo, the sanitizer
logic has been modified to only respect this product config for Arm64
devices (where this was previously enabled).

Bug: 63926619
Test: m -j60 # the device still has CFI enabled thanks to the default
opt-in

Change-Id: Ia613aec545ad3e544dea41a6dbdb4112aef4afab
2018-03-28 20:30:05 -07:00
Ryan Prichard
afefacf196 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
2018-03-29 01:39:13 +00:00
Jiyong Park
2d4929464b Link type check for Android.bp defined Java modules
Link-type is also checked among Java modules defined in Soong. Until
now, the check has been done in between Soong/Make and Make/Make.

With this, a Java module can't depend on another Java module built with
larger API surface. For example, a java library built with Android SDK
(sdk_version: "current") can't link to a library built without SDK.

Bug: 73829976
Test: m -j

Change-Id: I64277be6e65e8535aad951b4f08f8d10b67abe66
Merged-In: I64277be6e65e8535aad951b4f08f8d10b67abe66
(cherry picked from commit f3586661e8)
2018-03-28 16:20:15 -07:00
Colin Cross
1218a19f0d 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
2018-03-28 16:19:50 -07:00
Colin Cross
f46e37f5f7 Fix format string issues
Fix issues caught by go vet.

Test: m checkbuild
Change-Id: Ib8d740457c15432dabe1575a6707726ddaf93084
2018-03-28 15:54:52 -07:00
Alan Viverette
2b53a0c4b8 Always include JAR dependencies (not just with --static-deps) in Makefile
Bug: 76692459
Test: ./update_current.py -x <build-id>
Change-Id: Ie0f77e52089adbe153d668fe39902545f469f2d2
2018-03-28 14:32:10 -04:00
Nan Zhang
e42777a05a 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
2018-03-28 05:12:15 +00:00
Treehugger Robot
215cedde6a Merge "Fix omission of llndk libraries during abi dump creation." 2018-03-27 22:48:40 +00:00
Chih-hung Hsieh
055fa01693 Merge "Switch to clang 7.0" 2018-03-27 18:38:19 +00:00
Jayant Chowdhary
fa920fabda 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

Change-Id: I5522c1cd471bfba8a1f632270ab2f167b4b17117
2018-03-27 11:30:18 -07:00
Tobias Thierer
ddd0a41379 Merge "javadoc/droidoc: Don't add .jar files to sourcepath." 2018-03-27 09:54:13 +00:00
Ryan Prichard
05206118dc Remove an extraneous space character.
The space prevents "repo upload" from running on my machine:

    $ repo upload .
    [COMMIT 50e35bea87f0] Use Soong modules for the NDK's extra STL libraries
    [FAILED] gofmt
      FILES: ('cc/cc.go',)    <standard input>
    [FAILED] repohooks for platform/build/soong failed
    FATAL: Preupload failed due to above error(s).
    For more info, please see:
    https://android.googlesource.com/platform/tools/repohooks/

Bug: none
Test: repo upload
Change-Id: I6b5de8f5d4edb38ca26a999e561df10262844b3d
2018-03-27 05:09:37 +00:00
Chih-Hung Hsieh
3ede294729 Switch to clang 7.0
* Suppress more noisy new warnings at global level.
* Add -no-pie to partial link .o files, with -r.
* Revert workaround of b/72706604, no need of
  -Wl,-plugin-opt,-emulated-tls
* Filter out clang 7.0 unknown flag "-Wno-extended-offsetof"

Bug: 72706604
Bug: 72412006
Test: make checkbuild
Change-Id: I7ff45465c4bd771991f42b40f68dc35586045656
2018-03-26 18:04:47 -07:00
Tobias Thierer
c9e360ac8a javadoc/droidoc: Don't add .jar files to sourcepath.
javadoc expects directories on the sourcepath, not jar files.
The original commit 88b607994a148f4af5bffee163e39ce8296750c6
in 2009 was already passing the jar files, and every revision
since then seems to have kept this habit through cargo cult.

This CL removes the superfluous jar file arguments from the
sourcepath argument to javadoc.

Test: Treehugger
Bug: 76436487

Change-Id: I3a8503ae089cd6657a698c0552dc194156311849
2018-03-27 00:33:05 +01:00
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