Commit Graph

8991 Commits

Author SHA1 Message Date
Bill Yang
632b491143 Merge "Revert "ATest: GTest auto gen config support run_test_as in Android.bp .""
am: 1e30905f65

Change-Id: I23b1f23dde966742daff46f613c33eea4c2eea88
2018-10-25 02:05:07 -07: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
Colin Cross
abf1459900 Merge "Move Ndk_abis from soong.config to soong.variables"
am: 05802ab51d

Change-Id: I466fde12721d5189c23144c554c3584ba084a0ff
2018-10-24 22:14:40 -07:00
Treehugger Robot
05802ab51d Merge "Move Ndk_abis from soong.config to soong.variables" 2018-10-25 04:56:33 +00:00
Peter Collingbourne
d90423e2a6 Prevent clang from using the x18 register on arm64.
am: 98d8580c3a

Change-Id: I1fa9d1907b65f8152f35e84d0301e68f6da62c9b
2018-10-24 20:03:52 -07:00
Jiyong Park
04eb442dbb Merge "arch-specific dependencies are correctly handled in apex"
am: ddfcd42b25

Change-Id: I744ab5ed8fdbae9fbc010b5686c952be11160f3e
2018-10-24 16:51:12 -07: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
823b38bab4 [automerger skipped] Merge pie-platform-release to aosp-master - DO NOT MERGE
am: 04f42377ba  -s ours

Change-Id: I17fca24115eb6b3d692c989ed74f65674a7f859e
2018-10-24 15:04:17 -07:00
Victor Hsieh
711dc428d1 Merge "Add --prefer-integrity option to manifest_fixer.py"
am: 2dedae9a78

Change-Id: Id5b0d79dc34b3d1d2df46ec308832c7dc77c8f44
2018-10-24 15:00:33 -07: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
d60d4a4c0f Merge "Add annotation-related args to check api"
am: 840c411f96

Change-Id: I2eef4c17afc3ca3e0dcb3603e2a9629ce149f09e
2018-10-24 14:15:55 -07: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
Bill Yi
e7d4038371 Merge pi-platform-release to stage-aosp-master - DO NOT MERGE
Change-Id: I3f07614e53815bfee23d085d939d5295b6fd05a3
2018-10-24 09:08:37 -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
yelinhsieh
92e19c6871 Merge "ATest: GTest auto gen config support run_test_as in Android.bp ."
am: f2ea4dddeb

Change-Id: Ib706d38614303f69f6a8111da59e254fd0d404ef
2018-10-24 07:01:10 -07: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
Jiyong Park
6303492711 Merge "Don't check the link type from stubs libs."
am: 9bce14bab6

Change-Id: I97fbf06080ae155eedd34f4f20fd21e40854d207
2018-10-23 18:51:53 -07:00
Treehugger Robot
9bce14bab6 Merge "Don't check the link type from stubs libs." 2018-10-24 01:42:17 +00:00
Colin Cross
2ed9d5fb6e Merge "Allow cc_genrule srcs to vary by architecture"
am: c75885a1d6

Change-Id: I9838e623fc556334c48a0a09daeb4287a97f9ef5
2018-10-23 16:33:27 -07:00
Treehugger Robot
c75885a1d6 Merge "Allow cc_genrule srcs to vary by architecture" 2018-10-23 23:18:26 +00:00
Dan Willemsen
9fa2f2ab06 Apply rtti settings to linux_bionic
am: 10db384ff7

Change-Id: Iff569f350bf95c5b6c0c014073544edff545a5e8
2018-10-23 14:37:56 -07: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
Inseob Kim
34af6a3dba Merge "Add support for sysprop description files to c++"
am: 5b9fde2d15

Change-Id: I8767772fb6a2839a6ed24a535962b514bb5b96ea
2018-10-22 21:10:52 -07:00
Treehugger Robot
5b9fde2d15 Merge "Add support for sysprop description files to c++" 2018-10-23 03:57:56 +00:00
Inseob Kim
8da8e2f532 Merge "Add support for sysprop description files to Java"
am: 5429ed0f20

Change-Id: Ide988f35e8a8a1df557018dab79d5a605eb89e6a
2018-10-22 20:56:41 -07:00
Treehugger Robot
5429ed0f20 Merge "Add support for sysprop description files to Java" 2018-10-23 03:45:07 +00:00
Dan Willemsen
7ff0a5619b Rework how linux_bionic is built with LLD
am: a0790e35c7

Change-Id: I106e92fd53d26a6dcf35bc1aaf4393e834fbce32
2018-10-22 16:25:01 -07:00
Dan Willemsen
51bf1e3abd Update linux_bionic configuration
am: 9ff34c0ca8

Change-Id: Ia681b3087391e66c44e880de20a17aeae5309fb0
2018-10-22 16:24:54 -07:00
Dan Willemsen
01565ce1dd Add support to inject a uint64 symbol
am: 0db18c239a

Change-Id: Iee359dabe99acf1300ce6a766bf38220eb2c6ecf
2018-10-22 16:24:47 -07:00
Dan Willemsen
f6668d3798 Turn symbol_inject into a reusable package
am: 2249dc892d

Change-Id: I2586d410be3582edd0d7d5310046c925d8ddc467
2018-10-22 16:24:39 -07:00
Dan Willemsen
83481ee255 Don't use arch-specific modules when we want a single module
am: 4f644da0ad

Change-Id: Iab3542a4fffcb4b28405d204ff5ef171d5b87d7a
2018-10-22 16:24:32 -07:00
Dan Willemsen
e329dae57d Allow generating modules once per OS instead of once per Class
am: 0ef639bb59

Change-Id: Ie2319abca56582b6c0f25b197cbc4355509a13ab
2018-10-22 16:24:23 -07: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
Dan Willemsen
c1e4ff4243 Remove USE_CLANG_LLD[=false]
am: fa2aee1ca4

Change-Id: I744266fc07dbf62fe8dc2a42903a26acd14ad4e8
2018-10-22 15:41:36 -07: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
Dan Willemsen
6c0bfdffcb Allow DIST_DIR to be read via dumpvars
am: 6f03752422

Change-Id: I6e3af2e0aa2cb6267a222c45fdea555860470efa
2018-10-21 12:42:44 -07:00