Commit graph

923 commits

Author SHA1 Message Date
Dan Willemsen
ce69757379 Merge "Add Darwin x86_64+arm64 universal binary support" 2021-12-08 21:08:43 +00:00
Dan Willemsen
4745007bb1 Add Darwin x86_64+arm64 universal binary support
This is configured from Make by setting up Darwin+Arm64 as a HOST_CROSS
target (which is largely true, as binaries can't be executed on X86_64
machines). On the Soong side, it's a bit blurier, as we don't current
have any other users that are the same OS but not natively executable
(Linux/musl is executable, Windows/x86 is a different OS).

Instead of requiring cc_binary/etc to become multi-architecture-aware
and using something like common_first/MultiTarget, this defaults all
non-multi-architecture-aware modules to be built with both
architectures. It then adds a dependency with the
DarwinUniversalVariantTag so that supporting modules can get the outputs
of the other variant.

Cc uses that dependency tag to run lipo on shared libraries and binaries
so that the output of the x86_64 variant is actually a fat binary
including both architectures.

Bug: 203607969
Test: build sdk-repo targets on a Mac
Change-Id: Icbddb0a177c0ba19d3e0d11f8cf568e0d1ea3245
2021-12-07 22:01:25 -08:00
Chih-Hung Hsieh
80783774b9 Add (obj|tidy)-*_os, and (obj|tidy)-*_subset targets
* The obj-* targets only call clang or clang++ to compile
  C/C++ files, like the tidy-* targets only call clang-tidy.
* Add (obj|tidy)-dir_os and module_os-(obj|tidy) phony targets
  to include only targets of the specified OS.
* Add (obj|tidy)-dir_os_subset and module_os_subset-(obj|tidy) phony targets
  to include only a subset of that OS target group.
  * Most clang-tidy runs produce the same warnings for all variants
    of an OS. The *_subset targets reduce runs over multiple variants.
  * The obj-*subset targets are useful for a quick test to compile
    at least one variant of every C/C++ file for each OS.
* The (obj|tidy)-soong phony target is changed to include only
  (obj|tidy)-top_level_directory targets instead of ALL
  module-(obj|tidy) targets in all subdirectories.
* For aosp_arm64-eng make tidy-* targets; count NINJA commands:
    tidy-soong                     381K
    tidy-soong_subset              106K
    tidy-soong_android             294K
    tidy-soong_android_subset       73K
    tidy-soong_linux_glibc          84K
    tidy-soong_windows              12K
    tidy-bionic                     12K
    tidy-bionic_subset               2.4K
    tidy-bionic_android             11.5K
    tidy-bionic_android_subset       2.1K
    tidy-bionic_linux_glibc          1K
    tidy-device_android              7K
    tidy-device_android_subset       5K
    tidy-hardware_android            3K
    tidy-hardware_android_subset     9K
    libfec_rs-tidy                   33
    libfec_rs_subset-tidy             9
    libfec_rs_android-tidy           18
    libfec_rs_android_subset-tidy     3
* For aosp_arm64-eng make obj-* targets; count NINJA commands:
    obj-soong                      399K
    obj-soong_subset               112K
    obj-soong_android              305K
    obj-soong_android_subset        75K
    obj-soong_linux_glibc           90K
    obj-soong_linux_glibc_subset    38K
    obj-soong_windows               12K
    obj-bionic                      15K
    obj-bionic_subset                3K
    obj-bionic_android              14K
    obj-bionic_android_subset        2.3K
    obj-bionic_linux_glibc           1.3K
    obj-system-core                  6K
    obj-system-core_subset           3K
    obj-frameworks-base             16K
    obj-frameworks-base_subset       6K
    libfec_rs-obj                    33
    libfec_rs_subset-obj              9
    libfec_rs_android-obj            18
    libfec_rs_android_subset-obj      3

Test: NINJA_ARGS="-n" WITH_TIDY=1 make some_obj_tidy_target;
      compare output commands from various phony targets
Bug: 199169329
Bug: 202769240
Change-Id: I186c45dc07c5884888c1063dfc09cf212ffb0ebf
2021-12-07 12:58:11 -08:00
Chris Parsons
77acf2e5c1 bp2build: split full_cc_library into shared/static
Test: mixed_droid.sh in conjunction with rule changes
Test: bp2build.sh
Change-Id: If0577065fd39a0446eab16b62c15204d43207e19
2021-12-06 14:11:40 -05:00
Chris Parsons
494eef3dc8 Support host platform cc builds
This involves handling of linux-* platforms (identifying them
appropriately as host), disabling unsupported Windows platform, and
denylisting of still-problematic modules.

Test: mixed_droid, with verification that shared library artifacts
originate from bazel-out

Change-Id: Ib52db49a2d2a3c1ff9b76af23fd4f22cfc9182d0
2021-11-10 21:57:15 +00:00
Colin Cross
acfcc1f682 Move cc module installation into Soong
Move cc module installation rules into Soong by overriding
InstallBypassMake.  Update the locations that find host tools
to look in the Make installation directory instead of the Soong
installation directory, which will no longer be used.

The methods that find host tools are also used on go binaries,
so update the config methods that tell Blueprint where to install
go binaries to the Make installation directory too.

Bug: 204136549
Test: m checkbuild
Change-Id: Id172592c195e506102982a4af0084f6d9c68a896
2021-11-04 10:28:58 -07:00
Colin Cross
1bc9412fb3 Make installable arch-variant and static vs shared variant for cc modules
libc's native_bridge shared variant needs to be installable: false,
make the installable property arch-variant and allow the static and
shared clauses to override it.

This relands I8e0eaed2169e89520b07bb0326bb97ac0b4a70ac with fixes to
allow only the shared variant to be marked installable: false.

Bug: 204136549
Test: m checkbuild
Change-Id: Ie579b5ba56ca21f4d9243088afd5078d8c122a68
2021-10-29 15:00:38 -07:00
Jiyong Park
91f1b42226 Remove use_apex_name_macro
The property is no longer used.

Bug: 161926892
Test: m
Change-Id: I98948152d6d09bde2eeba4875c7ca01531a24930
2021-10-14 08:57:59 +09:00
Colin Cross
10ef62ea67 Merge changes from topics "bp-bionic-cts-tests", "cts-per-testcase-directory" am: 2df9ebf9ca
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1838375

Change-Id: I9fd93be8154f2f1372ccde1eb9a37690738692b7
2021-10-01 16:46:26 +00:00
Colin Cross
c8caa06a36 Add data_bins property
data_bins is similar to data_libs but copies helper binaries alongside
the test.

Bug: 200872604
Test: atest CtsBionicTestCases
Change-Id: I4f9df5f82816cfd30a0a19808fda220cf77c50a7
2021-09-27 15:56:26 -07:00
Christopher Parsons
f75a32998e Merge "Disable mixed builds for non-device OS" am: 4ea6052650
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1834999

Change-Id: I7bdd47462db00faeaa85917d47f310c17b134aae
2021-09-23 20:02:36 +00:00
Chris Parsons
1826621bdd Disable mixed builds for non-device OS
We don't currently support propagation of OS in mixed builds, and our
host toolchains are not properly configured.

This allows us to continue to make progress on device OS until host is
supported.

Test: mixed_libc CI
Test: USE_BAZEL_ANALYSI=1 m adbd
Change-Id: I2bf8b3f9ca7928dd33bf2fb3d4fa067da0f593f3
2021-09-23 14:11:42 -04:00
Treehugger Robot
6e5aabb91b Merge "Share cFlags, tidyFlags, etc. in a module" am: b1a12462a9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1824024

Change-Id: Iaf6050178f9d172a5a17103504e8f081277df9cf
2021-09-16 02:35:38 +00:00
Chih-Hung Hsieh
b8082295b6 Share cFlags, tidyFlags, etc. in a module
* In builder.go, share common flags in a module.
  * This replaces the sharing of cflags/cppflags/asflags in cc.go.
  * A unit test in apex_test.go now fails and is commented out.
    It is a failing test hidden by old optimization in cc.go.
* In module.go, expand the reference variable $someflags<n>,
  or ${someflags<n>} to keep many existing unit tests work as is.
* The build.ninja size was reduced from 8.1GB to 6.2GB,
  for aosp_arm64-eng WITH_TIDY=1 USE_RBE=true,
  and from 7.5GB to 5.6GB when USE_RBE is 0.
  Content of build.ninja is also more readable and searchable.
  Read/write build.ninja times are also reduced,
  depending on disk I/O speed.

Test: make WITH_TIDY=1
Change-Id: I17f96adf4844136d52e5d40f57a19d9e290162b7
2021-09-15 16:05:41 -07:00
Rob Seymour
dc2cc0d8d7 Merge "Add module based host-tools snapshot" am: f6c37cc87d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1793067

Change-Id: I3a2bb2459677c14e3e99d654ed5ffb9b7dd09b21
2021-09-14 15:04:01 +00:00
Rob Seymour
f6c37cc87d Merge "Add module based host-tools snapshot" 2021-09-14 14:47:03 +00:00
Rob Seymour
925aa09ea1 Add module based host-tools snapshot
Add new module:
host_snapshot {
    name: "host-snapshot"
    deps: [
      (list of host tools)
    ],
    ...
}

Package host tools using android.PackagingBase to capture host tools and transitive packaging data.
Add JSON meta data to snapshot that allows snapshot to be installed via development/vendor_snapshot/update.py

Add support to generate a fake host snapshot of all host modules that is used to detect required
modules via development/vendor_snapshot/update.py.

Bug: 192556798
Bug: 194799048
Bug: 192896149
Test: m HOST_FAKE_SNAPSHOT_ENABLE=true host-fake-snapshot dist -- check snapshot exists in dist

Change-Id: I849c4db801cd858408f6fe6a3ce69262a23a5be9
2021-09-13 21:29:14 +00:00
Treehugger Robot
e3e7ca657b Merge "Deprecate group_static_libs property" am: add0b0880e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1814113

Change-Id: Ia5711d638317dcda58628e76b1ba3919f2314cb4
2021-08-31 16:47:56 +00:00
LaMont Jones
5569d6eb47 Deprecate group_static_libs property
We now default to lld for platform builds, removing all need for this
property.  For more details, see "Effecient archive file handling" in
https://lld.llvm.org/NewLLD.html#key-concepts

Bug: 189475744
Test: Manual build succeeds
Change-Id: If1104d68b13de8c7afab35c1741a68f64394b448
2021-08-30 23:13:03 +00:00
Jiyong Park
b4adefa58e Merge changes I15328e0b,I731227c2 am: 19312d4224
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1808218

Change-Id: I58224f0fc056f174567241a13d9eb54dbaef5d12
2021-08-25 22:48:34 +00:00
Jiyong Park
5df7bd33f7 crt objects for APEX and vendor variants have correct target API levels
Previously, crt objects for APEX and vendor variants targetted API level
16 regardless of their context. For example, even if BOARD_VNDK_VERSION
is set to 29, or an APEX has `min_sdk_version: "29"`, the target API
level was from `min_sdk_version` property of the crt object which is set
to 16.

The meaning of min_sdk_version is quite different when it comes to crt
objects. It means the lowest API level that it CAN target for. It does
NOT mean the API level it SHOULD always target.

This has caused some other problems like TLS segment underalignment for
vendor libraries because the vendor libraries were all built with TLS
layout from API level 16.

This change fixes the problem by correctly implementing the different
semantic of min_sdk_version for crt objects.

Bug: N/A
Test: m nothing

Change-Id: I15328e0b6cbabbe151dd65c7469c6355e167b78a
2021-08-25 16:26:47 +09:00
Treehugger Robot
f82cdf018f Merge "Collect info on non-cc sources in a cc module." am: 4132ef45bb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1798371

Change-Id: I5195d3f4e0af043048f7570b69d9000d8775f947
2021-08-19 06:07:29 +00:00
Treehugger Robot
4132ef45bb Merge "Collect info on non-cc sources in a cc module." 2021-08-19 05:55:43 +00:00
Matthew Maurer
1678ccaeaa Merge changes I9682b978,I35465715,I9c5aa5f3,I1c76e620 am: a8b1ab0370
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1774010

Change-Id: I7d46bcfc463f859f6c44d6fae95abf6792aba15c
2021-08-19 03:13:16 +00:00
Matthew Maurer
c6868383f4 Support Rust in Ramdisk
Bug: 178565008
Bug: 165791368
Test: Build and link a Rust library into a ramdisk binary
Change-Id: I9682b978936624133e5a62e94caace0e8958fd0f
2021-08-17 15:08:49 -07:00
Matthew Maurer
a61e31f66a Support Rust in native-bridge
Bug: 178565008
Bug: 165791368
Test: Build and link a Rust library into a native-bridge binary
Change-Id: I3546571530529203d9dbfd62777f20de18c6bd51
2021-08-17 15:08:49 -07:00
Matthew Maurer
52af5b052b Support Rust in Product
Bug: 178565008
Bug: 165791368
Test: Build and link a Rust library into a product binary
Change-Id: I9c5aa5f3a1f323af9aa2aee804635045f1b91bd4
2021-08-17 15:08:49 -07:00
Matthew Maurer
460ee9429e Support Rust in Recovery
Bug: 178565008
Bug: 165791368
Test: Build and link a Rust library into a recovery binary
Change-Id: I1c76e6204019443c567082730a4cf680f4a2a74a
2021-08-17 15:08:49 -07:00
Liz Kammer
74ec1686aa Collect info on non-cc sources in a cc module.
Cc modules in Soong can contain non-cc srcs, collect information on
whether they exist in a module. This is not entirely precise as globs
are not evaluated and srcs from other modules (e.g. filegroups,
generated sources) are not handled; however, it should give a decent
lower bound on how often each type occurs.

Bug: 194938896
Test: SOONG_DUMP_JSON_MODULE_GRAPH=/tmp/json_srcs m nothing and verify
      outputs
Change-Id: I7ad52e863727cf5fa4e8d41cf04d27c86e395c6d
2021-08-17 17:29:51 -04:00
Xin Li
3eaa6bcecf Merge sc-dev-plus-aosp-without-vendor@7634622
Merged-In: I10ff6a5df76852f0a22fe3ac22df764528f07423
Change-Id: I71f2397f425a46d346e49ac422d256d7e049c7a2
2021-08-14 06:30:56 +00:00
hamzeh
c0a671fc80 Moving common fuzzing code to fuzz package
Test: make haiku and make haiku-rust
Change-Id: Ife80cc10672f51bd6afbae7061cc9373a2a15e7d
2021-08-11 23:54:15 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
3079d96120 Merge "Lift BazelHandler interface into android/" am: ccb6a01324 am: 4e088148d3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1793169

Change-Id: I4ed98cbd30139e5c2d91164c3447ef295970ae17
2021-08-11 21:36:03 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
0d99045b69 Lift BazelHandler interface into android/
Because it's commonly useful and not cc/ specific
Also export GenerateBazelBuildActions and update uses

Test: Existing tests pass
Change-Id: Ibc6858bb1129afba181a7686dda432defe33b00d
2021-08-11 18:19:40 +00:00
Justin Yun
df032badd8 Rewrite snapshot dependencies for vndk-ext am: 27b9572433 am: 1a45180fe7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1779758

Change-Id: I6413423b86eccb8d28cbfa1213806eb8c7147f7d
2021-07-30 18:35:34 +00:00
Yi-Yo Chiang
e2027b2526 Merge changes from topic "variational-required" am: d7b95f94a1 am: e3c9611b24
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1739833

Change-Id: I00420ba0a1409254125935e8c1a4c3610fa44536
2021-07-30 18:35:25 +00:00
Justin Yun
27b9572433 Rewrite snapshot dependencies for vndk-ext
VNDK-ext libraries have dependency on VNDK libraries. When building
against snapshots, the dependency must be rewritten with the
snapshots.

Bug: 194864314
Test: m nothing
Change-Id: I1244c6a6590e89b344ab39514bb5142d36b04268
2021-07-30 10:49:02 +00:00
Yi-Yo Chiang
c7e044f531 cc/cc.go: Support per-image-variation "required"
Support "core" and "recovery" variants for now. Might add more image
types if needed.

Bug: 191369319
Test: Presubmit
Test: Inspect out/soong/Android-*.mk
Change-Id: Iebab29ed5d6d8fe9c66b6d6e56e00246d10c36b3
2021-07-24 22:44:36 +08:00
Treehugger Robot
fba8644b97 Merge "Remove default_shared_libs" am: 2231f8a21c am: 0cddfa441d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1775072

Change-Id: Id3f0baada1ba1fdb209fdd24569ecbbf3fe99722
2021-07-23 21:28:09 +00:00
Treehugger Robot
2231f8a21c Merge "Remove default_shared_libs" 2021-07-23 21:18:51 +00:00
Colin Cross
6b8f4253eb Remove default_shared_libs
system_shared_libs has been modified to have the same behavior as
the newly added default_shared_libs, remove default_shared_libs in
favor of system_shared_libs.

This reverts Ia2349d84c70e503916f90a5d2702e135248f73df and renames
the default_shared_libs property in cc_object (which never had
system_shared_libs) to system_shared_libs.

Bug: 193559105
Test: m checkbuild
Change-Id: I46672e3a096b6ea94ff4c10e1c31e8fd010a163c
2021-07-22 12:10:11 -07:00
Treehugger Robot
266d97fa2a Merge "Refactoring fuzz packaging code" am: 0b45f0b90f am: c62f2deb45
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1758711

Change-Id: Ib7b2a903e1f5a8a52c38272704c67b9e92cfef94
2021-07-19 20:34:57 +00:00
hamzeh
41ad881e16 Refactoring fuzz packaging code
Rust and cc fuzz packaging have common. This change is to put this
common methods and fields into fuzz_common.

Test: make haiku and make haiku-rust ran locally and verify corpus,
dict and config are packaged along with the executable.

Change-Id: I04bf535cd2597ed8b2bd3d8e6ea8c28f38bdc18b
2021-07-16 17:43:33 -07:00
Treehugger Robot
90fd09de6b Merge changes from topic "vendor_snapshot-192647618" am: da70df7277 am: 4ba5a02a4d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1755250

Change-Id: Iee6ae2a99d36117e9099a6c926b0c0c46ec42436
2021-07-13 09:24:26 +00:00
Treehugger Robot
da70df7277 Merge changes from topic "vendor_snapshot-192647618"
* changes:
  cc/cc.go: Harden GetSnapshot() against nil pointer panic
  cc/cc.go: Add Device() method to LinkableInterface
2021-07-13 08:54:11 +00:00
Liz Kammer
7b6484325b Merge changes If89b7d0b,I630c06f0,Id861a62b,If71bb468 am: 1a0e2d20b3 am: 60cd3b9609
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1749407

Change-Id: I4346f2ae9432e2cd375bdbacb4a422105d73f3c5
2021-07-09 21:12:19 +00:00
Liz Kammer
75db931843 Iterate over sanitizers
Test: go test soong tests
Change-Id: If89b7d0b04cad79b42a08504d4fcff36e914b7a4
2021-07-08 11:19:15 -04:00
Liz Kammer
acd1fb16d5 Merge changes I770f5ce7,I32d4417d am: 4aa48b03ea am: 1d9b80262e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1749405

Change-Id: I21460aae0a59264de829322d6f1408c6322934ad
2021-07-08 13:39:51 +00:00
Liz Kammer
187d5445e8 Remove IsDependencyRoot from interface
This is equivalent to Binary() -- reduce the interface and improve
clarity.

Test: go test soong tests
Change-Id: I770f5ce79fd4d888586d31ec5e67be88153626b6
2021-07-07 16:29:09 -04:00
Yi-Yo Chiang
ec14a4ded8 cc/cc.go: Harden GetSnapshot() against nil pointer panic
* Retrieve SnapshotInfo only if the calling module is device-variant.
* Test for nil-ness before calling ctx.OtherModuleProvider().

Bug: 192647618
Test: Presubmit
Change-Id: Ida8582f756e1b15f8c14c816ed6e736b47995877
2021-07-03 19:20:02 +08:00
Treehugger Robot
7038af4d66 Merge "Include static lib information for the snapshot modules" am: 503e3a10b2 am: 5caf0040d1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1751245

Change-Id: If5dffdebf163416ebcf3654222513e2becd745eb
2021-07-02 00:34:02 +00:00
Treehugger Robot
787f1d9086 Merge "Delete unused functions" am: 31b9a0c9da am: d6f6a86e34
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1749403

Change-Id: Iac4dd19b2984f28d89e0c4e75117f197407674a4
2021-07-02 00:12:54 +00:00
Treehugger Robot
503e3a10b2 Merge "Include static lib information for the snapshot modules" 2021-07-01 22:24:33 +00:00
Treehugger Robot
31b9a0c9da Merge "Delete unused functions" 2021-07-01 22:20:04 +00:00
Justin Yun
5e03586365 Include static lib information for the snapshot modules
snapshot modules require the list of static libs to find the NOTICE
files for the snapshot modules.
snapshot binaries must include static_executable property to check if
non static binaries have libc as a static lib.

Bug: 190690041
Test: Check NOTICE for libaudiopreprocessing.so built from snapshots.
Change-Id: I53f7549a158ab27ada87833a3f4d58620aa7c3cf
2021-07-01 11:42:28 +00:00
Colin Cross
247724099f Merge "Add default_shared_libs property" am: e19e6196b9 am: dc07b677eb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1743043

Change-Id: Ie6fc62d8460aaacff7a6b66d96c9ff21bffd96ef
2021-06-30 18:13:48 +00:00
Colin Cross
e19e6196b9 Merge "Add default_shared_libs property" 2021-06-30 14:27:20 +00:00
Liz Kammer
3b606c8218 Delete unused functions
As they're unused, also removing them from the interface.

Test: go test soong tests
Change-Id: I76e7cbca12876395d8d7eaae4481c5e0d1350d76
2021-06-28 12:29:30 -04:00
Jiyong Park
56a39ad6d9 Merge changes from topic "stub_from_rust"
* changes:
  Add platform_apis property to APEX module type
  Rust module in APEX uses stub libraries across APEX boundaries
2021-06-25 17:52:43 +00:00
Lukács T. Berki
2f20de6c24 Merge "Dump extra JSON data for C++ modules and ApexInfo." am: 141fbad0e4 am: 3f5770c5a7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1748053

Change-Id: I08cafbda9baa1898562d8d70602bb6b05320c1f8
2021-06-25 11:26:32 +00:00
Lukacs T. Berki
d18d8cab73 Dump extra JSON data for C++ modules and ApexInfo.
Test: Presubmits.
Change-Id: I96cf67c6f1338aed9d2ab5834a14b8a40a9e5b45
2021-06-25 11:15:40 +02:00
Jiyong Park
1bc8412d37 Add platform_apis property to APEX module type
The property is used to allow non-updatable APEXes to use platform APIs
(e.g. symbols marked as "# platform-only").

Bug: 191637950
Test: m com.android.virt com.android.compos
Merged-In: Id2410b4e38a78ec2146a42298840954381a7c472
Change-Id: Id2410b4e38a78ec2146a42298840954381a7c472
(cherry picked from commit fb63625a7f)
2021-06-24 19:50:32 +09:00
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
Jiyong Park
9477c26f6c Add platform_apis property to APEX module type
The property is used to allow non-updatable APEXes to use platform APIs
(e.g. symbols marked as "# platform-only").

Bug: 191637950
Test: m com.android.virt com.android.compos
Merged-In: Id2410b4e38a78ec2146a42298840954381a7c472
Change-Id: Id2410b4e38a78ec2146a42298840954381a7c472
(cherry picked from commit fb63625a7f)
2021-06-24 11:28:33 +09:00
Jiyong Park
7d55b61783 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 11:27:41 +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
Colin Cross
9ecb42dd31 Add default_shared_libs property
Building against a locally-built libc besides bionic requires setting
system_shared_libs to avoid circular dependencies, but modules all
over the tree assume that system_shared_libs only affects modules
building against bionic.  Add a new default_shared_libs property
that applies to all modules, which will generally be set in
arch-specific clauses to only affect the desired set of modules.

Bug: 190084016
Test: m checkbuild
Change-Id: Ia2349d84c70e503916f90a5d2702e135248f73df
2021-06-22 16:54:40 -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