Commit graph

809 commits

Author SHA1 Message Date
Jiyong Park
105dc321ce Rust module in APEX uses stub libraries across APEX boundaries
This change fixes a bug that rust module in APEX has access to private
symbols of a native library even when the native library is outside of
the APEX.

To fix this, the stub selection logic in the cc package is exctacted as
a function ChooseStubOrImpl and is used also in the rust package.

Bug: 190767845
Test: m
Merged-In: I5c4cbdd5d27f257ab329d9dadbcd87d41a87f46a
Change-Id: I5c4cbdd5d27f257ab329d9dadbcd87d41a87f46a
(cherry picked from commit 3b5f88e091)
2021-06-24 19:50:06 +09:00
TreeHugger Robot
89f175d8c7 Merge "Propagated srcs from cc_defaults to cc_prebuilt_library_shared." into sc-dev am: ffc9ae993a
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15084348

Change-Id: Ib6f3da05acf25c7af0bc1f4d0b36ca15759c8367
2021-06-24 00:27:51 +00:00
Yu-Chi Cheng
24b2b0fd0c Propagated srcs from cc_defaults to cc_prebuilt_library_shared.
Bug: 191185522
Test: verified on local P21 devices.
Change-Id: I3bab7144213934f6832000793ee6cbc49abd3beb
2021-06-23 15:56:39 -07:00
Inseob Kim
2b33796316 Add install_in_root to cc_binary am: 800d114003 am: 6fa77e896d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1736433

Change-Id: I64bdfcae1a7d939a89e0e37f9016fd46eedaf96c
2021-06-18 18:14:53 +00:00
Inseob Kim
800d114003 Add install_in_root to cc_binary
To support init_first_stage, install_in_root property is added to
cc_binary. The output is installed to {partition}, rather than
{partition}/{mount_point}/bin.

Bug: 187196593
Test: build init_first_stage
Change-Id: Ibc351645308676ed188f748972eb6312c9cbd64f
2021-06-18 05:25:44 +00:00
Lukács T. Berki
ed539ad624 Merge "Make the IsSdkVariant field and method the same." am: 419117ee89 am: 288dc903aa
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1738338

Change-Id: If641ea419f7458f7650085404b64da4f041c05c9
2021-06-17 12:12:56 +00:00
Lukacs T. Berki
2063a0d7b8 Make the IsSdkVariant field and method the same.
Before, the IsSdkVariant() method also checked AlwaysSdk(). Instead,
sdkMutator now sets the IsSdkVariant field to True even for the single
variation it creates when AlwaysSdk is true.

Test: Presubmits.
Change-Id: Ied8b42a3441a30484ef8c5dff5aade5fe92574bb
2021-06-17 09:32:36 +02:00
Colin Cross
2613002a07 Merge changes from topic "ndk_libandroid_support_late_static_libs" am: 9fb2d1fb62 am: fe6f1e6fd0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1736360

Change-Id: Ic91c7d7085e6eb2f5387c965452afd54fe207323
2021-06-16 22:21:38 +00:00
Colin Cross
9fb2d1fb62 Merge changes from topic "ndk_libandroid_support_late_static_libs"
* changes:
  Use LateStaticLibs for ndk_libandroid_support
  Move LateStaticLibs after SharedLibs in the dependency include order
  Test include directory ordering
2021-06-16 21:54:37 +00:00
Colin Cross
cc351c4b48 Merge "Use a linker script for host bionic embedded linker sections" am: 956e32c1be am: ca1129695e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1735344

Change-Id: I7d03c244965df18361a93ba37b81bd1ab7106849
2021-06-16 17:18:30 +00:00
Colin Cross
e32bfdbbf4 Merge changes Ie384089d,Ie2e954cd am: baf4f0c30a am: d701a34838
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1735343

Change-Id: I8e9df129e07529835e47475e8683447fc5d6dd51
2021-06-16 17:18:24 +00:00
Colin Cross
956e32c1be Merge "Use a linker script for host bionic embedded linker sections" 2021-06-16 16:51:10 +00:00
Colin Cross
baf4f0c30a Merge changes Ie384089d,Ie2e954cd
* changes:
  Support genrules as CrtBegin and CrtEnd
  Support multiple CrtBegin and CrtEnd files
2021-06-16 16:50:59 +00:00
Lukács T. Berki
b5db5a2b42 Merge "Update some comments about the image mutator." am: 84a1601804 am: 4c8d04dcf5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1737526

Change-Id: I275d5ef464557b5faf99fa554b28bf9749b0cdc2
2021-06-15 16:45:35 +00:00
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
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
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
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
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
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
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
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
Dan Albert
f1d14c7e67 Use libabigail to track NDK ABIs.
The local diffing behavior is currently flagged off so we can land
this in stages.

Test: pytest cc
Test: treehugger
Test: development/tools/update_ndk_abi.sh
Test: m ndk
Bug: http://b/156513478
Change-Id: Iccb314411bc74ea3ddfea8b85b0539709295f65a
2021-06-03 14:29:03 -07:00
Ivan Lozano
4c23bb16ef Merge changes I4976d3e1,I4c53b937,I502eaa4b am: 42b7157ff6 am: acbf71ae2b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1719775

Change-Id: I772839da81467c6453500f994e060a859031a175
2021-06-03 17:26:21 +00:00
Ivan Lozano
529498258a Merge "Export cc vendor functions for usage by rust." am: 39f901a137 am: 99678b3669
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1716892

Change-Id: Iba88111c9631117e9280d26d2b3a1362c3f4db9c
2021-06-03 16:26:04 +00:00
Ivan Lozano
d1dec54988 Export cc functions for snapshotting Rust rlibs.
Export additional fuctions, structs, and interfaces from cc for use in
the rust package to allow for rlib snapshotting.

Bug: 184042776
Test: m nothing
Change-Id: I4c53b9378d5d5b5973dbd23ab692cdfb2ede60b9
2021-06-03 08:34:47 -04:00
Ivan Lozano
d67a6b0a88 Export cc vendor functions for usage by rust.
This CL exports and refactors some cc vendor-snapshot related functions
so they can be reused by rust modules to support vendor snapshotting.

Bug: 184042776
Test: m nothing
Change-Id: I12706e62ce0ac3b2b4298085fafc1d77b8e0a0c4
2021-06-03 08:31:55 -04:00
Treehugger Robot
7577a2d094 Merge "Remove versioned LLNDK stubs" am: ebdf61ece2 am: db246b5784
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1698870

Change-Id: Ieed2cc19c37d477d5f90c2e42a901e90e7d748c9
2021-06-01 22:27:07 +00:00
Treehugger Robot
ebdf61ece2 Merge "Remove versioned LLNDK stubs" 2021-06-01 18:38:52 +00:00
Colin Cross
58b783b460 Remove unused cc.copyDirectlyInAnyApexDependencyTag
Bug: 183759446
Test: go test ./build/soong/cc
Change-Id: I967f5c42cbf7722843a6455cbc2867a8912033cb
Merged-In: I967f5c42cbf7722843a6455cbc2867a8912033cb
(cherry picked from commit 243f3c250e)
2021-05-27 13:13:17 -07:00
Colin Cross
532e863da0 Merge changes I0116f5f4,I950c9b54,I967f5c42 am: 4ab2dd1afe am: 7ca753793f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1718475

Change-Id: I864c97d90aa8f2ec4e43ac9d39464ca257b608e2
2021-05-27 01:38:25 +00:00
Colin Cross
243f3c250e Remove unused cc.copyDirectlyInAnyApexDependencyTag
Bug: 183759446
Test: go test ./build/soong/cc
Change-Id: I967f5c42cbf7722843a6455cbc2867a8912033cb
2021-05-25 18:28:38 -07:00
Jiyong Park
712e8b5b1b Rename InApexes -> InApexVariants
.. in preparation for the upcoming change. This change doesn't alter any
behavior.

InApexes is a misleading name. People expects that it has the list of
soong module names of the APEXes that a module is part of. So, for
example, `core-oj` is a part of both `com.android.art` and
`com.google.android.art`. However, in reality, that's not true. The
field has `com.android.art` only. This is because the two APEXes
(android and Google) have the same apex name which is `com.android.art`.
That apex name is used in various places like the `apex_available` and
allows us to keep using the same name regardless of whether the APEX is
overridden or not.

However, this is causing problems in some cases where the exact list of
soong module names is required. The upcoming change will add a new field
to handle the case and the new field actually will get the name
'InApexes'. So, the existing field is renamed to a less misleading name
`InApexVariants`.

Cherry-picked from https://r.android.com/1710528.

Bug: 180325915
Test: m nothing

Change-Id: I0c73361b452eddb812acd5ebef5dcedaab382436
Merged-In: I0c73361b452eddb812acd5ebef5dcedaab382436
2021-05-20 17:36:22 +01:00
Jiyong Park
1df9944677 Merge changes I4e7a7ac5,I0c73361b am: 6fae608181 am: 058b7332db
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1710529

Change-Id: I45f947f67305801b2389c2dcb84b66caf997cea1
2021-05-20 10:42:10 +00:00
Jiyong Park
ab50b0795a Rename InApexes -> InApexVariants
.. in preparation for the upcoming change. This change doesn't alter any
behavior.

InApexes is a misleading name. People expects that it has the list of
soong module names of the APEXes that a module is part of. So, for
example, `core-oj` is a part of both `com.android.art` and
`com.google.android.art`. However, in reality, that's not true. The
field has `com.android.art` only. This is because the two APEXes
(android and Google) have the same apex name which is `com.android.art`.
That apex name is used in various places like the `apex_available` and
allows us to keep using the same name regardless of whether the APEX is
overridden or not.

However, this is causing problems in some cases where the exact list of
soong module names is required. The upcoming change will add a new field
to handle the case and the new field actually will get the name
'InApexes'. So, the existing field is renamed to a less misleading name
`InApexVariants`.

Bug: 180325915
Test: m nothing

Change-Id: I0c73361b452eddb812acd5ebef5dcedaab382436
2021-05-18 16:05:14 +09:00
Treehugger Robot
0290f6e772 Merge "Soong: check if lndk is needed for apex build" am: ef0439d969 am: 2a4deaaf6d am: 7a89365bc1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1705069

Change-Id: Iaf8d854ab9548591698c1e8240a26124d904a268
2021-05-13 23:23:58 +00:00
Zhijun He
ec2858799b Soong: check if lndk is needed for apex build
This is to fix the unnecessary dependencies inclusion
when building apex modules.

Test: Build
Bug: 186306595
Change-Id: I1f3bbdb0a1f97a8338b45ca29c92acf9b20eadd3
2021-05-13 14:04:45 -07:00
Paul Duffin
b964b24a51 Merge "Allow module types to force creation of a default APEX variant" am: 9896b3424b am: 05ca6f6919 am: 5c45498964
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1705263

Change-Id: I4365d9d1dfbfcd8bf9aa3f6381ec9470b7ff9921
2021-05-13 09:06:26 +00:00
Paul Duffin
9896b3424b Merge "Allow module types to force creation of a default APEX variant" 2021-05-13 08:07:19 +00:00
Ivan Lozano
a072c5ae56 Merge "Refactor vendor snapshot to use LinkableInterface." am: 7ce2dee09e am: 61c475060a am: 001c11e93a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1680606

Change-Id: Ifff15886dba6bda0754d086456a1db3b7524e4ed
2021-05-12 21:13:41 +00:00
Ivan Lozano
d7586b6526 Refactor vendor snapshot to use LinkableInterface.
Refactors the vendor snapshot support to use the LinkableInterface
so that support can be extended to Rust. This CL does not add
vendor snapshot support for Rust; that is left for a follow-on CL.

Bug: 184042776
Test: m nothing
Change-Id: Id0c4970ca00053484a52677d182153cbc454c301
2021-05-12 14:01:10 -04:00
Paul Duffin
b5769c15a3 Allow module types to force creation of a default APEX variant
Bug: 187910671
Test: m droid
Change-Id: I797d4ab60d15b526744fe6e4df1b55c8b75b0310
2021-05-12 16:16:51 +01:00