Commit graph

6611 commits

Author SHA1 Message Date
Justin Yun
d396515482 Remove test_min_api_level property
Replace the test_min_api_level property with
test_options.min_shipping_api_level.

Bug: 187258404
Test: build
Change-Id: Ifbac62f389226ed690f0ec03b9cc0845132ae885
2021-12-09 00:16:41 +00:00
Colin Cross
b674b43656 Add dependency license annotations
Add annotations to dependency tags that are dynamic or classpath
linkage.

Bug: 207445310
Test: m checkbuild
Change-Id: Ife89b8f234aa40c380c721eda7dd18cab697fbb3
2021-12-08 15:08:59 -08:00
Dan Willemsen
e3d50bfba9 Support macOS 12 SDK
Test: build w/Xcode 13.1
Change-Id: I9062b8045c4b02551aeeff06f4d7416c766e53a6
2021-12-08 22:12:49 +00:00
Dan Willemsen
ce69757379 Merge "Add Darwin x86_64+arm64 universal binary support" 2021-12-08 21:08:43 +00:00
Liz Kammer
92d4188c2b Merge "Propagate headers from bazel to mixed builds" 2021-12-08 13:24:08 +00:00
Treehugger Robot
939cb7b028 Merge "Add (obj|tidy)-*_os, and (obj|tidy)-*_subset targets" 2021-12-08 06:03:14 +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
Treehugger Robot
d2d8e322f1 Merge "Add vendor_available: true to libbuildverison" 2021-12-07 21:20:27 +00: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
Liz Kammer
eb2d6d1ffd Propagate headers from bazel to mixed builds
Bug: 208503274
Test: mixed_libc.sh
Change-Id: I0be57f2a22f48be3a919208db4034d2bd03c18c0
2021-12-07 10:25:11 -05:00
A. Cody Schuffelen
580b93c3e8 Add vendor_available: true to libbuildverison
This allows using libbuildversion in Cuttlefish, which builds many
binaries for both vendor and host.

On vendor executables, this gets the build id from the
ro.vendor.build.version.incremental property.

Bug: 206843934
Test: m -j
Change-Id: I9ab11b42de3f1febf282f107c3e137592097d3c0
2021-12-06 22:08:40 -08:00
Yi Kong
196b926ac2 Move "-fdebug-info-for-profiling" flag to device binaries only
We do not profile host binaries. Moving to device binaries only helps
saving some disk space as well as shortening build time.

Test: presubmit
Change-Id: I09afb106d0e2ee250b3bc75d9dfd9cb8b6552c97
2021-12-07 13:51:38 +08:00
Yi Kong
b0d167cb43 Merge "addSamplingProfileGatherFlags is no longer needed" 2021-12-07 04:27:14 +00:00
Chih-hung Hsieh
970f8388a8 Merge "object files depend only on NDK headers" 2021-12-07 02:00:50 +00:00
Christopher Parsons
58a2eec1a7 Merge "bp2build: split full_cc_library into shared/static" 2021-12-06 22:32:49 +00:00
Treehugger Robot
2a7092927c Merge "[cc/sanitize] Re-enable new pass manager for fuzzer targets" 2021-12-06 21:40:11 +00: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
Liz Kammer
85c0097d69 Merge "bp2build: support full/lite protos in cc libs" 2021-12-06 14:46:34 +00:00
Yi Kong
5ded619f3e addSamplingProfileGatherFlags is no longer needed
We already add the "-fdebug-info-for-profiling" flag globally by default.
Besides, Sampling PGO does not need additional target-specific build
flags, unlike instrumentation PGO.

This is preparation to separate out sampling pgo into a separate module.
NFCI.

Test: presubmit
Change-Id: Icb28a98c021a78db25d8cb5ca9694ed6b7367a8d
2021-12-06 08:14:00 +00:00
Chih-Hung Hsieh
f6ca1b961b object files depend only on NDK headers
* shared libraries and binaries can depend on NDK share libraries

Bug: 208310402
Test: WITH_TIDY=1 make tidy-soong
Test: WITH_TIDY=1 make droid
Change-Id: I88ca8555c62d5ca49e36ca089749722166afec30
2021-12-05 18:10:13 -08:00
Chih-hung Hsieh
23d5d986fe Merge "No NDK libraries in clang-tidy pathDeps" 2021-12-03 23:14:18 +00:00
Liz Kammer
12615dbbca bp2build: support full/lite protos in cc libs
Test: bp2build.sh
Bug: 200601772
Change-Id: I3a7e00546726bc63b5eb8d5604557c5988a5320b
2021-12-02 11:00:46 -05:00
Liz Kammer
a9351ef6e6 Merge "Support empty strings in bp2build" 2021-12-02 15:35:10 +00:00
Martin Stjernholm
eca59f3dee Merge changes Ied267053,Ica29c649
* changes:
  Fix prebuilt header files to produce proper AndroidMk entries.
  Reduce code duplication for testing the two header modules.
2021-12-02 14:50:47 +00:00
Martin Stjernholm
d51cb5c130 Fix prebuilt header files to produce proper AndroidMk entries.
Necessary for modules that depend on headers through
LOCAL_HEADER_LIBRARIES in legacy Android.mk files.

Test: m nothing
Test: m nothing SOONG_CONFIG_art_module_source_build=false
  on internal master
Test: m droid checkbuild SOONG_CONFIG_art_module_source_build=false
Test: m SOONG_CONFIG_art_module_source_build=false \
        out/soong/.intermediates/prebuilts/module_sdk/art/current/sdk/prebuilt_jni_headers/linux_glibc_x86_64/prebuilt_jni_headers.a
      ar t out/soong/.intermediates/prebuilts/module_sdk/art/current/sdk/prebuilt_jni_headers/linux_glibc_x86_64/prebuilt_jni_headers.a \
        && echo ok
Bug: 202192894
Change-Id: Ied267053d1fc3563870a3faaf41d79983a22815a
2021-12-02 10:54:45 +00:00
Pirama Arumuga Nainar
7448392895 [cc/sanitize] Re-enable new pass manager for fuzzer targets
Bug: http://b/133876586

This was turned off but the upstream change fixing this has been long
part of the Android toolchain.

Test: Output of
  m aidl_parser_fuzzer; readelf aidl_parser_fuzzer | grep -c sancov
hasn't changed.

Change-Id: Id7edd7ac5791b0e031fd4af46381acdbb1b80d47
2021-12-01 20:47:52 -08:00
Jooyung Han
3d221b302a Merge "Set min_sdk_version (system/core)" 2021-12-02 02:27:20 +00:00
Treehugger Robot
bc1d8dd659 Merge "Revert "Enable hwasan use after scope detection."" 2021-12-01 18:13:39 +00:00
Martin Stjernholm
611e140043 Reduce code duplication for testing the two header modules.
Preparation for adding more tests to them.

Test: m nothing
Bug: 202192894
Change-Id: Ica29c649c4669e821371fbf8360f437871b7d041
2021-12-01 16:04:34 +00:00
Liz Kammer
46fb7aba4d Support empty strings in bp2build
Previously, could not set an empty string as a value of an attribute;
however, this is necessary in some cases. To not unnecessarily create an
empty string, use string pointers for attributes rather than strings.

Test: go test bp2build tests
Change-Id: I03b3a3567452d455246d22d81f86c317d06b7c39
2021-12-01 10:14:49 -05:00
Florian Mayer
77d0035a07 Revert "Enable hwasan use after scope detection."
This reverts commit 753dd32123.

Reason for revert: Broke hwasan postsubmit and https://r.android.com/1906006 does not seem to fix it. Reverting while investigating.

Change-Id: I0033314ac936e7062dc785b3b362ead0b5e9d8f0
2021-12-01 02:31:45 +00:00
Chih-Hung Hsieh
5b72153646 No NDK libraries in clang-tidy pathDeps
Bug: 208310402
Test: WITH_TIDY=1 make tidy-soong
Change-Id: I530fc23a1f6215b8c7f8f2bfcb235d6f58c2a702
2021-11-30 17:31:23 -08:00
Florian Mayer
413da04189 Merge "Enable hwasan use after scope detection." 2021-11-30 18:36:48 +00:00
Chris Parsons
79bd2b7761 bp2build implementation for c_std
Test: mixed_droid in conjunction with topic changes
Change-Id: Ic673c1b269f5082b490b32057eb60f3b73eb0940
2021-11-29 18:38:31 -05:00
Martin Stjernholm
e65c3aee02 Fix prebuilt selection logic for cc_prebuilt_library_headers.
Unlike other prebuilt modules it doesn't have a srcs property of any
kind, so android.Prebuilt cannot defer to the source module just
because its srcsSupplier would return nil.

Test: m nothing
Bug: 202192894
Change-Id: Iafcf165569bad6eae37820cf71aa0fcacb720e02
2021-11-24 20:48:04 +00:00
Jingwen Chen
58ff6801f4 Fix bp2build select generation for inter-attribute soong config
variable usage.

There's bug a in the current soong_config_variable handling
implementation where a soong_config_variable sets conditions_default
value for an attr, and a non-conditions_default value for another attr.
This results in the former attr not properly setting the zero value for
the non-conditions_default select key, resulting in the pretty printer
omitting the attribute totally.

The current implementation in this CL ensures that the zero value is set
whenever this happens at the module level. This is seen in
library_linking_strategy_cc_defaults (see comments in code, and the new
tests)

Test: CI
Bug: 198556411

Change-Id: Ibaeb94508c51a7429fb7a08df610cbb5470f76d2
2021-11-23 08:37:30 +00:00
Jack Yu
bc07b0c67e Merge "Support for OMAPI Vendor stable interface" 2021-11-23 04:54:02 +00:00
Jooyung Han
4a8f41081e Set min_sdk_version (system/core)
Many modules requiring min_sdk_version have been used without setting
it, but hard-coded in allowlist.

Bug: 158059172
Test: m
Change-Id: Ibb09ddfdb11df0791a28eb8a0a49f1780084fd95
2021-11-23 11:10:38 +09:00
Treehugger Robot
3eb75a72a0 Merge "Revert "Revert "Switch to clang-r437112""" 2021-11-22 22:07:06 +00:00
Chih-hung Hsieh
933e7014da Revert "Revert "Switch to clang-r437112""
This reverts commit 1973f4d2cc.

Reason for revert: try to fix the failed test

Change-Id: I70b6e32d45db9e272432c85233cbf38e1e38a6ad
Bug: 201432564
2021-11-17 22:53:25 +00:00
Florian Mayer
753dd32123 Enable hwasan use after scope detection.
Test: flash & boot flame_hwasan-userdebug
Test: run parts of CTS on flame_hwasan-userdebug

Bug: 184289082
Bug: 172507966
Change-Id: I520bf57df57df45a63bc06a47462d6dc9a541828
2021-11-17 19:55:55 +00:00
Treehugger Robot
88560585be Merge "Revert "Switch to clang-r437112"" 2021-11-17 15:23:44 +00:00
Martin Stjernholm
1973f4d2cc Revert "Switch to clang-r437112"
This reverts commit 0d58894613.

Reason for revert: Suspected culprit for test failure b/206716119

Change-Id: Ibdd0aa783e07df5b41fd804efd175c12a7fe6592
2021-11-17 12:23:49 +00:00
Treehugger Robot
6515910b4f Merge "Switch to clang-r437112" 2021-11-16 23:03:07 +00:00
Chih-Hung Hsieh
0d58894613 Switch to clang-r437112
* to test with build 7917927

Bug: 201432564
Test: make
Change-Id: Ic21f76f238abb2727e559ece41fd6cc76fb69f85
2021-11-16 18:18:08 +00:00
Ivan Lozano
aed0adfee9 Merge "rust: Add Recovery Snapshot Soong tests for rust." 2021-11-16 13:47:18 +00:00
Ivan Lozano
b993a835c3 Merge "rust: Add data_libs and data_bins to rust_test" 2021-11-16 13:46:49 +00:00
Treehugger Robot
59a5cb072b Merge "Refactor ProductConfigProperties to use a struct key instead of an string key with hardcoded patterns." 2021-11-16 04:55:15 +00:00
Jingwen Chen
25825ca08d Refactor ProductConfigProperties to use a struct key instead of an
string key with hardcoded patterns.

This fixes a bug with label list conditions_default attrs where the
attribute values get clobbered in a map with the keys
"conditions_default" (with a default empty list) and
"acme__feature__conditions_default" (with a non-empty list) when
generating the LabelListAttribute.

Test: CI
Change-Id: I5429e40f747b7a0ed559f8a468a4831cd32df2c0
2021-11-16 02:50:22 +00:00
Ivan Lozano
3e1bc6cc0d Merge "Use new soong_cc_rust_prebuilt.mk" 2021-11-15 22:19:46 +00:00
Ivan Lozano
4e5f07d27b rust: Add data_libs and data_bins to rust_test
Allows defining data binaries and libraries that should be installed
alongside a rust_test module, similar to cc_test.

This refactors cc_test as well so it can define rust_ffi_shared and
rust_binary modules as data.

Bug: 171710847
Test: New Soong tests pass.
Test: Example module installs data appropriately.
Change-Id: I0b56098fb475ec54f9b7a761220d260fe68cbee1
2021-11-15 17:18:42 -05:00
Ivan Lozano
c2ca1ee83d rust: Add Recovery Snapshot Soong tests for rust.
Bug: 197866992
Test: m nothing
Change-Id: I4b5401cf2ffa0dbcc6fea60f90bad4c47a9d5e6b
2021-11-15 17:11:20 -05:00
Colin Cross
cb16a92ee4 Merge "Mark vndkLibrariesTxt modules as device modules" 2021-11-12 23:30:51 +00:00
Ivan Lozano
94e8a651fa Merge changes I26198187,Ia904d07b
* changes:
  rust: Support MTE memtag_heap sanitizer
  rust: Support global sanitizers
2021-11-12 19:26:04 +00:00
Ivan Lozano
d06cc748c1 Use new soong_cc_rust_prebuilt.mk
soong_{cc,rust}_prebuilt.mk has been merged. Use the new file.

Bug: N/A, clean-up
Test: m
Change-Id: I3f03e866815f6394aacd8cb0deba04f381b78c29
2021-11-12 13:27:58 -05:00
Colin Cross
45bce85fc9 Mark vndkLibrariesTxt modules as device modules
vndkcorevariant.libraries.txt needs to be installed onto the device,
mark the vndkLibrariesTxt module type as a device module so that
PathForModuleInstall returns a path in the system partition.

Bug: 204136549
Test: m checkbuild
Change-Id: Ic2aadff27cee6a5e6352ceaf61b707ad3e5b531f
2021-11-12 09:12:22 -08:00
Christopher Parsons
4f5b548e74 Merge "Support host platform cc builds" 2021-11-11 17:18:15 +00:00
Treehugger Robot
008d17612a Merge "Dump deps for native and java to json files." 2021-11-11 04:48:16 +00: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
Jooyung Han
a5b538394c Merge "Pass --min_sdk_version to aidl compiler" 2021-11-10 00:31:54 +00:00
Jose Galmes
d7d99be225 Support for rust recovery snapshot.
Bug: 197866992
Test: source build/envsetup.sh
Test: m -j nothing
Change-Id: I02bb188669cf9f17073592a4622998f96d5f54ac
2021-11-09 08:40:50 -08:00
Jingwen Chen
8c10020ffd Merge "bp2build: add support for soong_config_module_type." 2021-11-09 06:59:34 +00:00
Jingwen Chen
a47f28d28e bp2build: add support for soong_config_module_type.
Test: CI, go unit test
Bug: 198556411
Change-Id: Idf862904d51d822f92af0c072341c31b7a02fc64
2021-11-08 13:38:28 +00:00
Jooyung Han
07f70c0e92 Pass --min_sdk_version to aidl compiler
cc/java modules can have .aidl files as srcs. Pass min_sdk_version to
the aidl compiler so that it can check some features against it.

For example, ParcelableHolder AIDL type is available since 31.

Bug: 205338951
Test: soong test && m
Change-Id: I7ecab913e00c9b6a3ce870dacbe9773d2ddb7e93
2021-11-06 07:31:50 +09:00
Colin Cross
fc06a59904 Merge changes from topic "soong-cc-install"
* changes:
  Move cc module installation into Soong
  Temporarily add method to get java binary tool
2021-11-05 17:14:59 +00:00
Ivan Lozano
925942127a Merge "rust: Emit toc files for cdylibs" 2021-11-05 13:09:20 +00:00
Jim Tang
c44ba2a6f9 Dump deps for native and java to json files.
Abandon the use of SOONG_COLLECT_CC_DEPS and SOONG_COLLECT_JAVA_DEPS,
soong can generate module_bp_cc_deps.json and module_bp_java_deps.json
without passing any variables.

BUG: 204397180

Test: rm out/soong/module_bp*json
"m nothing" should see both json files were generated.

Change-Id: If30ad5dbabb6709f834134cbc9a513a9bdc9d9de
2021-11-05 12:06:15 +08: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
Ivan Lozano
62cd0388eb rust: Support MTE memtag_heap sanitizer
This CL adds support for the MTE memtag_heap sanitizer. This is
controlled via inclusion of an ELF note.

Bug: 170672854
Test: Heap MTE-enabled Rust test binary triggers MTE
Change-Id: I2619818785e86a94667d02b30d102c83456b7925
2021-11-04 10:51:54 -04:00
Yi Kong
286abc6f17 Pass HWASan workarounds cflags to linker as well
ThinLTO shifts codegen to linking stage. Need to pass the same set of
workaround flags to linker.

Test: m GLOBAL_THINLTO=true; adb shell incident_helper
Bug: 159343917
Bug: 204746309
Change-Id: I1e42bb043d6a86d880054b85e8831386ae4ea7e5
2021-11-04 20:19:57 +08:00
Ivan Lozano
7b0781d14c rust: Emit toc files for cdylibs
Write toc files that list the exported symbols so dependents are
only rebuilt if the exported symbols change.

This exports the CC function TransformSharedObjectToToc, and also
removes an unused arg from its signature.

Bug: 178185435
Test: New Soong test passes.
Test: m <toc file path>
Change-Id: I7ab69bf7e7f32f25eb4c7ca9d18d877dac1511db
2021-11-03 15:34:50 -04:00
Ivan Lozano
5482d6a991 rust: Support global sanitizers
This CL adds Rust support for the SANITIZE_TARGET options.

This CL includes a couple small fixes to related to HWASAN, ASAN,
ensuring that the Never sanitize property is respected. Notably,
additional llvm-args are passed to ensure that HWASAN-ified Rust/C
interop works correctly.

Bug: 170672854
Bug: 204915322
Test: SANITIZE_TARGET globally applies hwasan to Rust targets
Change-Id: Ia904d07b4618f72cdc95c51f88961905c240ac53
2021-11-03 12:29:01 -04:00
Treehugger Robot
a3bd963988 Merge changes Id11f4fb1,Id573d970,Ia94a0b5c
* changes:
  Fix //conditions:default excludes computation for LabelListAttribute.
  bp2build: split Bazel conversion context into smaller ones, and change TopDownMutatorContext signatures to use Bazel conversion context.
  Add an error check in `bazelPackage` for malformed labels.
2021-11-03 15:36:28 +00:00
Jingwen Chen
55bc820d66 bp2build: split Bazel conversion context into smaller ones,
and change TopDownMutatorContext signatures to use Bazel conversion context.

This minimizes the context interfaces/functions actually needed to
convert a module, and makes such interfaces easier to mock/test.

Test: CI
Change-Id: Id573d97023d59e06ef70e1f54437024d3f7aadbd
2021-11-02 06:51:27 +00:00
Dan Willemsen
1332eda6e0 Drop support for pre-macOS 11 SDKs
As they can't built arm64 binaries. All of our master-based builds are
now running on macOS 11 buildbots.

Bug: 203607969
Change-Id: I24c34a8365a399fbe43629ab5a22a1d53e3429b3
2021-11-01 16:04:43 -07:00
Dan Willemsen
8528f4ec5e Add Darwin+Arm64 toolchain support
This just sets up the toolchain and allows Darwin+Arm64 to be specified
as a HostCross target. These variants will not be exported to Make, or
be installed on a Soong-only build. A future CL will add support for
universal binaries using these variants.

This config is a bit stranger than the regular 64/32 multilib, as it's
two primary 64-bit configs. And on a Darwin/X86 machine, the Arm64
versions are HostCross (doesn't work on the current machines), while a
Darwin/Arm64 machine, either version works (if Rosetta is installed).

Bug: 203607969
Change-Id: Iacaed77d267773672da027cd74917e33fb1c1e94
2021-11-01 15:07:37 -07:00
Colin Cross
4985224198 Merge "Make installable arch-variant and static vs shared variant for cc modules" 2021-10-30 04:56:22 +00: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
Treehugger Robot
a471535c72 Merge "Revert "Do not build tests with ThinLTO"" 2021-10-29 19:48:30 +00:00
Colin Cross
972e7ba893 Merge "Revert "Make installable arch-variant for cc modules"" 2021-10-29 18:10:59 +00:00
Colin Cross
545104bea1 Revert "Make installable arch-variant for cc modules"
Revert submission 1874144-native_bridge_libc_dup_rules

Reason for revert: breaks ndk_translation_all build
Reverted Changes:
I5379aa959:Make native bridge libc uninstallable
I2220d6b48:Remove BUILD_BROKEN_DUP_RULES from cuttlefish buil...
I8e0eaed21:Make installable arch-variant for cc modules

Bug: 204136549
Fixes: 204572444
Change-Id: I089a13675123a33a3ec3fea8eaa40c65fb2e5e59
2021-10-29 18:08:36 +00:00
Yi Kong
04e459d9ff Revert "Do not build tests with ThinLTO"
On second thought, this is actually counter-productive rather than an
optimisation. LTOing test code is usually quite cheap, however since
tests can pull in additional static libraries (e.g. to set up test
environment), we will have to create non-LTO variants for these
dependent libraries, which can be much more expensive.

This reverts commit 85d7297318.

Bug: 195134194
Bug: 203737712
Change-Id: I1a105136075133a5b5895d00847d8796c419964c
Test: m GLOBAL_THINLTO=true dist device-tests platform_tests
2021-10-29 17:53:27 +00:00
Colin Cross
f87065fedb Merge "Make installable arch-variant for cc modules" 2021-10-29 14:58:03 +00:00
Treehugger Robot
c9e85ca825 Merge "Make a pass over our codebase cleaning up non-precise / non-inclusive language." 2021-10-28 20:51:17 +00:00
Colin Cross
1e7cfdea4a Make installable arch-variant for cc modules
libc's native_bridge variant needs to be installable: false, make
the installable property arch-variant.

Bug: 204136549
Test: m checkbuild
Change-Id: I8e0eaed2169e89520b07bb0326bb97ac0b4a70ac
2021-10-28 13:26:45 -07:00
Joe Onorato
b4638c1ac3 Make a pass over our codebase cleaning up non-precise / non-inclusive language.
Test: treehugger
Bug: 204369779
Change-Id: I6e63cae824d323535cdb14b493edd868df47738d
2021-10-28 10:32:07 -07:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
7fa0696eb7 cc_prebuilt_library_shared converted via bp2build
Bug: b/203699063
Test: bp2build/cc_prebuilt_library_shared_test.go
Test: USE_BAZEL_ANALYSIS=1 m nothing
Test: mixed_{libc,droid}.sh
Change-Id: I4c58224e88c31507a4b285f8c55bdc066bd47232
2021-10-28 11:04:50 -04:00
Chih-hung Hsieh
4dceb3705f Merge "Do not add .tidy files as RBE link inputs" 2021-10-27 20:29:04 +00:00
Liz Kammer
cc910df597 Merge "bp2build: Handle export_generated_header property" 2021-10-27 15:07:03 +00:00
Steven Moreland
bc909df732 Merge "Add health to vndk vendor variant list" 2021-10-26 22:33:31 +00:00
Liz Kammer
e6583482a8 bp2build: Handle export_generated_header property
The generated_header property resides in BaseCompilerProperties, while
export_generated_header resides in BaseLinkerProperties. Previously
bp2build handled these property structs separately; however, these two
related properties residing in separate structs requires restructuring
the code to allow access to both BaseCompilerProperties and
BaseLinkerProperties for a single axis/configuration combination to
resolve which generated headers are exported/not for the
axis/configuration..

Test: go test soong tests
Test: build/bazel/ci/bp2build.sh
Change-Id: Id150003637fd19d87e8dc5d6941e9f36dc4031dd
2021-10-26 15:10:41 -04:00
Nick Desaulniers
dc24d26093 remove support for *.mc files
We've also removed the last consumer of .mc files in aosp/1867048
(external/mdnsresponder/).

Bug: 203794880
Test: lunch aosp_cf_x86_64_phone-userdebug && m
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Change-Id: I2883a04d04b099273261d76319261d0857aa0300
2021-10-26 11:38:37 -07:00
Nick Desaulniers
16bc50a128 remove support for *.rc files
We're now packaging llvm-windres (aosp/1870074) which can be used as a
substitute for GNU binutils' windres, but we've also removed the last
consumer of .rc files in aosp/1867048 (external/mdnsresponder/).

In the worst case, we can bring back support for .rc files but instead
process them with llvm-windres.

Bug: 203794880
Test: lunch aosp_cf_x86_64_phone-userdebug && m
Change-Id: I30a873537e004b46a87191a932d076a89463c873
2021-10-26 11:32:36 -07:00
Paul Duffin
9804da0544 Dedup use of "prebuilt_"
Bug: 177893770
Test: m nothing
Change-Id: I664ee4d9c3aafda3de0a3f8985ee23f25db38680
2021-10-26 10:43:23 +01:00
Gabriel Biren
cbab07b45f Merge "Add android.hardware.wifi.supplicant-V1-ndk to VNDK list." 2021-10-26 04:43:57 +00:00
Yifan Hong
932920f403 Add health to vndk vendor variant list
Test: pass
Bug: 177269435

Change-Id: I40841daba4e52f65a27f5ed35b2731afb9a26a45
2021-10-25 20:22:11 -07:00
Gabriel Biren
f355d3c5ae Add android.hardware.wifi.supplicant-V1-ndk to VNDK list.
Bug: 196235436
Test: m
Change-Id: Ifc23ca36423de0a842e09120e783f6e8dfc807c3
2021-10-25 20:27:35 +00:00
Chih-Hung Hsieh
3bb934f0ad Do not add .tidy files as RBE link inputs
* RBE adds implicit dependent files as inputs
  and creates too long commands.
* Adds .tidy files as validation paths.
* Change type of tidyFiles to WritablePaths.

Bug: 203577539
Test: lunch aosp_cf_arm64_phone-userdebug; USE_RBE=true WITH_TIDY=1 make
Test: USE_RBE=true WITH_TIDY=1 mm in external/skia
Change-Id: I5fc9d6f8c9c58abcd3721ca9fbae1bc785e4e609
2021-10-25 12:24:30 -07:00
Yi Kong
85d7297318 Do not build tests with ThinLTO
There's not a great return on investment for spending additional
compilation/link time on tests that may only be run once or very few
times (as compared to actual library code that ships and is run orders
of magnitude more times).

Bug: 195134194
Bug: 203737712
Test: m GLOBAL_THINLTO=true dist device-tests platform_tests
Change-Id: I7149c4140f7c52b22bedbe322f1bf2c81f7ad66b
2021-10-24 17:01:43 +08:00
Treehugger Robot
1c6de4bdac Merge "Rewrite macOS SDK selection" 2021-10-20 22:24:46 +00:00
Liz Kammer
2dafba7da9 Merge "bp2build: Add support for cc_binary." 2021-10-20 14:02:39 +00:00
Dan Willemsen
7368d86a20 Rewrite macOS SDK selection
Modern Xcode versions only have a single macOS SDK installed anymore, so
we don't need to iterate through our supported versions, only check
whether the current version is supported.

This also makes it so that we can specify "11" (or soon, "12") to
specify all 11.x SDKs, instead of having to update our supported list
multiple times a year. This matches previous years that had multiple
patch releases on 10.14.y, 10.15.y, etc.

Bug: 203607969
Test: build on Mac, changing the supported SDK list
Change-Id: I42715f7e8dfec811de440a435927c14c742dede9
2021-10-19 21:43:41 -07:00
Christopher Parsons
c0ed1f653f Merge "Add OS to configuration key in mixed builds" 2021-10-19 20:57:47 +00:00
Chris Parsons
787fb36189 Add OS to configuration key in mixed builds
This also removes the special-case filegroup from mixed builds
buildroot; no special handling is required. Since we're currently
hardcoding linux_x86_64 as our host platform, it should be fine
to continue assumping that hardcoded host for now.

Test: USE_BAZEL_ANALYSIS=1 m adbd
Change-Id: I35509f4eb33ba7a243fab4c34b35958f6f2fceab
2021-10-19 16:55:52 -04:00
Liz Kammer
2ec92fc0a0 Merge "bp2build include generated hdrs in all src splits" 2021-10-19 20:51:00 +00:00
Christopher Parsons
a8b37dd7f1 Merge "Add x86_host vars to config.bzl" 2021-10-19 20:48:54 +00:00
Trevor Radcliffe
0dbe615ff4 Allow for the installation of binaries in xbin
su needs to be installed in xbin, and these changes modify
Soong to allow for this.

Fixes: 202405540
Test: Confirmed that binary was dropped into xbin
Change-Id: Ib664dc1255cd4d9049ac212f79cc53d5038cfcc7
2021-10-19 19:44:13 +00:00
Liz Kammer
2b8004b1ef bp2build: Add support for cc_binary.
Bug: 197920036
Test: build/bazel/ci/bp2build.sh
Change-Id: I2c4200967653af15a330ab8cbaf796b70d43f32d
2021-10-19 14:12:39 -04:00
Liz Kammer
ae3994ed4c bp2build include generated hdrs in all src splits
Currently generated headers are only included in the srcs split;
however, if c or assembly sources depend on the headers, the
dependendency is lacking and can cause non-deterministic failures.

Test: build/bazel/ci/bp2build.sh
Change-Id: Ic354c88300a5fb1b85241f68889e904c33a81488
2021-10-19 14:09:49 -04:00
Chris Parsons
3b1f83d076 Add x86_host vars to config.bzl
Test: USE_BAZEL_ANALYSIS=1 m adbd
Test: Manually verified config.bzl contains various x86_host flags after
bp2build.
Test: Unit tests

Change-Id: Ie9201ea2be4cd1c6659bea088a797cedbae37403
2021-10-19 12:18:13 -04:00
Ivan Lozano
e95b860598 Merge "rust: Package shared libraries with fuzzer zips" 2021-10-15 19:33:53 +00:00
Liz Kammer
51da93381c Merge "Update version_script to be handled as linkopt" 2021-10-15 14:22:27 +00:00
Treehugger Robot
adf2b3e68f Merge "Add android_sdk_repo_host to build platform-tools&build-tools" 2021-10-15 02:04:45 +00:00
Ivan Lozano
39b0bf0326 rust: Package shared libraries with fuzzer zips
Rust fuzzers were not packaging up their CC shared dependencies.
This would lead to fuzzers using the shared libraries included on
system, which may not be sanitized, leading to incorrect behavior.

This refactors the relevant code from CC and calls it from the Rust
build logic.

Bug: 202282599
Test: output rust fuzzer zip file includes shared dependencies.
Change-Id: I92196eb0141733797a67eae24f8e9aedea94c3bc
2021-10-14 15:31:47 -04:00
Stephen Hines
f7bc97ce7a Merge "Switch to clang-r433403b (13.0.3)" 2021-10-14 18:46:08 +00:00
Yi Kong
8ea56f9da9 Add Global ThinLTO option (2nd try)
Instead of making everything into ThinLTO variant by default (it works
but many Soong tests don't like this, and got bit rot due to lack of
active builder for this configuration), let the default option be
ThinLTO and no LTO be a special variant.

Test: m GLOBAL_THINLTO=true
Test: m
Bug: 195134194
Change-Id: I2fd98061ba55eba1fdfdd056fb2f8c2051fd2553
2021-10-14 17:34:13 +08:00
Stephen Hines
b7b0ae12be Switch to clang-r433403b (13.0.3)
Bug: http://b/202099787
Test: m
Change-Id: Id923948c56b0308842c94846edd6528fd26dbf72
2021-10-14 01:21:21 -07:00
Jiyong Park
ddf4ebae19 Merge "Remove use_apex_name_macro" 2021-10-14 02:32:43 +00: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
Liz Kammer
d2871189b1 Update version_script to be handled as linkopt
This allows us to handle this consistently between cc_binary and
cc_library* types.

Test: build/bazel/ci/bp2build.sh
Change-Id: I996f42bbe591215217c3d561662e775925b871ff
2021-10-13 08:36:58 -04:00
Dan Willemsen
9fe1410213 Add android_sdk_repo_host to build platform-tools&build-tools
The Android SDK has been built with Make up until now, monolithically,
then split up into several sdk-repo zip files for different purposes.
The Mac and Windows SDKs really only need to contain the platform-tools
and build-tools pieces, but due to this monolithic sdk zip, we had to
build the whole SDK first.

This adds an `android_sdk_repo_host` module that can build these
platform-tools and build-tools zips.

Bug: 187222815
Change-Id: I55809e1d7447dd65e22461f921b2b8abb6d5f822
2021-10-13 01:25:02 -07:00
Yi Kong
a9e56f062d Merge "Re-enable unused-command-line-argument warning" 2021-10-13 04:12:12 +00:00
Yi Kong
62e75f507d Re-enable unused-command-line-argument warning
Turn on the warning by default, unless USE_CCACHE is set.

Test: presubmit
Bug: 197177755
Change-Id: I01e2b0f1be3f4bd3a8d78bb4ab053b4db227596d
2021-10-13 04:11:56 +00:00
Jingwen Chen
e466cc7ea6 Merge "Convert cpp_std to be an attribute instead of a copt." 2021-10-12 23:13:53 +00:00
Liz Kammer
7e1956643c Merge "bp2build: Improve handling of generated_sources" 2021-10-12 17:29:23 +00:00
Liz Kammer
222bdcff5c bp2build: Improve handling of generated_sources
Test: build/bazel/ci/bp2build.sh
Change-Id: Id5f8b6ae9bbf1e90d72854daafb8b1f86f7241ea
2021-10-11 14:15:51 -04:00
Jingwen Chen
5b11ab1a69 Convert cpp_std to be an attribute instead of a copt.
This attribute is then converted into a feature in cc_library_static.

Fixes: 202518741
Test: CI
Change-Id: I070b56a1e96680ffad0466d085caaab2e9308ebc
2021-10-11 17:44:33 +00:00
Rajesh Nyamagoud
3e4a48850b Support for OMAPI Vendor stable interface
Changes are made to include OMAPI VNDK libraries.

Bug: b/180639372
Test: m -j64
Change-Id: I6b2122c5f9c696e4676fdbd85eefb5bc194a7342
2021-10-08 22:38:37 +00:00
Liz Kammer
2649c7913a Merge "bp2build; Update handling of linker flags" 2021-10-08 20:09:32 +00:00
Jingwen Chen
97b8531492 Add bp2build support for cpp_std.
This converts cpp_std and gnu_extensions into a -std copt, if cpp_std is
specified or gnu_extensions is false if cpp_std is not specified.

I chose to go with this copts approach because the tradeoff is a much
simpler setting than adding a new attr(s) everywhere that uses features
to set the flag.

This approach limits the number of user-configurable knobs (since users
would then be able to set std in _both_ copts and the new attr). But it
does rely on the user copt overriding the toolchain's default gnu++17
version, which can mean a `-std` flag showing up twice in the action.

Fixes: b/202462232
Test: b build //system/libziparchive:libziparchive
Change-Id: I81dad029059461739b91f318d662e089edb46b84
2021-10-08 11:16:20 +00:00
Xin Li
800112b97f Merge "Merge Android 12" 2021-10-07 23:50:21 +00:00
Liz Kammer
0eae52e0de bp2build; Update handling of linker flags
Test: build/bazel/ci/bp2build.sh
Bug: 197920036
Change-Id: I6e3100574fa0e40bcd8cf0e6af0efd3310aa41bf
2021-10-07 16:07:40 -04:00
Jingwen Chen
6ada589f6e Add support for nocrt by translating it to link_crt in bp2build.
If nocrt is true, then the compilation for cc_shared_library,
cc_binary (shared or static binaries) will _not_ link against their
respective crtbegin and crtend libraries.

nocrt is true only for the Bionic libraries themselves. For everything
else that links against the Bionic runtime, crtbegin and crtend
libraries are used. This makes the "nocrt: false" case the majority.
Hence, if nocrt is explicitly false, we omit the generating attribute in
bp2build.

If nocrt is explicitly true (link_crt is false), the Starlark macro will
disable the link_crt cc_toolchain feature.

Test: new tests
Test: CI
Fixes: 187928070
Fixes: 197946668
Change-Id: I8947789930e599dc802d8eae440859257d044475
2021-10-07 14:04:39 +00:00
Treehugger Robot
3e745e63f3 Merge "Bp2Build common properties auto-handling" am: d905146590
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1815376

Change-Id: I38f1063302ea90583a51e625076e6232b4364ab7
2021-10-04 19:20:28 +00:00
Treehugger Robot
d905146590 Merge "Bp2Build common properties auto-handling" 2021-10-04 19:02:07 +00:00
Colin Cross
fec737d6fe Merge "Export SOONG_CC_API_XML to Make outside androidmk" am: f79f4c3199
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1842574

Change-Id: Ie7312e0928bfe7692454f8d9a074c10f90fa3f2e
2021-10-04 18:44:31 +00:00
Colin Cross
f79f4c3199 Merge "Export SOONG_CC_API_XML to Make outside androidmk" 2021-10-04 18:32:15 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
447f6c99c9 Bp2Build common properties auto-handling
Introduce `commonAttributes` & `fillCommonBp2BuildModuleAttrs used in
CreateBazelTargetModule

Adapt `bp2BuildInfo` to use `commonAttrs` instead of `Name`.
And thus also all downstream users of `CreateBazelTargetModule`.

As initial user, the Soong `required` property will be
translated to Bazel's `data`.

Bug: 198146582, 196091467
Test: build_converstion_test.go:TestCommonBp2BuildModuleAttrs
Test: go test
Test: mixed_{libc,droid}.sh
Change-Id: Ib500e40f7e2cb48c459f1ebe3188962fc41ec124
2021-10-04 14:43:04 +00: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
2df9ebf9ca Merge changes from topics "bp-bionic-cts-tests", "cts-per-testcase-directory"
* changes:
  Add data_bins property
  Support per-testcase directories in all test suites
  Add environment variables to cc_genrule commands
2021-10-01 16:27:55 +00:00
Colin Cross
ceaa5328f0 Export SOONG_CC_API_XML to Make outside androidmk
This relands Ie0a945d879de4f99ce76d005aea8041719c244f7 with a fix
to prevent building XMl files for multiple variants of a library.

The SOONG_CC_API_XML values are needed for modules that are not
exported to Make, export them from a singleton that covers all
modules instead of an AndroidMkProvider that may not be called
for some modules.

Bug: 193819970
Test: forrest
Change-Id: I54710c00901976a736e88126f406e02b1f3c3586
2021-09-30 13:11:48 -07:00
Chris Parsons
486b80a0d5 Support building libcrypto via mixed builds am: a37e195182
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1839353

Change-Id: I34a5ec794874856a415e2c5415ef8b08ef3a7e21
2021-09-30 20:10:15 +00:00
Chris Parsons
a37e195182 Support building libcrypto via mixed builds
This required the following fixes to bp2build:
  - Correctly handle Bionic_* and Linux_* targets
  - Correctly handle cc_object's selects
  - Generate linker_script, stl, and system_dynamic_deps for cc_object in bp2build

Test: USE_BAZEL_ANALYSIS=1 m adbd
Change-Id: I753fd18df8ae551fb69df07e4174527c5388f289
2021-09-30 12:30:36 -04:00
Treehugger Robot
d758c9bccd Merge "Add unit tests for cpp/assembly flags." am: 4352a8e696
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1841793

Change-Id: Iea9755567590efb6fcd161a5e92182386b2fff47
2021-09-30 15:24:35 +00:00
Liz Kammer
08572c6d45 Add unit tests for cpp/assembly flags.
Test: go test soong tests
Change-Id: Idd4b8d558b9bccf92b63c80abff19792ea3ff766
2021-09-30 10:11:04 -04:00
Colin Cross
59f957abbf Merge "Revert "Export SOONG_CC_API_XML to Make outside androidmk"" am: 6f37dba455
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1841188

Change-Id: I84b0b1e723313f4749e6d37a989b1e3c88b140d8
2021-09-30 03:39:08 +00:00
Colin Cross
2cec05d37b Revert "Export SOONG_CC_API_XML to Make outside androidmk"
This reverts commit ebb32c486a.

Reason for revert: breaks coverage build (b/201600003)
Bug: 193819970
Bug: 201600003

Change-Id: I65969c4a62165c40dded2794b757469909bf8ca6
2021-09-30 03:14:40 +00:00
Colin Cross
7dddc5adb5 Merge "Export SOONG_CC_API_XML to Make outside androidmk" am: 1cd6d8e25e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1838396

Change-Id: Id1d458966726c4fda22f0558bb54e9f07738aab1
2021-09-29 23:30:29 +00:00
Colin Cross
ebb32c486a Export SOONG_CC_API_XML to Make outside androidmk
The SOONG_CC_API_XML values are needed for modules that are not
exported to Make, export them from a singleton that covers all
modules instead of an AndroidMkProvider that may not be called
for some modules.

Bug: 193819970
Test: manual
Change-Id: Ie0a945d879de4f99ce76d005aea8041719c244f7
2021-09-28 16:39:13 -07: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
Colin Cross
cfb0f5e102 Support per-testcase directories in all test suites
There are cases where two modules try to install the same test data
into CTS, which results in collisions when CTS puts the data for all
tests in the same directory.  Add a flag that allows enabling a
per-testcase directory for an individual test for all test suites.

Bug: 193168159
Test: cts-tradefed run commandAndExit CtsBionicTestCases
Change-Id: If034723e8fe937ca71d3e2d39b7d46702e41bc8c
2021-09-27 15:56:26 -07:00
Colin Cross
f3bfd02aa9 Add environment variables to cc_genrule commands
Pass the architecture, mulitlib type and native bridge state to
each variant of a cc_genrule rule as environment variables.

Bug: 200872604
Test: TestCmdPrefix
Change-Id: I39c4c2d5bbd4f4cc72a4777715db1df049345b37
2021-09-27 15:56:23 -07:00
Paul Duffin
4bf3db6c1f Add ramdisk image sdk trait to cc_library_headers am: 12a0a310a7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1834876

Change-Id: I722497159725cd4e8b913357aed161ea69357a28
2021-09-25 09:30:55 +00:00
Paul Duffin
e0778ba120 Merge "Add recovery image sdk trait to cc_library_headers" am: a02157a4b7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1834875

Change-Id: I60e4ae35cd9807501abd2a0a009a5efc9de62211
2021-09-25 09:30:06 +00:00
Paul Duffin
fbca36d0c6 Merge "Extract handling of image variations from target loop" am: 7af6b7062b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1834873

Change-Id: Ic16405a43a524784ff29e23c45567faaadc6cedd
2021-09-25 09:29:45 +00:00
Paul Duffin
12a0a310a7 Add ramdisk image sdk trait to cc_library_headers
Allows an sdk to require that a cc_library_headers module provides a
ramdisk image variant for the prebuilt.

Previously, "ramdisk_available: true" would be set in the generated
prebuilt snapshot for any sdk member that specified
"ramdisk_available: true" in the source module. This change will only
add that setting to the snapshot if the ramdisk image variant trait
was explicitly requested for a member.

Bug: 195754365
Test: m nothing
Change-Id: I21e0dd02d380beabf228a72c463fcc603c77d87f
2021-09-25 10:17:31 +01:00
Paul Duffin
a02157a4b7 Merge "Add recovery image sdk trait to cc_library_headers" 2021-09-25 09:14:21 +00:00
Paul Duffin
7af6b7062b Merge "Extract handling of image variations from target loop" 2021-09-25 09:11:44 +00:00
Christopher Parsons
a64586fb74 Merge "Add stl property support for bp2build" am: 0bb4ac55d6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1834858

Change-Id: I9c45eab96c5e62667bd78d0fa48601ab140357a0
2021-09-24 20:08:41 +00:00
Christopher Parsons
0bb4ac55d6 Merge "Add stl property support for bp2build" 2021-09-24 20:01:12 +00:00
Chris Parsons
a967f253e6 Add stl property support for bp2build
Test: mixed_libc
Test: USE_BAZEL_ANALYSIS=1 m libbase
Change-Id: If56d4a728de3ae4022cc9dadadc9bf8b952f9eaf
2021-09-24 13:51:56 -04:00
Liz Kammer
137044cac4 Merge "Refactor code for partitions c srcs" am: 46f8dbe06a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1831493

Change-Id: Ib366e45228edca439c6dd41021945e0c62a7c127
2021-09-24 17:51:11 +00:00
Liz Kammer
46f8dbe06a Merge "Refactor code for partitions c srcs" 2021-09-24 17:35:16 +00:00
Paul Duffin
6369622f8d Add recovery image sdk trait to cc_library_headers
Allows an sdk to require that a cc_library_headers module provides a
recovery image variant for the prebuilt.

Previously, "recovery_available: true" would be set in the generated
prebuilt snapshot for any sdk member that specified
"recovery_available: true" in the source module. This change will only
add that setting to the snapshot if the recovery image variant trait
was explicitly requested for a member.

Bug: 195754365
Test: m nothing
Change-Id: I7d79ccdec843127f7852d82b4b163021e30a79a7
2021-09-24 17:44:37 +01:00
Paul Duffin
b1f0f2aa80 Extract handling of image variations from target loop
This separates the selection of the image variations to depend upon
from the main target loop. Follow up changes will add additional
image variations.

Bug: 195754365
Test: m nothing
Change-Id: Ia1a61b1efbc96d92cb2faf1e2c4d1c5c752b8083
2021-09-24 17:15:40 +01:00
Liz Kammer
6fe2d9a3aa Merge "bp2build: Add support for export_.*headers props" am: 6244df2a24
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1835374

Change-Id: I10252c15de0bbc6691a69fb214461f6d56d000ff
2021-09-24 13:29:34 +00:00
Liz Kammer
57e2e7a78f Refactor code for partitions c srcs
To support protos (and other srcs that generate sources), we need to
partition further. Separate out into a separate common function.

Bug: 200601772
Test: build/bazel/ci/bp2build.sh
Change-Id: I7bf4cd96fd9a9fca4ccb3c96f21a04303201f891
2021-09-23 18:28:24 -04:00
Liz Kammer
7a210ac233 bp2build: Add support for export_.*headers props
Soong supports export_.*_headers properties, the libraries contained in
this list must also be within a shared/static/whole_static/header libs
property. For bp2build, we eliminate this duplication. The libraries
not listed in an export_.*_headers property will migrate to an attribute
prepended with implementation_, those in export_.*_headers will not have
a prefix.

Test: build/bazel/ci/bp2build.sh
Test: build/bazel/ci/mixed_libc.sh
Bug: 198241472
Change-Id: I3eb84c983ec5d241c8a568e411dfd5619d3184a7
2021-09-23 16:07:45 -04: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
Wei Li
0e504d7dc9 Merge "Add bp2build converter for cc_genrule." am: a06db33ebd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1829492

Change-Id: I73b0abd1f86d7dfc17a683595585aff4b5ffb91e
2021-09-23 18:17:04 +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
Wei Li
a06db33ebd Merge "Add bp2build converter for cc_genrule." 2021-09-23 18:04:03 +00:00
Sarah Chin
1c0557ea82 Merge "Add IRadio modules to VNDK" 2021-09-23 16:35:42 +00:00
Paul Duffin
8aae014264 Merge "Add support for native bridge trait" am: 15e92388bb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1827878

Change-Id: I286209ee993de44cc508ca9449e73a55846dac33
2021-09-23 13:03:35 +00:00
Paul Duffin
93b750e2a0 Add support for native bridge trait
Adds a native bridge trait that if required will cause a
cc_library_header module to generate a cc_prebuilt_library_headers with
native_bridge_supported: true. It will fail if the cc_library_header's
native bridge variant would produce native bridge specific properties,
distinct from the other architecture variants, in the generated
cc_prebuilt_library_headers.

Bug: 195754365
Test: m nothing
Change-Id: I282fbb9095de6c6af57cca4eb4260e2c6c2da8cc
2021-09-23 11:37:57 +01:00
Wei Li
bcd399479a Add bp2build converter for cc_genrule.
Test: cc_genrule_conversion_test.go

Change-Id: I19290b417d6336020a15ba7fa772ee0c76c58225
2021-09-23 05:41:20 +00:00
Sarah Chin
0322af503a Add IRadio modules to VNDK
Test: build
Bug: 198331451
Change-Id: Ia468b563c6485464db56b3c9cdbae80de6b3f165
Merged-In: Ia468b563c6485464db56b3c9cdbae80de6b3f165
2021-09-23 03:54:58 +00:00
Sarah Chin
ef3dd96890 Merge "Add IRadio modules to VNDK" into stage-aosp-master 2021-09-23 02:58:32 +00:00
Treehugger Robot
dfcb3ff691 Merge "Revert "update build rules to use /data/local/tests/unrestricted"" am: 512ec3f4fe
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1832958

Change-Id: I1f99bcbca475bd29e165f735706cd2b3d913c113
2021-09-22 06:45:42 +00:00
Sarah Chin
84fdadfe83 Add IRadio modules to VNDK
Test: build
Bug: 198331451
Change-Id: Ia468b563c6485464db56b3c9cdbae80de6b3f165
2021-09-21 23:34:20 -07:00
Treehugger Robot
512ec3f4fe Merge "Revert "update build rules to use /data/local/tests/unrestricted"" 2021-09-22 06:33:44 +00:00
Guang Zhu
5c97bc698f Revert "update build rules to use /data/local/tests/unrestricted"
Revert submission 1826231-native-test-path

Reason for revert: b/199996863

Bug: 199996863

Reverted Changes:
Ic106011a7:update build rules to use /data/local/tests/unrest...
Id727355ec:update build rules to use /data/local/tests/unrest...

Change-Id: Id53334a6169e58964ef86e78de738f29b32dd491
2021-09-22 04:20:22 +00:00
Treehugger Robot
0f7dddcc9c Merge "[IRadioConfig] Add to VNDK variant list" 2021-09-22 01:49:23 +00:00
TreeHugger Robot
a91b77734b Merge "[IRadioConfig] Add to VNDK variant list" into stage-aosp-master 2021-09-21 17:23:20 +00:00
Christopher Parsons
5a5ceb553e Merge "bp2build: reference static variants directly" am: ce0944fc96
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1832014

Change-Id: I6314b59c55d7dcc65444d44f631d39ff566c49d9
2021-09-21 15:32:04 +00:00
Christopher Parsons
ce0944fc96 Merge "bp2build: reference static variants directly" 2021-09-21 15:13:43 +00:00
Serik Beketayev
af68148d19 [IRadioConfig] Add to VNDK variant list
Test: build
Bug: 198331805
Change-Id: Ibacc996f42c4bfa12b135247a2cebe1e28bbff09
Merged-In: Ibacc996f42c4bfa12b135247a2cebe1e28bbff09
2021-09-21 04:52:44 +00:00
Treehugger Robot
c41aa75dec Merge "Add tidy_disabled_srcs property." am: 1b15345ac9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1831865

Change-Id: I430b1fcd21e417e1ca0382228229188e1b47c718
2021-09-21 03:58:15 +00:00
Chih-Hung Hsieh
769a51cc6a Add tidy_disabled_srcs property.
Used as a supplement to C/C++ srcs to disable
clang-tidy for selected srcs, when a library
contains many files in srcs and only some of them
are too large to compile with clang-tidy.

Test: WITH_TIDY=1 TIDY_TIMEOUT=90 make tidy-soong
Bug: 198098397
Change-Id: Ib32eb0e46ddbc717999797717bfd8c57e182ee88
2021-09-20 18:17:59 -07:00
Serik Beketayev
319c773900 [IRadioConfig] Add to VNDK variant list
Test: build
Bug: 198331805
Change-Id: Ibacc996f42c4bfa12b135247a2cebe1e28bbff09
Merged-In: Ibacc996f42c4bfa12b135247a2cebe1e28bbff09
2021-09-20 17:32:30 -07:00
Chris Parsons
953b35623a bp2build: reference static variants directly
Previously, when referencing a cc_library as a static_lib from a
converted module, the corresponding target would depend on the "root
target" of that cc_library. This resulted in a superfluous dependency on
the shared target of the cc_library dependency. This superfluous
dependency could sometimes result in cycles.

This change ensures the static target name is directly specified in such
cases.

Test: mixed_libc.sh CI
Test: USE_BAZEL_ANALYSIS=1 m fmtlib
Change-Id: I36ee9f0a9017b1e9d73df9e3174669107f0afd4f
2021-09-20 15:15:29 -04:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
5cc296f072 Merge changes from topic "mixed-build-cc-library-shared" am: 4aeaf37bb7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1826914

Change-Id: If277cd41ec3244e25aec1cedb3890f7fbc058eca
2021-09-17 14:39:12 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
5ce0135bd8 Incorporate cc_library_shared into mixed builds am: bc4e734e59
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1826912

Change-Id: If309ce2532d679e4af9d5cfe5b4c383afa2116e2
2021-09-17 14:39:06 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
4aeaf37bb7 Merge changes from topic "mixed-build-cc-library-shared"
* changes:
  Expose TocFile via CcInfo
  Clean up StarlarkFunctionBody for getCcInfoType
  Incorporate cc_library_shared into mixed builds
2021-09-17 14:29:17 +00:00
Chih-hung Hsieh
d19ed27801 Merge "Use ccCmd to generate clang-tidy dependent file" am: 935ae2c51d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1824476

Change-Id: I303aab3d1318b9d94c76a362d07ec446fa65cdb0
2021-09-17 02:08:33 +00:00
Chih-hung Hsieh
935ae2c51d Merge "Use ccCmd to generate clang-tidy dependent file" 2021-09-17 01:59:23 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
62585e8436 Expose TocFile via CcInfo
To reflect what's provided in SharedLibraryInfoProvider

Move the logic for identifying the toc file into Starlark
instead of the Soong Go code.

Adapt TestGetCcInfoParseResults to expect the toc as well.

Test: build/bazel/cquery/request_type_test.go:TestGetCcInfoParseResults
Test: cc/library_test.go:TestCcLibrarySharedWithBazel
Test: build/bazel/ci/mixed_{libc,droid}.sh
Change-Id: I40ad47158cb98b14ca03c21e351988818cb01770
2021-09-16 20:55:10 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
d4e77a6137 Create bp2build converter for cc_shared_library am: ac5097fcf4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1816758

Change-Id: Iad57cc75670f0e747c162758c029179ae93af3e4
2021-09-16 18:20:48 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
fff8c0a6a8 Remove Linkstatic field for static cases am: a5474e36c5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1826512

Change-Id: I70f97cd652598dcd520c5224f71568876338aeb4
2021-09-16 18:20:45 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
bc4e734e59 Incorporate cc_library_shared into mixed builds
The infrastructure is already there via its need in
`cc_library`. Therefore, just enable it by setting
the `bazelHandler` in `LibrarySharedFactory`, and
add a test to verify the functionality.

Bug: 198817980
Test: cc/library_test.go:TestCcLibrarySharedWithBazel
Change-Id: Ibff80616632af59a0e409110f8645e028f99c7d6
2021-09-16 18:13:52 +00:00