Commit graph

8998 commits

Author SHA1 Message Date
Colin Cross
b551a7775b Merge "Add sanitize.address to product_variables.eng" 2018-10-31 17:45:53 +00:00
Treehugger Robot
724c854f6a Merge "APEXs are signed with apk signer" 2018-10-31 07:11:42 +00:00
Logan Chien
96ef45a3dd Merge "Use prebuilt bionic versioner" 2018-10-31 01:30:54 +00:00
Jiyong Park
c00cbd9e7b APEXs are signed with apk signer
The entire APEX (which is a zip file) is signed with the apk signer.
Certificate can be specified via the 'certificate' property just like
ordinary apps. Note: multiple additional certificates are not supported.

Bug: 115721587
Test: m apex.test
Test: jarsigner -verify -verbose -certs .../apex.test.apex shows the
certificate info

Change-Id: Ia4c898d3427779a3809fdc683b85d7661ca65137
2018-10-31 10:13:54 +09:00
Treehugger Robot
a758cda418 Merge "Speed up build_test" 2018-10-30 20:27:42 +00:00
Roland Levillain
a090e9794e Merge "Add Jiyong to Soong's OWNERS for apex.go." 2018-10-30 17:13:56 +00:00
Roland Levillain
54bdfda21c Use SDK prebuilt 'aapt2' in 'apexer' in source trees without "frameworks/base".
Test: system/apex/apexer/runtests.sh on a master source tree
Test: system/apex/apexer/runtests.sh on a master-art source tree
Bug: 113373927
Bug: 112458021
Change-Id: Ie23eab3f7e4961ebbe011b1fe25ce819f99767a2
2018-10-30 14:35:40 +00:00
Treehugger Robot
2ef8557c7f Merge "Add support for versioned stubs." 2018-10-30 04:32:29 +00:00
Logan Chien
2f066354d4 Use prebuilt bionic versioner
This commit replaces versioner host binary (built just-in-time) with
a prebuilt binary under `prebuilts/clang-tools/${OS}/bin/versioner`.
This is a part of the effort to switch to clang-r339409b.

See also.
https://android-review.googlesource.com/c/platform/bionic/+/799321

Bug: 113263746
Test: make checkbuild
Change-Id: Ia845e1c01d8b8084d00bdc4af706e867e1599863
2018-10-30 10:11:45 +08:00
Treehugger Robot
d471374fd6 Merge changes from topic "apex_multilib"
* changes:
  Add filename property to prebuilt_etc
  binaries and native_shared_libraires are multilib-aware props
2018-10-30 00:56:49 +00:00
Jiyong Park
7ed9de3b81 Add support for versioned stubs.
A cc_library or cc_library_shared can be configured to have stubs
variants of the lib.

cc_library_shared {
    name: "libfoo",
    srcs: ["foo.cpp"],
    stubs: {
        symbol_file: "foo.map.txt",
        versions: ["1", "2", "3"],
    },
}

then, stubs variants of libfoo for version 1, 2, and 3 are created
from foo.map.txt. Each version has the symbols from the map file where
each symbol is annotated with the version that the symbol was introduced
via the 'introduced=<ver>' syntax. The versions don't need to be in sync
with the platform versions (e.g., P for 28). The versions are local to
the library.

For another library or executable to use the versioned stubs lib, use
the new 'name#ver' syntax to specify the version:

cc_binary {
    name: "test",
    ....
    shared_libs: ["libFoo#2"],
}

Internally, a new mutator 'version' is applied to all cc.Module objects.
By default, a variant named 'impl' is created for the non-stub version.
If the versions property is set, additional variations are created per a
version with the mutable property BuildStubs set as true, which lets the
compiler and the linker to build a stubs lib from the symbol file
instead from the source files.

This feature will be used to enforce stable interfaces among APEXs. When
a lib foo in an APEX is depending on a lib bar in another APEX, then bar
should have stable interface (in C lang) and foo should be depending on
one of the stubs libs of bar. Only libraries in the same APEX as foo can
link against non-stub version of it.

Bug: 112672359
Test: m (cc_test added)

Change-Id: I2488be0b9d7b7b8d7761234dc1c9c0e3add8601c
2018-10-30 09:55:48 +09:00
Dan Willemsen
72be5901eb Add aapt_include_all_resources
The equivalent of Make's LOCAL_AAPT_INCLUDE_ALL_RESOURCES.

Test: build LatinIME with Soong
Change-Id: Ib76bea5f28e365b59fa9477b9bceabb84012ff8e
2018-10-29 23:49:46 +00:00
Treehugger Robot
000b4d1abf Merge "Don't strip soong APKs" 2018-10-29 23:44:41 +00:00
Colin Cross
762fbfb746 Don't strip soong APKs
APKs that are preopted to system_other should not be stripped.
For now, don't strip any APKs.

Bug: 118592830
Test: m PrintSpooler; zipinfo $OUT/system/app/PrintSpooler.apk | grep classes.dex
Change-Id: Ife8a5fe4ff90e5e00ec24f43e089d9b3aa552fc0
2018-10-29 12:58:06 -07:00
Elliott Hughes
c04455e1e1 Merge "Disallow "runalarm" and allow the more standard "timeout"." 2018-10-29 18:50:54 +00:00
Dan Willemsen
f99915f569 Speed up build_test
Stop writing out ninja files, as they become very large, especially when
multiplied by the number of defined products.

Test: treehugger
Change-Id: Id9529d14040acb72a0188e58b5db2911f142071e
2018-10-29 10:43:37 -07:00
Roland Levillain
5c398e764d Add Jiyong to Soong's OWNERS for apex.go.
Test: build/make/tools/checkowners.py -c -v build/soong/OWNERS
Bug: 112672359
Change-Id: I82e29eacad0d9024ff8c3b7078829572f5606166
2018-10-29 14:31:03 +00:00
Pete Gillin
67df651c3a Merge "Add support for nullability validation to droidstubs." 2018-10-29 11:46:13 +00:00
Elliott Hughes
be3cfa514a Disallow "runalarm" and allow the more standard "timeout".
Bug: N/A
Test: builds
Change-Id: Id8fe8ee2569b7410c66f448513cce6ff57458ffb
2018-10-27 08:09:18 -07:00
Colin Cross
3273cc27f7 Add sanitize.address to product_variables.eng
statsd enables ASAN in eng builds.

Test: m checkbuild
Change-Id: Ie25e1be55e14043a866d881b378cdd8d38ad356e
2018-10-26 23:59:52 -07:00
Peter Collingbourne
63c6361f91 Merge "Enable safe ICF with LLD." 2018-10-27 00:59:55 +00:00
Neil Fuller
50aeb1109d Merge "Remove sdk_version: "core_platform_current"" 2018-10-26 17:06:53 +00:00
Jiyong Park
139a2e6935 Add filename property to prebuilt_etc
filename property is an optional property that specifies the name of the
installed file which is by default name of the module.

This will be used to APEXs to have ./etc/ld.config.txt files for their
own.

Test: m (prebuilt_etc_test.go added)
Change-Id: Ic8d0c0044c5bc2c6c33117fe2c19ef6ad75451a8
2018-10-26 22:14:59 +09:00
Neil Fuller
bcf97f5afd Merge "Add soong build restrictions for libcore targets" 2018-10-26 09:31:59 +00:00
Neil Fuller
401eeba29f Remove sdk_version: "core_platform_current"
This (effectively) reverts commit 3c979c3348.

core_platform_current is the new default when no_framework_libs: true
so doesn't need to be specified anywhere.

Bug: 113148576
Test: build
Change-Id: I6bb6c1a0ea24437c8253dc5d8fabd37edabc9d3e
2018-10-26 09:11:22 +00:00
Jiyong Park
397e55e0cf binaries and native_shared_libraires are multilib-aware props
The properties 'binaries' and 'native_shared_libraries' can be
multilib-aware, i.e, can be under multilib.type where type can be either
first, both, lib32, lib64, or prefer32.

Native modules listed in multilib.first are installed only for the first
ABI of the device. Similarily, multilib.both are for both of the ABIs,
while multilib.lib32 and multilib.lib64 are 32 and 64-bit ABI only,
respectively. multilib.prefer32 is for 32-bit only when 32-bit ABI is
available.

Another change is that the binaries property, when not within multilib,
targets only the first ABI.

Test: m apex.test on ...
1) aosp_arm64 without TARGET_PREFER_32_BIT_EXECUTABLES=true
2) aosp_arm64 with TARGET_PREFER_32_BIT_EXECUTABLES=true
3) aosp_arm
in all cases, vold, surfaceflinger and drmserver are all intalled under
./bin directory of the APEX. And native libraries are installed under
both ./lib and ./lib64 directories in the case of 1) and 2).

Change-Id: Idd7f8526a61bceca89d43c0c69ccedb471b67d31
2018-10-26 15:47:53 +09:00
Colin Cross
cbc64dcafe Merge "Store dex files uncompressed and unstripped in privileged APKs" 2018-10-26 00:00:12 +00:00
Treehugger Robot
33195833de Merge "Enable SHT_RELR sections to encode relative relocations." 2018-10-25 21:02:44 +00:00
Peter Collingbourne
486e42c353 Enable safe ICF with LLD.
Support for safe ICF was added to LLD in LLVM r337429. This reduces
the size of sailfish system.img by 7.6MB.

The address-significance tables created by Clang to support LLD's
implementation of safe ICF are incompatible with ld -r. Therefore we
need to pass -fno-addrsig to the compiler to prevent it from creating
an address-significance table when building a cc_object.

Change-Id: I83e28741e6b3cdf09566447d2658ce48594f2074
2018-10-25 13:40:28 -07:00
Pete Gillin
a262c05904 Add support for nullability validation to droidstubs.
This detects whether this is enabled, makes sure the other necessary
flag is set to provide a suitable location, and suppresses the
requirement for a previous_api.

Test: making a new libcore target using this
Bug: 73448108
Change-Id: Ifea3a060011a58e3288050c6c5d98b205abe25fc
2018-10-25 19:20:08 +01:00
Colin Cross
5a0dcd5acf Store dex files uncompressed and unstripped in privileged APKs
Privileged APKs need to store their dex files uncompressed so they
can be verified and mapped directly out of the APK.

Also track whether the module will be dexpreopted or not in order
to determine if the dex file should be stripped before signing.

Test: SystemUI.apk contains an uncompressed dex file
Change-Id: I4dca86c7f8778595882405b34adcf2a7bae03c67
2018-10-25 17:47:12 +00:00
Neil Fuller
df5f356c86 Add soong build restrictions for libcore targets
Add soong build restrictions for libcore targets to stop
other targets depending on internals.

Test: cd build/soong/; ./build_test.bash --products aosp_arm
Bug: 113148576
Change-Id: I2c15924fbecaf0c2076d08de65814a6dcb790e73
2018-10-25 18:10:57 +01:00
Treehugger Robot
1e30905f65 Merge "Revert "ATest: GTest auto gen config support run_test_as in Android.bp ."" 2018-10-25 08:53:24 +00:00
Bill Yang
fd18c42b37 Revert "ATest: GTest auto gen config support run_test_as in Android.bp ."
This reverts commit d30b940dff.

Reason for revert: sed -i requires an argument on mac, break build on mac.

Change-Id: Iba2db061ae888d265e02b750e50959019cf0f168
2018-10-25 07:10:40 +00:00
Treehugger Robot
05802ab51d Merge "Move Ndk_abis from soong.config to soong.variables" 2018-10-25 04:56:33 +00:00
Peter Collingbourne
98d8580c3a Prevent clang from using the x18 register on arm64.
This is achieved via the compiler flag -ffixed-x18 for non-LTO builds
and the linker flag -plugin-opt -mattr=+reserve-x18 for LTO builds.

This change should be reverted once we upgrade past LLVM r340889
which does this by default on Android.

Bug: 112907825
Bug: 111759196
Change-Id: I05473ddbb98319d87d442425b4d715647eae3a38
2018-10-24 23:40:49 +00:00
Colin Cross
395f2cfa89 Move Ndk_abis from soong.config to soong.variables
soong.config is not cleared between builds, which can cause
problems when switching between an ndk build and a platform build.

Bug: 118398924
Test: OUT_DIR=out_ndk DIST_DIR=dist build/soong/scripts/build-ndk-prebuilts.sh
Change-Id: Ifc03a0c25f46625375cdda5723e4a09d7d8050d5
2018-10-24 23:20:10 +00:00
Treehugger Robot
ddfcd42b25 Merge "arch-specific dependencies are correctly handled in apex" 2018-10-24 22:53:42 +00:00
Bill Yi
04f42377ba Merge pie-platform-release to aosp-master - DO NOT MERGE
Change-Id: I5f442bcf523e436413b269743b25052bde76c501
2018-10-24 14:54:21 -07:00
Treehugger Robot
2dedae9a78 Merge "Add --prefer-integrity option to manifest_fixer.py" 2018-10-24 21:46:23 +00:00
Neil Fuller
840c411f96 Merge "Add annotation-related args to check api" 2018-10-24 18:43:32 +00:00
Victor Hsieh
ce7818ed6e Add --prefer-integrity option to manifest_fixer.py
If provided (--prefer-integrity=true/false), the script will set the
value in the the manifest.  The script will fail if the value mismatches
the original in the manifest, if any.

Test: scripts/manifest_fixer_test.py
Test: aapt dumps the attribute and observe
Bug: 112037137
Change-Id: I2b333a7c0747dbcbed4d419f1c9ed46d4a4c98e9
2018-10-24 10:32:10 -07:00
Jiyong Park
678529ef29 arch-specific dependencies are correctly handled in apex
The change fixes the problem that multiple APEXs having native component
(shared lib or executable) can't be built with an error similar to this:

error: bionic/linker/Android.bp:298:1: failed to find variation "com.android.art" for module "libclang_rt.builtins-aarch64-android" needed by "ld-android"

This is happening because the dependency to the built-in library is
arch-specific but apex.go ignores it. Specifically, let's assume that
32-bit variant of libFoo depends on libX while 64-bit variant of libFoo
depends on libY. Also assume that libFoo is included in two APEXs: apex1
(which is 64-bit) and apex2 (which is 32-bit). Then apexDepsMutator
records that libFoo shall be split into apex1 and apex2, while libX will
be only split into apex1 and libY will be split into apex2.

The problem is that, during apexMutator, both 32 and 64-bit varants of
libFoo are split into apex1 and apex2. As a result, a dependency to
apex2 variant of libX and a dependency to apex1 variant of libY are
requested, which don't exist.

Fixing this issue by using module's name AND target string as the key.
So, only the 32-bit variant of libFoo is split into apex1 and 64-bit
variant of libFoo is split into apex2.

Test: have following module somewhere. `m` is successful.

  apex {
      name: "com.android.art",
      manifest: "manifest.json",
      file_contexts: "file_contexts",
      binaries: ["dex2oat"],
      key: "apex.test.key",

      target: {
          android: {
              // Prefer the 32-bit versions of these binaries.
              compile_multilib: "prefer32",
          },
      },
  }
Change-Id: I562b7be8e7c0325bd8d728dbee2ddcae608c181a
2018-10-25 00:02:18 +09:00
Treehugger Robot
f2ea4dddeb Merge "ATest: GTest auto gen config support run_test_as in Android.bp ." 2018-10-24 13:53:50 +00:00
Treehugger Robot
9bce14bab6 Merge "Don't check the link type from stubs libs." 2018-10-24 01:42:17 +00:00
Treehugger Robot
c75885a1d6 Merge "Allow cc_genrule srcs to vary by architecture" 2018-10-23 23:18:26 +00:00
Dan Willemsen
10db384ff7 Apply rtti settings to linux_bionic
Otherwise linking fails with:

ld.lld: error: undefined symbol: vtable for __cxxabiv1::__si_class_type_info
>>> referenced by contexts_split.cpp
>>>               contexts_split.o:(typeinfo for ContextsSplit) in archive out/soong/.intermediates/bionic/libc/libc_common/linux_bionic_x86_64_static/libc_common.a

ld.lld: error: undefined symbol: vtable for __cxxabiv1::__class_type_info
>>> referenced by contexts_split.cpp
>>>               contexts_split.o:(typeinfo for Contexts) in archive out/soong/.intermediates/bionic/libc/libc_common/linux_bionic_x86_64_static/libc_common.a

ld.lld: error: undefined symbol: vtable for __cxxabiv1::__si_class_type_info
>>> referenced by contexts_serialized.cpp
>>>               contexts_serialized.o:(typeinfo for ContextsSerialized) in archive out/soong/.intermediates/bionic/libc/libc_common/linux_bionic_x86_64_static/libc_common.a

ld.lld: error: undefined symbol: vtable for __cxxabiv1::__si_class_type_info
>>> referenced by system_properties.cpp
>>>               system_properties.o:(typeinfo for ContextsPreSplit) in archive out/soong/.intermediates/bionic/libc/libc_common/linux_bionic_x86_64_static/libc_common.a
clang-8: error: linker command failed with exit code 1 (use -v to see invocation)

Bug: 31559095
Test: prebuilts/build-tools/build-prebuilts.sh
Change-Id: I03a02c7e55948a0cd04bdcb5c090bb74e1723a0f
2018-10-23 19:53:13 +00:00
Neil Fuller
b2f14ecfef Add annotation-related args to check api
Without the annotation args the check API fails for
APIs that use visibility annotation args.

Bug: 117936519
Bug: 113148576
Test: build
Change-Id: Ie9d2116c7f255634de72de9a448f5c378c11c457
2018-10-23 20:34:34 +01:00
Colin Cross
ef35448ac5 Allow cc_genrule srcs to vary by architecture
Add arch_variant to the genrule srcs property so that cc_genrule
modules can vary the srcs and outs by architecture.

Test: cc/genrule_test.go
Change-Id: Idb17013e137d7ca21ca4cfc3e4c1fa7d89977043
2018-10-23 18:40:37 +00:00
Treehugger Robot
5b9fde2d15 Merge "Add support for sysprop description files to c++" 2018-10-23 03:57:56 +00:00