Commit Graph

6123 Commits

Author SHA1 Message Date
Lukács T. Berki
84a1601804 Merge "Update some comments about the image mutator." 2021-06-15 15:50:11 +00:00
Chris Parsons
91eb1fa28e Support cc_library_shared for mixed builds am: 94a0bba5a9 am: e6819aa944
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1727935

Change-Id: I30b6643b74dfb74b4dd7a118b1c392ec7a62aa74
2021-06-15 15:30:43 +00:00
Lukacs T. Berki
2f5c340b49 Update some comments about the image mutator.
Test: It's just comment changes.
Change-Id: Idac69f5369caad028f3daa6aa5c1088d697c07e2
2021-06-15 15:49:51 +02:00
Chris Parsons
94a0bba5a9 Support cc_library_shared for mixed builds
Authors: cparsons, eakammer, jingwen

This CL also contains .toc file integration between Bazel and Make.

Fixes: b/190524879

Test: build/bazel/ci/mixed_droid.sh

Co-authored-by: Christopher Parsons <cparsons@google.com>
Co-authored-by: Liz Kammer <eakammer@google.com>
Co-authored-by: Jingwen Chen <jingwen@google.com>

Change-Id: If484042a58cb9f0db6d30a460f415f5684b4cbf6
2021-06-15 12:40:28 +00:00
Colin Cross
e945a4d212 Consistently prepend arch-specific headers
Add variant_prepend to Export_include_dirs, Export_system_include_dirs
and Generated_headers to match Local_include_dirs so that
architecture-specific headers are found before common headers.

Test: m checkbuild
Test: TestIncludeDirectoryOrdering
Change-Id: I2bf9d4373fd256e500c1f8d6c84cf593e8fdd170
2021-06-14 18:12:58 -07:00
Colin Cross
c113e3cbe7 Use LateStaticLibs for ndk_libandroid_support
This will obsolete the workaround in prebuilts/ndk/Android.bp to
export the ndk_libandroid_support headers from ndk_libc++_shared,
which would no longer have worked after the next patch.

Test: m checkbuild
Test: TestIncludeDirectoryOrdering
Change-Id: I9b4e5799d939433da547661b862e9db5a4aacb09
2021-06-14 18:12:58 -07:00
Colin Cross
fe9acfecb3 Move LateStaticLibs after SharedLibs in the dependency include order
LateStaticLibs has always been after StaticLibs, move it after
SharedLibs too so that exported headers from LateStaticLibs
dependencies come after exported headers from SharedLibs dependencies.
This will be used to ensure the ndk_libandroid_support headers come
after the ndk_libc++_shared headers.

Test: m checkbuild
Change-Id: I5ef180c99cefcd823c6970c06d0e772a10fa0456
2021-06-14 18:12:58 -07:00
Colin Cross
ae62818dd8 Test include directory ordering
Add a test to verify include directory ordering on the command line.

Test: TestIncludeDirectryOrdering
Change-Id: Iaf03c57201e9ec7a8daf417cb91470a5215e4053
2021-06-14 18:12:52 -07:00
Pirama Arumuga Nainar
09661c5a93 Switch to clang-r416183d
Bug: http://b/189328402

This contains a fix to AArch64 __clear_cache.

Test: TH + Manual verification by emulator team.
Change-Id: If11e59638f47a5c9532d84d19c7a76e6e8718af8
2021-06-14 09:56:03 -07:00
Colin Cross
9cfe6119fe Use a linker script for host bionic embedded linker sections
Use an implicit linker script instead of flags in a file to specify
the locations of the host bionic embedded linker and to prevent it
from being stripped.

Test: build and run host bionic binary
Change-Id: I64e12118d33c67bab5e657cbc3ea8cde8f0fd7e6
2021-06-11 18:02:22 -07:00
Colin Cross
cef792e467 Support genrules as CrtBegin and CrtEnd
Host bionic will use a genrule output as a linker script in CrtBegin,
support genrules as Crt* dependencies.

Test: go test ./build/soong/cc/...
Change-Id: Ie384089d26459797d0b4b5fef84846507fc508ad
2021-06-11 18:01:26 -07:00
Colin Cross
c465efd5d4 Support multiple CrtBegin and CrtEnd files
Host bionic will use multiple files for CrtBegin, make CrtBegin and
CrtEnd Paths instead of OptionalPath.

Test: go test ./build/soong/cc/...
Change-Id: Ie2e954cd87808a903617696da443009f6173e312
2021-06-11 18:00:04 -07:00
Colin Cross
f04eb99acc Stop injecting symbols into host bionic binaries
The host bionic bootstrapping no longer needs an injected symbol.
Replace host_bionic_inject with host_bionic_verify that validates
the resulting binary, and add it as a validation dependency of the
binary.

Test: build and run host bionic binary
Change-Id: I3e303d2a164b6eef851bdc8075e6ee456c05b0a8
2021-06-11 15:22:41 -07:00
Liz Kammer
89f299b728 Merge "Append _alwayslink to prebuilt whole static deps" am: 5f16b3d03e am: e684a554ca
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1734255

Change-Id: Id702404dce435a62c8c19e2da6c77fae463bd487
2021-06-11 20:16:37 +00:00
Liz Kammer
2d7bbe3883 Append _alwayslink to prebuilt whole static deps
This allows us to support prebuilt archives that are part of whole
static deps.

Test: build/bazel/ci/bp2build.sh
Bug: 190716727

Change-Id: I913dbd8f85a1974fbd53c0cbaa49211db18ea45f
2021-06-11 08:10:50 -04:00
Dan Albert
56f52de8bd Add systemapi as an APEX synonym for stub maps.
The apex tag is currently used for platform-to-APEX, APEX-to-APEX, and
APEX-to-platform, and it's difficult to tell when reviewing the map
files. Add a synonym so authors can be explicit about platform-to-APEX
since those have different stability rules.

Test: pytest
Test: mypy
Test: pylint
Test: treehugger
Bug: None
Change-Id: I0aee679a05b1b2d3749307434c19486bf4c7fe52
2021-06-10 16:38:19 -07:00
Dan Albert
ead21552ee Refactor tag handling code in stub generator.
Test: pytest
Test: pylint
Test: mypy
Test: treehugger
Bug: None
Change-Id: I7fb380a3d879b4abcdadfe4aafff0ca4098d2e07
2021-06-10 16:38:19 -07:00
Jingwen Chen
5f59dffa94 Merge "bp2build: support strip properties." am: 62d8b1ed43 am: a0bc3f955e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1730118

Change-Id: I7848e7863282f6a86b3433e814aa147202f42c95
2021-06-10 14:11:45 +00:00
Jingwen Chen
3d383bbeb9 bp2build: support strip properties.
This CL adds support to bp2build for generating all strip-related
properties into a strip dictionary as a parameter in the cc_library
macro.

With the dictionary, it's easy to organize related attributes and
directly expand into a stripped_shared_library's attributes.

Test: //build/bazel/tests/bionic:compare_libc_stripping
Test: TH
Fixes: b/187928597
Change-Id: Ifea68d48fe295e71a43b12876cb168c475a62187
2021-06-10 05:22:50 +00:00
Jooyung Han
f8b55cd51e Merge "Interpret CRT object's min_sdk_version with ApiLevel" into sc-dev 2021-06-09 11:18:11 +00:00
Treehugger Robot
5faeb84578 Merge "Only store what's used in SharedLibraryInfo" am: 75851d2fb6 am: f026cd57df
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1730553

Change-Id: Idf171918e8f346c780069806343012d90c0b1106
2021-06-09 06:24:26 +00:00
Treehugger Robot
75851d2fb6 Merge "Only store what's used in SharedLibraryInfo" 2021-06-09 05:49:15 +00:00
Treehugger Robot
bac2e29460 Merge "Handle no_libcrt in bp2build." am: f218e3d0c2 am: b8e15e1efa
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1726896

Change-Id: I1fbe8b04e803f9c70a31ac28ea4a8109a07ca8de
2021-06-09 01:27:09 +00:00
Jooyung Han
37c219a1ec Interpret CRT object's min_sdk_version with ApiLevel
min_sdk_version values should be interpreted before use.

Bug: 171506470
Bug: n/a
Test: m (in REL)
Merged-In: Ia45f5c7aeb4efcd8daef1deaf54f333dcdd1379d
Change-Id: Ia45f5c7aeb4efcd8daef1deaf54f333dcdd1379d
(cherry picked from commit 94a76ee868)
2021-06-09 09:53:53 +09:00
Jooyung Han
5fe0e322e0 Merge "Interpret CRT object's min_sdk_version with ApiLevel" am: 7f6e057f23 am: e6ef49cb51
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1730110

Change-Id: If582cb975947096d85dd93c2062b050ca2565af5
2021-06-09 00:51:30 +00:00
Treehugger Robot
f218e3d0c2 Merge "Handle no_libcrt in bp2build." 2021-06-09 00:48:06 +00:00
Jooyung Han
7f6e057f23 Merge "Interpret CRT object's min_sdk_version with ApiLevel" 2021-06-09 00:07:29 +00:00
Liz Kammer
d366c909ca Handle no_libcrt in bp2build.
Test: ci/bp2build.sh
Bug: 187928307
Change-Id: Ib80c4318169652b322e5d878c8784679e42f87dd
2021-06-08 17:18:22 -04:00
Liz Kammer
ef6dfea679 Only store what's used in SharedLibraryInfo
There was a reference to the static library provider, but only the
transitive static deps were used, so only store that part. Other members
were stored but unused anywhere.

Test: go test soong tests
Test: m nothing
Change-Id: I12a6b94806c052c3f0df3cab0a10f17042af1c38
2021-06-08 16:44:23 -04:00
Yi-Yo Chiang
0de94db394 cc/sabi.go: Propagate ShouldCreateSourceAbiDump to reuseObjTag deps
`reuseObjTag` is a dependency from the shared variant of a `cc_library`
to the static variant. When such dependency exist, the shared variant
would reuse the object files of the static variant.
Thus if the shared variant requires ABI dump, then the static variant
would need to generate ABI dump as well.

Bug: 190339664
Test: m findlsdump
Change-Id: I015328d74acbeb89ff7622397e59b68864af34a4
Merged-In: I015328d74acbeb89ff7622397e59b68864af34a4
(cherry picked from commit 21d1c6d637)
2021-06-08 15:53:46 +08:00
Yo Chiang
eed0fa9738 Merge "cc/sabi.go: Propagate ShouldCreateSourceAbiDump to reuseObjTag deps" am: c33cceb408 am: 25763d7edf
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1729191

Change-Id: If7b9fa2ba9c131fd4d30594d24be19b79fbeb1cb
2021-06-08 06:43:41 +00:00
Yo Chiang
c33cceb408 Merge "cc/sabi.go: Propagate ShouldCreateSourceAbiDump to reuseObjTag deps" 2021-06-08 06:02:07 +00:00
Jooyung Han
94a76ee868 Interpret CRT object's min_sdk_version with ApiLevel
min_sdk_version values should be interpreted before use.

Bug: n/a
Test: m (in REL)
Change-Id: Ia45f5c7aeb4efcd8daef1deaf54f333dcdd1379d
2021-06-08 09:49:48 +09:00
Dan Albert
63c97f6584 Disable ABI dumps on Darwin. am: ad66593085 am: 8610680416
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1729472

Change-Id: Ia5c333d1794b23b9d92e67c0783b0efe4dba6058
2021-06-08 00:33:33 +00:00
Dan Albert
ad66593085 Disable ABI dumps on Darwin.
I'm not sure why these targets are getting built as part of the sdk
build anyway, but we don't need them.

Test: treehugger
Bug: http://b/156513478
Bug: http://b/190394921
Change-Id: I1ea0e75f459ad7cad648f96b67a4f2424d36fda7
2021-06-07 13:22:30 -07:00
Liz Kammer
0425ac6016 Merge changes I4a5ea40c,I40ab16e3 am: 2f26595072 am: cc1961d51d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1726010

Change-Id: I4f1af9e641322edc52dd60206168e43c28d44d3e
2021-06-07 17:18:03 +00:00
Liz Kammer
2f26595072 Merge changes I4a5ea40c,I40ab16e3
* changes:
  Handle excludes_{shared,static}_libs
  Extract function to handle configurable excludes
2021-06-07 16:42:38 +00:00
Yi-Yo Chiang
21d1c6d637 cc/sabi.go: Propagate ShouldCreateSourceAbiDump to reuseObjTag deps
`reuseObjTag` is a dependency from the shared variant of a `cc_library`
to the static variant. When such dependency exist, the shared variant
would reuse the object files of the static variant.
Thus if the shared variant requires ABI dump, then the static variant
would need to generate ABI dump as well.

Bug: 190339664
Test: m findlsdump
Change-Id: I015328d74acbeb89ff7622397e59b68864af34a4
2021-06-07 20:29:11 +08:00
Lukacs T. Berki
cb18077103 Remove sort_bss_symbols_by_size. am: 1af9316e0a am: 763d8e5198
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1728138

Change-Id: I40d776f224199eea91e69ff237dfcdf95e03adf5
2021-06-07 09:49:18 +00:00
Lukacs T. Berki
1af9316e0a Remove sort_bss_symbols_by_size.
Its only use was removed in aosp/1717013.

Bug: 187928080
Test: Presubmits.
Change-Id: If6acbfe8ba21ec4dc34166768ba1bde3bb78123c
2021-06-07 09:23:15 +02:00
Dan Albert
c0702f6a37 Merge "Use libabigail to track NDK ABIs." am: 07538bb56b am: eaeae632a9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1388354

Change-Id: I1a21874562cc3b8e3bef0ff236565eaf901cef53
2021-06-04 21:49:23 +00:00
Dan Albert
07538bb56b Merge "Use libabigail to track NDK ABIs." 2021-06-04 21:06:00 +00:00
Pirama Arumuga Nainar
adc58d324f Merge "[cc] Cleanup unused function" am: e36a3d9d0d am: 99419cf462
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1728211

Change-Id: I1d2a5f2b8a9f295ff57f9ee8ed4c8ddbb8780f5c
2021-06-04 21:03:57 +00:00
Pirama Arumuga Nainar
e36a3d9d0d Merge "[cc] Cleanup unused function" 2021-06-04 20:31:00 +00:00
Pirama Arumuga Nainar
bd20ccb83e [cc] Cleanup unused function
Test: TH
Change-Id: I7c7fd1ada1303e8006b27923f124c836a4776d8b
2021-06-04 11:33:33 -07:00
Christopher Parsons
f00740e176 Merge "Support mixedbuilds for static variant cc_library" am: fa4ab8a7f4 am: 7c7686b551
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1725972

Change-Id: I4c2f7bb5bc354ef56e75259c4d744e1845efc0c9
2021-06-04 15:41:16 +00:00
Christopher Parsons
fa4ab8a7f4 Merge "Support mixedbuilds for static variant cc_library" 2021-06-04 15:09:21 +00:00
Liz Kammer
6044fae776 Use maps in bazel *attribute types am: 9abd62d133 am: e90edc333c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1725151

Change-Id: I3d75f3405b099d21151334598a346f8c1c592e9b
2021-06-04 14:29:03 +00:00
Liz Kammer
47535c51fa Handle excludes_{shared,static}_libs
Bug: 188497994
Test: bp2build.sh
Change-Id: I4a5ea40cbd804e8542fe33143e4926abc0c6164f
2021-06-04 10:15:36 -04:00
Liz Kammer
74deed445b Extract function to handle configurable excludes
This allows it to be used for other modules types and other properties
(e.g. static_libs & exclude_static_libs).

Test: go test soong tests
Bug: 188497994
Change-Id: I40ab16e3b540ece0a6684558b32f7e8e25df6f24
2021-06-04 10:15:34 -04:00