Commit graph

9037 commits

Author SHA1 Message Date
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
Treehugger Robot
5429ed0f20 Merge "Add support for sysprop description files to Java" 2018-10-23 03:45:07 +00:00
Dan Willemsen
a0790e35c7 Rework how linux_bionic is built with LLD
In order to simplify the wrapper function, and stop using a linker
script, generate a set of flags to pass to LLD. Then run
host_bionic_inject on the linked binary in order to verify the
embedding, and give the wrapper function the address of the original
entry point (_start).

Bug: 31559095
Test: build host bionic with prebuilts/build-tools/build-prebuilts.sh
Change-Id: I53e326050e0f9caa562c6cf6f76c4d0337bb6faf
2018-10-22 15:46:03 -07:00
Dan Willemsen
9ff34c0ca8 Update linux_bionic configuration
Add a missing toolchain method, don't require modules to opt in to
linux_bionic.

Bug: 31559095
Test: attempt to build host bionic
Change-Id: Ia5c8e2f127b88f56191b7abc389d5329cfdb0720
2018-10-22 15:46:03 -07:00
Dan Willemsen
0db18c239a Add support to inject a uint64 symbol
Bug: 31559095
Test: m blueprint_tools
Change-Id: Ifb46e21f5cac413abdf1dfe7fd6d31e06a7dbca5
2018-10-22 15:46:03 -07:00
Dan Willemsen
2249dc892d Turn symbol_inject into a reusable package
Bug: 31559095
Test: m blueprint_tools
Change-Id: I0f7a9f14111af26d753db547c6de313a7079658a
2018-10-22 15:46:03 -07:00
Dan Willemsen
4f644da0ad Don't use arch-specific modules when we want a single module
This breaks when two host OSes are enabled for example.

Bug: 31559095
Test: enable host bionic as a second Host OS, attempt a build
Test: treehugger
Change-Id: If52f77d7d3b0755d768028cbddda320303a69e65
2018-10-22 15:46:03 -07:00
Dan Willemsen
0ef639bb59 Allow generating modules once per OS instead of once per Class
When building with two OSes of the same class (Host, etc) enabled,
independently produce variants of each module for each OS, instead of
making `compile_multilib: "first"` select just one of the OSes.

My use case this is for Linux + LinuxBionic, which are both considered
Host class, but this would also applied if we wanted to generate rules
for Linux+Darwin, or some combination of firmware bits (either in
addition to Android in the Device Class, or multiple firmwares in a new
Class)

Bug: 31559095
Test: enable host bionic, see a linux(_glibc) and linux_bionic
      definition for binaries
Change-Id: I55e7f046758b3dc2a31da2c4b20274ec68ece0a0
2018-10-22 15:46:03 -07:00
Rahul Chaudhry
1ffac8e636 Enable SHT_RELR sections to encode relative relocations.
Proposal for adding SHT_RELR sections in the generic-abi is at
https://groups.google.com/forum/#!topic/generic-abi/bX460iggiKg

This CL requires clang-r328903.

The following test results are on clang-r339409.

Size comparison for "aosp_marlin-userdebug":
$ du -B1 -s {none,pack,relr,both}/out/target/product/marlin/system
1014616064      none/out/target/product/marlin/system
1001074688      pack/out/target/product/marlin/system
1004273664      relr/out/target/product/marlin/system
1000099840      both/out/target/product/marlin/system

none contains a build with no packing (--pack-dyn-relocs=none).
pack contains a build with current settings (--pack-dyn-relocs=android).
relr contains a build with relr packing only (--pack-dyn-relocs=relr).
both contains a build with both options enabled (--pack-dyn-relocs=android+relr).

With --pack-dyn-relocs=android+relr, lld will encode the relative
relocations in a SHT_ANDROID_RELR section, and pack the rest of
the dynamic relocations in a SHT_ANDROID_REL(A) section.

--pack-dyn-relocs=android was saving us 13,541,376 bytes (1.35%) (none - pack).
--pack-dyn-relocs=relr will save us 10,342,400 bytes (1.03%) (none - relr).
--pack-dyn-relocs=android+relr is saving us 14,516,224 bytes (1.45%) (none - both).

Size comparison for the "system/bin" directory:
$ du -B1 -s {none,pack,relr,both}/out/target/product/marlin/system/bin
29413376        none/out/target/product/marlin/system/bin
28319744        pack/out/target/product/marlin/system/bin
28258304        relr/out/target/product/marlin/system/bin
28180480        both/out/target/product/marlin/system/bin

--pack-dyn-relocs=android was saving us 1,093,632 bytes (3.72%) (none - pack).
--pack-dyn-relocs=relr will save us 1,155,072 bytes (3.93%) (none - relr).
--pack-dyn-relocs=android+relr is saving us 1,232,896 bytes (4.19%) (none - both).

Bug: None
Test: Built aosp_marlin-userdebug image, boots on device.
Test: Built aosp_x86_64-userdebug image, boots in emulator.
Change-Id: Ibb726c3b9d87688f387a7f2974fdae9bfc24efc9
2018-10-22 20:29:39 +00:00
yelinhsieh
d30b940dff ATest: GTest auto gen config support run_test_as in Android.bp .
Feature request from developer, support setting uid in Android.bp.

Bug:113359343

Test: source build/envsetup.sh ; lunch
    vim platform_testing/tests/example/native/Android.bp
    add
    test_options: {
        run_test_as: "1234",
    },
    in cc_test
    make hello_world_test
    cat out/target/product/xxxx/testcases/hello_world_test/hello_world_test.config
    Will see  <option name="run-test-as" value="1234" />
    below <test class="com.android.tradefed.testtype.GTest" >

Change-Id: I5604af5f20c45728d19f4c01396a20a74997f8a8
2018-10-22 14:14:29 +08:00
Dan Willemsen
fa2aee1ca4 Remove USE_CLANG_LLD[=false]
This should always be true now. It will be a change for side branches
(build_tools, etc) that weren't setting UseClangLld in the
soong.variables file.

Test: treehugger
Change-Id: I9fd6157fda630bf8bb939677dbcb026f02685f19
2018-10-21 19:54:12 -07:00
Jiyong Park
46f78fb4c6 Don't check the link type from stubs libs.
getLinkType also tells whether the module in question is a stubs lib or
not. If it is a stubs lib, link type from it isn't checked beause
dependency from the stubs lib doesn't matter; the stubs lib is
build-time only artifact.

In addition, core-lambda-stubs is added to the list of stubs libs.

Bug: 117964170
Test: m with https://android-review.googlesource.com/c/platform/libcore/+/793518/4
Change-Id: Ibd63484a1cc48dfd0afed6e6de098b7a38db5e61
2018-10-22 09:29:32 +09:00