Commit graph

7495 commits

Author SHA1 Message Date
Colin Cross
6d89152f33 Merge "Make toolchain more compose-y" 2022-09-02 15:33:17 +00:00
Treehugger Robot
f20433b15f Merge "Handle product config specific header_libs prop in cc bp2build" 2022-09-02 13:02:04 +00:00
Zi Wang
0a8a129ee8 Handle product config specific header_libs prop in cc bp2build
Product variable header_libs is able to be converted.
Since static_libs and header_libs both use implementationDeps,
also added logic to make sure they both contribute to bazel
target.

Bug: 228314770
Test: m bp2build
Test: TestCcLibraryProductVariablesHeaderLibs in cc_library_conversion_test
Change-Id: I370fc75b666b3908b6ac5ed42bca5560f957fc42
2022-09-01 14:32:51 -07:00
Colin Cross
fc3b064c9a Make toolchain more compose-y
Remove many of the overridden methods from toolchainBase in favor
of having smaller composable types.  toolchainNoCrt, toolchain32Bit
and toolchain64Bit now only provide a few methods and can be mixed
in to any toolchain type.  toolchainLinux, toolchainBionic,
toolchainWindows and toolchainDarwin now embed toolchainBase to provide
the default flags methods for when they don't override them.

This avoids the need for disambiguation methods required when a
type embeds two types that implement the same method.

Test: cc_test.go
Change-Id: I641da2a47aba597c517f693efedb65cf41273c82
2022-09-01 14:21:36 -07:00
Treehugger Robot
3636a06fe0 Merge "Use CommonAttributes.Data for cc_test.data." 2022-09-01 20:55:26 +00:00
Florian Mayer
41e31d8092 Merge "Revert "Revert "[soong] Add memtag-stack sanitizer, switch to li..."" 2022-09-01 19:29:33 +00:00
Jingwen Chen
ebdc20f571 Use CommonAttributes.Data for cc_test.data.
data is a common attr like name, so avoid redefining it in testBinaryAttrs.

Test: presubmits
Change-Id: Ia694b94620dfad6b8411e5a1b6c530843983ca01
2022-09-01 18:54:50 +00:00
Spandan Das
1d243da558 Merge "bp2build for ndk_headers" 2022-09-01 17:22:50 +00:00
Jingwen Chen
537242c6f1 Convert cc_test targets with bp2build.
Starting with libutils_test, adb_test, libcutils_test, (and ~47 other host_supported tests).

Test: $ b build --config=android_x86_64 //system/core/libutils:libutils_test && adb push bazel-bin/system/core/libutils/. /data/tmp/libutils_test_files/ && adb shell /data/tmp/libutils_test_files/libutils_test
Test: presubmits with newly converted cc_test targets
Test: $ b test //system/... --config=linux_x86_64 --verbose_failures --test_output=errors --keep_going --build_tests_only

Fixes: 242038415

Change-Id: I10051aadb880c3aabeba6d7fb079523e6fb4ac43
2022-09-01 14:59:15 +00:00
Treehugger Robot
bf9c26c364 Merge changes I1270e8d0,I61731a5e
* changes:
  Move function PathForVndkRefAbiDump to Prevent unnecessary exports in paths.go
  Change the type of parameter prevVersion to int in sourceAbiDump
2022-09-01 06:37:20 +00:00
Kiyoung Kim
51279d3a7b Define cc_api_headers module
Define cc_api_headers module to import from API surfaces and replace
existing header definition if needed.

Tested with :
cc_api_headers {
  name: "libc_headers",
  export_system_include_dirs: [
    "include",
  ],
  min_sdk_version: "1",
  sdk_version: "1",
  vendor_available: true,
  native_bridge_supported: true,
  ...
}

Bug: 236087698
Test: ALLOW_MISSING_DEPENDENCIES=true m -j vendorimage succeeded
Change-Id: I2c3294fe19a272453a168d8c7beeee9859bd4583
2022-09-01 11:24:35 +09:00
Steven Moreland
e66fe04484 Merge "Avoid dereferencing ANDROID_BUILD_TOP" 2022-09-01 02:09:53 +00:00
Treehugger Robot
2da00a8471 Merge "Add a property in ndk_library for header contributions" 2022-09-01 01:08:39 +00:00
Florian Mayer
d8434a4f3d Revert "Revert "[soong] Add memtag-stack sanitizer, switch to li..."
Revert submission 2201105-revert-2096883-memtag-stack-IGUQFVKYTS

Reason for revert: Reland with fix
Reverted Changes:
I0dac2a6a6:Revert "memtag_stack tests."
I3967151d9:Revert "[soong] Add memtag-stack sanitizer, switch...

Change-Id: Ib827fb8d48192f9e2accc97931e272f713d6cbd0
2022-08-31 15:20:25 -07:00
Treehugger Robot
52d9b95f54 Merge "Support suffix property in bp2build" 2022-08-31 20:15:28 +00:00
Spandan Das
0773a60302 bp2build for ndk_headers
Create bp2build converters for the following module types
- ndk_headers
- versioned_ndk_headers

Details
- Partial bp2build conversion. Only `cc_api_headers` targets will be
  generted within the scope of this CL
- Glob expansion. Aligned with other bp2build converters, this impl will
  expand globs in Android.bp so that all .h files are explicitly listed
  in the generated BUILD files. As an extreme example, the size of
  out/soong/workspace/bionic/libc/BUILD will increase from ~170KB to
  ~230KB (33% increase). This makes the BUILD files less readable, and
  `cc_api_headers` section of the BUILD file should probably not be
  checked into the tree in this format

Test: b cquery //bionic/libc:libc_uapi --output=starlark
--starlark:expr="providers(target).get('//build/bazel/rules/apis:cc_api_contribution.bzl%CcApiHeaderInfo')"
Test: go test ./bp2build
Test: go test ./cc

Change-Id: I810d5380f72dc90f4cdf4aa508570f3a80d8d932
2022-08-31 19:40:22 +00:00
Steven Moreland
855094c759 Avoid dereferencing ANDROID_BUILD_TOP
We want to print to the user to use this variable, but it might
not be set in all environments where we run the build. Namely,
in sdk finalization CI.

Bug: 244456768
Test: N/A
Change-Id: I233e7d0ee6a7ed43760ad723fccd70ea97f7b806
2022-08-31 18:58:55 +00:00
Florian Mayer
77c1d77b48 Merge "Revert "[soong] Add memtag-stack sanitizer, switch to linker-gen..."" 2022-08-31 18:37:30 +00:00
Florian Mayer
00ab5cfd5e Revert "[soong] Add memtag-stack sanitizer, switch to linker-gen..."
Revert submission 2096883-memtag-stack

Reason for revert: b/244454542
Reverted Changes:
I7fee03d90:memtag_stack tests.
I52d2318c8:[soong] Add memtag-stack sanitizer, switch to link...

Change-Id: I3967151d98514fa07f66804aa8ff403df3962fa3
2022-08-31 18:30:18 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
a56e97042c Support suffix property in bp2build
Support this in cc_{binary,library{,_shared}}

Bug: 204811222
Test: Suffix additions to cc_{binary,library{,_shared}}_conversion_test.go
Test: mixed_{libc,droid}.sh also builds newly allowlisted
Change-Id: I596694794b01b04c542cbcd7d54baeb7d914ba50
2022-08-31 18:06:21 +00:00
Florian Mayer
1520d7fb2d Merge "[soong] Add memtag-stack sanitizer, switch to linker-generated notes." 2022-08-31 17:53:43 +00:00
Trevor Radcliffe
ad7b2220be Merge "Write Soong tests to confirm Sysprop directories" 2022-08-31 15:13:31 +00:00
Mu-Le Lee
f5ed30b2aa Move function PathForVndkRefAbiDump to Prevent unnecessary exports in paths.go
This CL moves function PathForVndkRefAbiDump from android/paths.go to
cc/library.go to prevent unnecessary exports.

Test: make libz
Bug: 239915696
Change-Id: I1270e8d07edb09d93621c049acab9196757d356b
2022-08-31 06:04:27 +00:00
Mu-Le Lee
1304393b36 Change the type of parameter prevVersion to int in sourceAbiDump
Since the caller is doing Itoa and pass it into sourceAbiDump(), and
sourceAbiDump() is calling Atoi to convert it back, it makes sense to
not do the Itoa in the first place.

Test: make libz
Bug: 244009549
Change-Id: I61731a5eb442b5a1a8f50c820a673d9b2204c3a0
2022-08-31 05:51:35 +00:00
Evgenii Stepanov
807573d135 [soong] Add memtag-stack sanitizer, switch to linker-generated notes.
This change depends on the following toolchain commit:
https://reviews.llvm.org/D118948

Bug: b/174878242
Test: sanitize_test.go
Test: fvp_mini with SANITIZE_TARGET=memtag_heap,memtag_stack

Change-Id: I52d2318c8e4e06d6da5b74c45226144b880f1577
2022-08-30 21:37:03 +00:00
Spandan Das
73bcafcbb0 Add a property in ndk_library for header contributions
The new property will be used to determine the header file contributions of
ndk_library(s) to the Public API surface. This should be a no-op for
regular Soong builds.

This will be used by a future bp2build converter to populate
the BUILD files for Multi-tree `cc_api_contribution` targets

(Also noticed that sdk_test.go was never added to testSrcs, which this
CL should fix)

Test: go test ./cc
Test: TH

Change-Id: Ieea093e4aac68e341c6414b6cafe02c441643cdf
2022-08-30 18:24:40 +00:00
Alix Espino
f9f9ed7cf1 Merge "Deprecating clang Property" 2022-08-30 17:42:10 +00:00
Mu-Le Lee
06d343580d Merge "Add target-version flags in header-abi-diff command" 2022-08-30 05:07:40 +00:00
Trevor Radcliffe
3092a8e573 Write Soong tests to confirm Sysprop directories
These tests will break if the sysprop output files and directory
paths are changed. At the very least, this is a good warning to
let us know to change other places accordingly, like the Bazel
rule.

Bug: 235131252
Test: tests
Change-Id: I80f037a6e8fe68cdd2042c64175e0d3bd3fefde3
2022-08-29 18:46:50 +00:00
Mu-Le Lee
f7d0b43782 Add target-version flags in header-abi-diff command
In Cross-Version ABI Check, the config of header-abi-diff would be
changed based on go/cross-version-abi-diff-configuration. Thus in soong,
the target-version flag should be added for header-abi-diff to determine
config section. The error message of header-abi-diff is also modified to
help developers resolve the incompatibility by updating the
header-abi-diff config.

Test: make and check the flag of generated header-abi-diff command
Bug: 239792343
Change-Id: Id94f577a42193ecf218dc94d0bfd2065fcdc2896
2022-08-27 08:37:35 +00:00
Vinh Tran
9f6796ab17 Convert cc library with AIDL to cc_aidl_library
Change-Id: I1056b37cf09f4341bf2c2545c9069dbe49ea5ab3
Test: USE_BAZEL_ANALYSIS=1 m libbinder
Bug: 243010121
Fix: 243015050
2022-08-26 16:21:53 -04:00
Alix
b5f6d9ea51 Deprecating clang Property
Clang has defaulted to true since 2018. Clang property is deprecated.
Set up a BUILD_BROKEN_CLANG_PROPERTY flag so partners can bypass \
errors from using clang.

Bug: 208980553
Test: m nothing & treehugger
Change-Id: I8fd7d3e6bdbb963279248d3482e8a590238727e3
2022-08-26 20:05:07 +00:00
Cole Faust
5fa4e961fb bp2build support for instruction_set
Convert `instruction_set: "arm"` to an
"arm_isa_arm" bazel feature.

Bug: 215719349
Test: go tests
Change-Id: Ib976d23d2a57e8c0ab5d83ec994a0b7f3c69a7fe
2022-08-26 10:13:34 -07:00
Wei Li
81852ca9ac Add bp2build converter for cc library stubs and use the stub library target of a library while linking it in APEXs.
Bug: 231322789
Test: with this CL on internal master,
1) b build --verbose_failures //vendor/google/modules/AdbdGoogle:com.google.android.adbd --config=android_x86_64
2) adb install bazel-bin/vendor/google/modules/AdbdGoogle/com.google.android.adbd.apex, and adbd is activated successfully on cuttlefish device.
3) m mts && mts-tradefed run mts-adbd, and there is no failure with cuttlefish device
4) packages/modules/adb/test_device.py, and there is no failure with cuttlefish device.

Change-Id: I81b6f5336cacf35c68957ae2dac65f985b6eafb9
2022-08-25 13:28:40 -07:00
Christopher Parsons
5a2a4814af Merge "Refactor mixed build allowlist handling" 2022-08-23 17:21:16 +00:00
Chris Parsons
ad876010fe Refactor mixed build allowlist handling
This refactoring prepares for introduction of bazel prod mode, an
alternative mechanism for mixed builds allowlist handling.

 * Decide bazel-mode as close to soong_build main as possible
 * BazelContext itself decides whether a module is allowlisted
 * Separate bp2build and mixed build allowlist

Test: m nothing, manually verified all modules are mixed build disabled
(via metrics)
Test: USE_BAZEL_ANALYSIS=1 m nothing, manually verified that mixed build
disabled/enabled modules are identical before and after change.

Change-Id: I0f55d8b85000cb4a871a099edc6d7d868d7df509
2022-08-23 13:15:12 -04:00
Yi Kong
b1a9aab987 Merge "Revert "Reland "Turn on Global ThinLTO by default""" 2022-08-23 11:36:02 +00:00
Yi Kong
7689c64f68 Revert "Reland "Turn on Global ThinLTO by default""
This reverts commit 4273c18a4f.

Bug: 243475788
Bug: 243490273
Change-Id: I5ea8c8e6a84408013bc7ed573776d8f5eebc091f
2022-08-23 09:24:48 +00:00
Treehugger Robot
8cab5906da Merge "Reland "Turn on Global ThinLTO by default"" 2022-08-23 00:47:28 +00:00
Trevor Radcliffe
218dae74b1 Merge "Reexport whole_static_libs in cc_library_headers" 2022-08-22 20:39:08 +00:00
Dan Albert
237d1710f9 Merge "Drop support for KitKat." 2022-08-22 18:53:48 +00:00
Yi Kong
4273c18a4f Reland "Turn on Global ThinLTO by default"
This reverts commit b90ff82772.

All the breakages are now fixed or mitigated.

Bug: 169004486
Change-Id: Ibec4b1f0a50c5ef6769bc6916a81721a4ce03c60
Test: presubmit
2022-08-22 08:18:03 +00:00
Pierre-Clément Tosi
329a03196f Merge "Support prefix_symbols for prebuilt libraries" 2022-08-22 07:44:42 +00:00
Treehugger Robot
f5b0c2a178 Merge "Fix bugs from cc_api_library build" 2022-08-22 02:28:53 +00:00
Hsin-Yi Chen
49542c8541 Merge "Revert "Disable RBE for header-abi-dumper"" 2022-08-22 02:16:04 +00:00
Yi Kong
11f4a795ba Merge "Do not enable ThinLTO for CFI enabled projects" 2022-08-20 05:10:04 +00:00
Treehugger Robot
12bd7c7538 Merge "#apex symbols no longer contribute to platform libraries" 2022-08-19 23:55:00 +00:00
Dan Albert
6bfb6bbde4 Drop support for KitKat.
The NDK is dropping support for this.

Bug: https://github.com/android/ndk/issues/1751
Test: treehugger
Change-Id: I6c03dfc364e7612ce4f45fb58746726983cf5b74
2022-08-19 20:56:28 +00:00
Cole Faust
370b37e053 Merge "Bp2build support for runtime_libs" 2022-08-19 20:09:56 +00:00
Paul Duffin
29d1667846 Merge "Reformat build/soong for go 1.19" 2022-08-19 10:57:42 +00:00