Commit graph

7684 commits

Author SHA1 Message Date
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
Yi Kong
c702ebd886 Do not enable ThinLTO for CFI enabled projects
CFI projects already use full LTO.

Test: GLOBAL_THINLTO=true m
Change-Id: I8a57efc237aed977f57dd4040500cc5f84843c3d
2022-08-19 16:05:14 +08:00
Yi Kong
736664571b Merge "Revert "Turn on Global ThinLTO by default"" 2022-08-18 17:24:55 +00:00
Trevor Radcliffe
7f897fcef0 Reexport whole_static_libs in cc_library_headers
Fixes: 236268577
Test: Unit Tests
Change-Id: I3a13f850d1d593b90c79f668f1eaf5be0035db1f
2022-08-18 15:53:00 +00:00
Yi Kong
b90ff82772 Revert "Turn on Global ThinLTO by default"
This reverts commit 406e7b725b.

Reason for revert: ndk_translation causes clang to crash

Change-Id: I61b262157f9f57c739391757d5a1f95299ddadca
2022-08-18 14:53:34 +00:00
Yi Kong
3352ceb691 Merge changes from topic "global-thinlto"
* changes:
  Turn on Global ThinLTO by default
  Only enable global ThinLTO for LP64 targets
2022-08-18 08:57:07 +00:00
Kiyoung Kim
835c589a77 Fix bugs from cc_api_library build
There are some bugs found while building cc_api_library with original
library definition. This change fixes some bugs from cc_api_library.

* Generate MK information for cc_api_library.
* Mark cc_api_library as no CRT required.

Bug: 236087698
Test: ALLOW_MISSING_DEPENDENCIES=true m -j vendorimage succeeded
Change-Id: Ib411888fae41317c01378362cd5bdc87c2b588c5
2022-08-18 00:07:46 +00:00
Cole Faust
6b29f593ea Bp2build support for runtime_libs
Bug: 213201180
Test: Updated the minimal apex in the build/bazel cl to include runtime_libs so the apex diff test will test it
Change-Id: I10add1895cfa122a370d24196a33ec2dcfafccfc
2022-08-17 15:20:17 -07:00
Colin Cross
d079e0b270 Reformat build/soong for go 1.19
Test: none
Change-Id: I132368f0fcbdb5ea088b5b84dbe4ccfdd9e94cad
2022-08-17 10:43:13 -07:00
Zhenhuang Wang
852d0c4859 Merge "Move common test_options properties into the android package" 2022-08-17 15:22:18 +00:00
Hsin-Yi Chen
0713e4f173 Revert "Disable RBE for header-abi-dumper"
This reverts commit 6580d84f51.

Reason for revert: The bugfix for reproxy was released to this branch.

Test: make
Bug: 226497964
Change-Id: I38e30d3dc71fa7857a61fcadf5895075608fd966
2022-08-17 12:57:48 +08:00
Yi Kong
406e7b725b Turn on Global ThinLTO by default
Apply ThinLTO without optimization (--lto-O0) globally. This saves us
2.24% in binary size for system/lib64, as well as more than 4.68% build
time improvement.

Test: presubmit
Bug: 169004486
Change-Id: I1ed90c2058f9ff1fa8a2d3fd7ac1191c5d98dac1
2022-08-17 09:27:02 +08:00
Yi Kong
2121d16db8 Only enable global ThinLTO for LP64 targets
Due to the lack of engineering efforts into LP32 targets, do not enable
global ThinLTO for them by default.

Test: presubmit
Bug: 169004486
Change-Id: I79b77baecf16fda95ff5dccc5a401596a0557d5d
2022-08-17 09:22:07 +08:00
Xin Li
6ef4fae229 Merge "DO NOT MERGE - Merge Android 13" 2022-08-16 19:08:20 +00:00
Zhenhuang Wang
0ac5a431a9 Move common test_options properties into the android package
Multiple modules (e.g. java, cc, python, rust) define the `test_options`
field. Extract the common properties in test_options to share across
different test rules.

Bug: 240928948
Test: `refreshmod` and diff with original module-info.json
Change-Id: I404a7a157b4ccaa53d800ee2217559ff695bd825
2022-08-17 01:19:15 +08:00
Mu-Le Lee
8f74418389 Merge "Diff source dump and previous version dump for Cross-Version ABI Check" 2022-08-16 05:07:28 +00:00
Treehugger Robot
162a78412d Merge "Fix broken aosp-master-plus-llvm builds" am: 9a5db000da
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2185741

Change-Id: I9042eb1ce3ff4c4204d6f26745934736a2d11c9e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-16 01:29:47 +00:00
Yu Liu
dea2c72b02 Merge "Filter out headers generated by bazel in snapshot." am: 6715377e58
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2186395

Change-Id: Ie24a8e1b6732a8015789b280b8dfceab5c288d42
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-15 21:39:18 +00:00
Chih-Hung Hsieh
8b5ecb8455 Fix broken aosp-master-plus-llvm builds
* New flags cannot be added before llvm_android
  has a new version.

Bug: 241941550
Bug: 241601211
Test: presubmit
Change-Id: Ibab8cfa9129eac824a3d5fb9c3124ba807ba4245
2022-08-15 14:36:02 -07:00
Trevor Radcliffe
2db49e3269 Delete SyspropMutator
This CL and its associated CLs point cc modules that rely on
sysprop_library modules to the auto-generated cc_library
module, and then remove the code in Soong which maps the
sysprop_library target to the generated target. This is being done
because Bazel will not be supporting the existing behavior in
Soong.

Bug: 226199990
Test: m
Change-Id: I117c5a4a9bf7c38e6fb7b92272a390df87507e30
2022-08-15 20:10:58 +00:00
Yu Liu
1175c057d6 Filter out headers generated by bazel in snapshot.
Bug: 242220039
Test: Manually verified that mixed build works
Change-Id: I3daf0b8a7deab275eb52a1c5e30724fda433461d
2022-08-15 12:34:20 -07:00
Treehugger Robot
8c1b47ed03 Merge "Disable/allow some clang-tidy and clang warnings" am: 05a961ba0f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2181036

Change-Id: Ic511df6154444e510589d52e2f329e194345643f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-13 03:06:38 +00:00
Treehugger Robot
05a961ba0f Merge "Disable/allow some clang-tidy and clang warnings" 2022-08-13 02:41:54 +00:00
Chih-Hung Hsieh
3b93ac6784 Disable/allow some clang-tidy and clang warnings
* Disable bugprone-unchecked-optional-access because it
  crashed with some Android files.
* Allow misc-const-correctness and bugprone-assignment-in-if-condition
  as warnings, not to stop build as errors.
  Disable them in the global default check list.
* Allow/show clang deprecated* and array-parameter warnings for the NEXT version.

Bug: 241125373
Bug: 241819232
Bug: 241941550
Bug: 241601211
Bug: 241997913
Test: presubmit
Change-Id: Ifdc7a63c4e349b1ace4880bd002d14dc41054dcf
2022-08-12 15:02:10 -07:00
Pierre-Clément Tosi
6f630ae6f2 Support prefix_symbols for prebuilt libraries
Add support for prefix_symbols from binary and object targets to allow
rules to prefix symbols from a checked-in library before linking against
it, namespacing the resulting symbols and avoiding potential clashes.

Bug: 237371962
Test: Android.bp with cc_prebuilt_library_static::prefix_symbols
Change-Id: Iaf9cdd12637d5a259ae4c4827ff20e4f911699a4
2022-08-10 09:36:11 +01:00
Treehugger Robot
d03ea3d4f1 Merge "Introduce cc_api_library" am: 3a4088dfd1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2162587

Change-Id: I0902c1a7757db36b7fd4564c356f5f6046d3d1af
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-10 04:35:55 +00:00
Treehugger Robot
3a4088dfd1 Merge "Introduce cc_api_library" 2022-08-10 04:12:32 +00:00
Kiyoung Kim
487689eaee Introduce cc_api_library
Introduce cc_api_library, which reflects imported API from other
inner-tree. This cc_api_library module type will later refer from
the other ninja module which generates stub library from the interface
description.

Tested environment :
* original libc definition has been removed temporarily, to ensure that
  imported api stub library is being used from build
* Added new definition of libc as below
 cc_api_library {
  name: "libc",
  arch: {
    x86: {
      src: "libs/x86/libc.so",
    },
    x86_64: {
      src: "libs/x86_64/libc.so",
    },
  },
  header_libs: [
    "libc_headers",
  ],
  export_header_lib_headers: ["libc_headers"],
  min_sdk_version: "9",
  vendor_available: true,
 }

Bug: 236087698
Test: `ALLOW_MISSING_DEPENDENCIES=true m vendorimage` succeeded
Change-Id: I67070b0f3561aa2afd73b6c1c0fdf4255218baac
2022-08-10 10:12:18 +09:00
Cory Barker
c541de62f8 Merge "Revert^2 "Update the way we build AFL++ fuzz binaries"" am: 285112d3fc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2178196

Change-Id: I8f331312d2978ecc17b91f2b1c9da418f56f46c0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-09 20:14:41 +00:00
Cory Barker
285112d3fc Merge "Revert^2 "Update the way we build AFL++ fuzz binaries"" 2022-08-09 19:49:04 +00:00
Treehugger Robot
c6eb659fef Merge "bp2build special case for libcrypto_for_testing" am: c120ab33bc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2178197

Change-Id: Ib0c72a093dbd343a79bbd7ac46a151f1c8c1bcdb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-09 01:46:18 +00:00
Treehugger Robot
c120ab33bc Merge "bp2build special case for libcrypto_for_testing" 2022-08-09 01:21:37 +00:00
Krzysztof Kosiński
b07fbec3eb Merge "Globally force -Wdeprecated-declarations to be a warning." am: 0b4bd22b6f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2176788

Change-Id: I9942df4478a347696718f12c5ce9a234cca62182
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-09 01:04:48 +00:00
Cory Barker
9cfcf6d4e9 Revert^2 "Update the way we build AFL++ fuzz binaries"
Test: Built AFL fuzzers individually and built all using haiku command
and built libfuzzers individually and also by using haiku command. Ran
selected fuzzers manually to ensure fuzzing still worked.

Description: Previously we needed to add cc_afl_fuzz to build an afl fuzz binary,
however, to turn current libFuzzers into AFL fuzzers this would required
an update to each Android.bp file which is a lot of work, and would also
require an approval from each Android.bp file owner, which is even more
work.

To get around this (and also to match how AFL fuzzers are built in G3)
we will build AFL++ fuzz binaries by command line option FUZZ_FRAMEWORK.
When FUZZ_FRAMEWORK=AFL is set, all cc_fuzz modules will be built
for AFL rather than libFuzzer. Devs can also specify if a cc_fuzz module
is only for libFuzzer or AFL by using fuzzing_frameworks. If
fuzzing_frameworks is left blank then it will be assumed that the
cc_fuzz module can be built for all available fuzzing frameworks.

Change-Id: If57d3038f05e52775177eaeb26f8ed2bdc73443a
2022-08-08 20:26:09 +00:00
Sam Delmerico
fae47f9522 bp2build special case for libcrypto_for_testing
A new module libcrypto_for_testing was added that uses the
inject_bssl_hash property, but this property is currently only available
for the libcrypto module specifically.

Test: CI
Change-Id: I1b83de02a2990b7503980bf6a85611683427baf9
2022-08-08 13:35:08 -04:00
Cory Barker
85984a894f Merge "Revert "Updated the way we build AFL++ fuzz binaries"" am: ba73a0997d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2177924

Change-Id: I64c7061a132c51d1e0fdd4ba3e01a0c675785844
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-08 16:56:07 +00:00
Cory Barker
ba73a0997d Merge "Revert "Updated the way we build AFL++ fuzz binaries"" 2022-08-08 16:37:28 +00:00
Cory Barker
74aea6c5ee Revert "Updated the way we build AFL++ fuzz binaries"
Revert submission 2164482-Build AFL from Command line option

Reason for revert: Unit test fails on MAC builds
Reverted Changes:
Ia7a822462:Updated the way we build AFL++ fuzz binaries
I994bde63b:Updated the way we build AFL++ fuzz binaries
Ie863853b4:Updated the way we build AFL++ fuzz binaries
I577d6ae7b:Updated the way we build AFL++ fuzz binaries
Ic4fd34f8d:Updated the way we build AFL++ fuzz binaries

Change-Id: Ic2cda7733d206d7ed178f1db5e38268bc915e57b
2022-08-08 15:55:12 +00:00
Cory Barker
72885b84ee Merge "Updated the way we build AFL++ fuzz binaries" am: edadcdb17c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2164482

Change-Id: I08becb57b4b6b530d390bf142d0aeb7462b07f6f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-08 14:47:02 +00:00
Cory Barker
edadcdb17c Merge "Updated the way we build AFL++ fuzz binaries" 2022-08-08 14:24:16 +00:00
Krzysztof Kosiński
6934b0ee64 Globally force -Wdeprecated-declarations to be a warning.
Some code compiles with -Werror, which makes it very hard to mark
anything as deprecated without breaking the build. This option
will ensure that we can still mark things as deprecated without
breaking such code. Among other things, this will allow us to
undo a local change to protobuf which disables deprecation
warnings.

Bug: 203713560
Test: presubmit
Change-Id: I718de31c3ff685dba4104f3c9e7bd5d169d89f7e
2022-08-07 07:00:41 +00:00
Cory Barker
cecb7546db Updated the way we build AFL++ fuzz binaries
Test: Built AFL fuzzers individually and built all using haiku command
and built libfuzzers individually and also by using haiku command. Ran
selected fuzzers manually to ensure fuzzing still worked.

Description: Previously we needed to add cc_afl_fuzz to build an afl fuzz binary,
however, to turn current libFuzzers into AFL fuzzers this would required
an update to each Android.bp file which is a lot of work, and would also
require an approval from each Android.bp file owner, which is even more
work.

To get around this (and also to match how AFL fuzzers are built in G3)
we will build AFL++ fuzz binaries by command line option FUZZ_FRAMEWORK.
When FUZZ_FRAMEWORK=AFL is set, all cc_fuzz modules will be built
for AFL rather than libFuzzer. Devs can also specify if a cc_fuzz module
is only for libFuzzer or AFL by using fuzzing_frameworks. If
fuzzing_frameworks is left blank then it will be assumed that the
cc_fuzz module can be built for all available fuzzing frameworks.

Change-Id: Ia7a8224627f2de61606b410d1d1a56d7bdc0955f
2022-08-05 21:46:26 +00:00
Mu-Le Lee
0a9005eaad Diff source dump and previous version dump for Cross-Version ABI Check
Created a function to determine the current finalization stage by
environment variable and the existence of a version folder
prebuilt/abi-dumps/<lib_type>/<platform_sdk_version>/.
Assign the corresponding prevVersion with the current stage and generate
mk commands to diff source and previous dump to
{fileName}.{prevVersion}.abidiff with diff flag --allow-extension and
--advice-only
The test is verified in all stages. lsdumps should be prepared in
advance.
For stage 1: current/ and PLATFORM_SDK_VERSION/
For stage 2: current/ and {PLATFORM_SDK_VERSION-1}/
For stage 3: PLATFORM_SDK_VERSION/ and {PLATFORM_SDK_VERSION-1}/
The definition of stages could be found at
"go/cross-version-abi-check#bookmark=id.vpflkul2z968"

Test: make libbinder_ndk
Bug: 238387082
Change-Id: Ic29456113a541650c75fa38c5c4f2d6d2e76a877
2022-08-05 05:37:42 +00:00
Cole Faust
e1022f53bc bp2build support for .asm files am: 7071a05c93
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2168429

Change-Id: Id6241afd422f733d33cafc4208088c353f5e58d4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-03 22:20:25 +00:00
Cole Faust
7071a05c93 bp2build support for .asm files
Bug: 233948256
Test: ./build/bazel/ci/bp2build.sh
Change-Id: I387c2aeb36df004f0e1838a08a4f28b38503d6ed
2022-08-03 13:34:15 -07:00
Mu-Le Lee
b273f88b54 Merge "Diff source dump and current version dump for Cross-Version ABI Check" am: 950f28abe2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2166882

Change-Id: Iaff3116cf86d46f517e1c067dea0ef667c66ea0d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-03 04:13:16 +00:00
Mu-Le Lee
950f28abe2 Merge "Diff source dump and current version dump for Cross-Version ABI Check" 2022-08-03 03:52:38 +00:00
Treehugger Robot
13d06a134f Merge "Remove obsolete notice property." am: 0ea404eb36
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2156349

Change-Id: Ib08598705dbf4904d50f18b1b1c5c206557cf197
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-02 17:46:17 +00:00
Mu-Le Lee
5e04753bb6 Diff source dump and current version dump for Cross-Version ABI Check
In the newly proposed Cross-Verison ABI Check, the path of dump that
LLNDK, NDK and mainline reference to is changed to:
Before finalization: current/
After finalization: {PLATFORM_SDK_VERSION}/
In addition, a related CL(aosp/2147882) modifies the script to create
dump to folders that match the current finalization stage.

Test: make libbinder_ndk
Bug: 238387082
Change-Id: I92a4a52c26c85cf4c866b441e54291c6a624fbf4
2022-08-02 17:35:15 +00:00
Treehugger Robot
0ea404eb36 Merge "Remove obsolete notice property." 2022-08-02 17:22:42 +00:00
Alix
33032667e0 filter unknown clang cflags in bp2build am: 1be00d4e48
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2137955

Change-Id: I1a586c5fe3ffd7f3c767bcd9c79d9d00cfde4302
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-29 18:48:30 +00:00
Bob Badour
0cc5facf79 Remove obsolete notice property.
Bug: 192434786

Test: m droid dist

Change-Id: I0f384ae895cebab9732448b82db600c67eb8f711
2022-07-29 17:54:40 +00:00
Alix
1be00d4e48 filter unknown clang cflags in bp2build
filtering out no longer useful flags in bp2build conversion

Test: cc_library_shared_conversion_test
Bug: 231995978
Change-Id: I5172f6d07a8928291bbc11bd8802678b33cc5b1f
2022-07-29 12:17:25 +00:00
Mu-Le Lee
c56d40cb54 Merge "Move LLNDK ABI dumps from vndk/ to platform/" am: 6f84b7763e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2147824

Change-Id: Id6244f29c95d41aeb7c7207fc741fa70e74307b3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-22 11:03:05 +00:00
Mu-Le Lee
6f84b7763e Merge "Move LLNDK ABI dumps from vndk/ to platform/" 2022-07-22 10:44:06 +00:00
Treehugger Robot
afa6a56bd4 Merge "Fix typo" am: 576bacae1d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2162377

Change-Id: I4f74dac3e4eb4ecddd72e06d0388a0f39a381af2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-21 22:30:23 +00:00
Treehugger Robot
7394062b10 Merge "Add option to allow unknown warning options" am: 485127c76e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2161661

Change-Id: I7b659585ddf16e206a1f6e5d6abc94df87d90636
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-21 22:29:58 +00:00
Treehugger Robot
6d84fa2212 Merge "Update clang version to clang-r458507" am: a9eef7bd2d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2160498

Change-Id: I6caf51563be9c4df4f8894af4c4cb880f8fd7e0a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-21 22:29:23 +00:00
Treehugger Robot
576bacae1d Merge "Fix typo" 2022-07-21 17:32:49 +00:00
jiajia tang
cd1c27b33f Fix typo
Signed-off-by: jiajia tang <tangjiajia@xiaomi.com>
Change-Id: I23bec7b08c11c33a06dd13eb7b60ea38d4f26a11
2022-07-21 18:04:37 +08:00
Yi Kong
f7f69e4992 Add option to allow unknown warning options
Some build targets pulls cflags from build/soong but has its own choice
of compiler version. This causes errors for due to unknown warning
options. This allows them to suppress such checks.

Test: presubmit
Change-Id: Ia89508d6b92481fb1ed0c90f1fdb4d8e54566349
2022-07-21 15:49:05 +08:00
Yi Kong
eb8d04e589 Update clang version to clang-r458507
Test: presubmit
Bug: 236798112
Change-Id: Iff8df2b5c7faf359d0554994586bbc984b7a1856
2022-07-21 06:43:09 +00:00
Yi Kong
f77a1a55f8 Merge "Enable -Wmisleading-indentation for 1p projects" am: 1b3d5f836c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2099784

Change-Id: Ifd673171b918739bb800cf9a5a8410d8a057e115
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-19 17:11:24 +00:00
Yi Kong
1b3d5f836c Merge "Enable -Wmisleading-indentation for 1p projects" 2022-07-19 16:53:32 +00:00
Elliott Hughes
f08a664127 Enable -Wmisleading-indentation for 1p projects
Bug: http://b/232926688
Test: treehugger
Change-Id: I7e3458f23e9b2e7a229a4a3eada5d98bdf4731d0
2022-07-19 11:51:59 +00:00
Treehugger Robot
03c590b4e1 Merge changes I0484ea34,I188e4824 am: b3f18a9f9f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2153678

Change-Id: I412a85473760a3dc7915984d013350edb00ad74b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-19 06:44:19 +00:00
Treehugger Robot
b3f18a9f9f Merge changes I0484ea34,I188e4824
* changes:
  Distinguish # apex and # systemapi symbols
  Refactor symbolfile script
2022-07-19 06:24:04 +00:00
Jiyong Park
ffea9b3b0e #apex symbols no longer contribute to platform libraries
Bug: 239274367
Test: m
Change-Id: I7a6cd0f46071d5dbbf9510df5693a0d6b95e10c0
2022-07-19 13:47:19 +09:00
Jiyong Park
85cc35a143 Distinguish # apex and # systemapi symbols
Previously, the symbol tag `# apex` was treated the same as `#
systemapi`. With this CL, they have different meanings.

`# systemapi`: APIs that are defined in the platform (the non-updatable
part), and are exposed to unbundled system components like APEX

`# apex`: APIs that are defined in the APEX and are exposed to the
platform or other APEXes

Bug: 239274367
Test: m
Change-Id: I0484ea349656dbbd337e5fe3a5970f0ad275b807
2022-07-19 13:47:19 +09:00
Jiyong Park
3f9c41d2f5 Refactor symbolfile script
Introduce the class `Filter` which encapsulates conditions
(architecture, api level, whether llndk is included, etc.) so that we
don't need to touch many places everytime a new condition is added.

In addition, refactor test_symbolfile to reduce duplications

This CL doesn't add a new functionality.

Bug: 239274367
Test: run test_ndkstubgen and test_symbolfile
Change-Id: I188e482492d39ec18134ecc5c908f0d288a754a9
2022-07-19 13:47:15 +09:00
Treehugger Robot
dd3de9731a Merge "Move libFlags as well to the RSP file for link actions" am: e3048505c0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2145559

Change-Id: Ie8157ee7782841a2d4eda9719289b36f0f2faa0f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-18 05:06:03 +00:00
Treehugger Robot
e3048505c0 Merge "Move libFlags as well to the RSP file for link actions" 2022-07-18 04:50:41 +00:00
Yi Kong
5cac3ca30a Merge changes from topic "llvm-stable-r458507" am: cc3ad51a36
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2153673

Change-Id: Id62c1a0f693e22b73c96f5494f0c937df72a1cb9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-15 07:46:42 +00:00
Yi Kong
cc3ad51a36 Merge changes from topic "llvm-stable-r458507"
* changes:
  [bindgen] Allow unrecognised -Wno-* flags on LLVM_NEXT
  Add extra cflags for LLVM_NEXT
2022-07-15 07:30:57 +00:00
Cory Barker
842a6c9b2f Merge "Adding support for building AFLpp Test: Build AFL fuzzers locally and ran them" am: b1c8940be1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2151702

Change-Id: I8872f7a563bfd04d315f4577060176a4eefee55d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-14 16:45:56 +00:00
Yi Kong
b79fc584c7 Add extra cflags for LLVM_NEXT
The staging compiler update sometimes needs additional cflags to build, but those flags may not be recognised by the current compiler. Add a
new `llvmNextExtraCommonGlobalCflags` section and only append those
flags when LLVM_NEXT is set.

Test: LLVM_NEXT=true m
Bug: 236798112
Change-Id: Icc4687950acd44798b2cf09131a425ddfd919214
2022-07-13 07:47:56 +00:00
Cory Barker
a1da26fa9b Adding support for building AFLpp
Test: Build AFL fuzzers locally and ran them

Change-Id: Ie4fbd258c87663cf81d7d64d575b3da1d5febc17
2022-07-12 21:31:47 +00:00
Cory Barker
3eb2a62110 Merge "Revert "Adding support for building AFLpp Test: Build AFL fuzzer..."" am: 14058f2c4a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2151853

Change-Id: Iee4f2067de7dbc952d2e99672fead78e20342719
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-12 20:40:44 +00:00
Cory Barker
7bc91232d1 Revert "Adding support for building AFLpp Test: Build AFL fuzzer..."
Revert submission 2124256-AFLpp support in Soong

Reason for revert: It is breaking the build
Reverted Changes:
Ie07ec3368:Adding support for building AFLpp Test: Build AFL ...
I5bd6d1e9b:Adding support for building AFLpp Test: Built AFL ...

Change-Id: Id2eec1060f7532fec46293d0c207be800e6eaa03
2022-07-12 18:04:17 +00:00
Cory Barker
9f4fb94778 Merge "Adding support for building AFLpp Test: Build AFL fuzzers locally and ran them" am: 7e0b4bae8a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2124256

Change-Id: Idd7529a0fcd1aa3819e042015df71e65b6c6a78f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-12 17:39:55 +00:00
Cory Barker
f4b1c3a7a7 Adding support for building AFLpp
Test: Build AFL fuzzers locally and ran them

Change-Id: Ie07ec336892649192a844a4d0d231196673e34a0
2022-07-12 01:20:17 +00:00
Mu-Le Lee
85155c8ada Move LLNDK ABI dumps from vndk/ to platform/
Since vndk libraries don't need to maintain Cross-Version abi
compatibility. The newly proposed Cross-Version ABi checking mechanism
is applied to only ndk/ and platform/. The reference dumps of LLNDK
libraries should get from platform/ to be benefited from this checking
mechanism.

Test: mkdir -p prebuilts/abi-dumps/platform/UpsideDownCake/64/x86_64/source-based/ && cp prebuilts/abi-dumps/vndk/32/64/x86_64/source-based/libvndksupport.so.lsdump "$_"
      make libvndksupport -j
Bug: 238383845
Change-Id: I663511d60623cd23619166d8d63fd26220a930e2
2022-07-08 08:17:29 +00:00
Kousik Kumar
01332cf3b4 Move libFlags as well to the RSP file for link actions
This is to avoid hitting command-line length issues when building with
RBE enabled for C++ links.

TESTED=ran a build with link actions and saw command-line getting
shorter in size from verbose.log
Bug: b/237480728

Change-Id: Id66165159388554bb76579080c5a6979dd670d22
2022-07-04 20:34:57 +00:00
Treehugger Robot
82a2240a5c Merge "Remove alternative stl names in bp2build" am: 281d421f41
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2132718

Change-Id: I1b10a03236cc2e83aa627e0b7cf70bbc1a3c74b5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-01 15:11:46 +00:00
Treehugger Robot
281d421f41 Merge "Remove alternative stl names in bp2build" 2022-07-01 14:54:20 +00:00
Treehugger Robot
f4da9403f3 Merge changes I93edfd61,Icd23b542,I58c84607,Icfa73a75 am: 4d2f767217
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2139101

Change-Id: I35551b07799c29cb56e2ffdaf7c1693b23f4f8d5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-01 13:10:11 +00:00
Treehugger Robot
4d2f767217 Merge changes I93edfd61,Icd23b542,I58c84607,Icfa73a75
* changes:
  Pass -fno-sanitize=vptr,function for musl
  Use musl rust prebuilts for USE_HOST_MUSL=true
  Don't package host cross modules in javaFuzzPackager
  Add rust musl arm and arm64 toolchains
2022-07-01 12:46:58 +00:00
Colin Cross
6c18d004f2 Pass -fno-sanitize=vptr,function for musl
The prebuilts for musl have the necessary symbols for vptr and function
sanitizers, but enabling them implicitly enables RTTI which causes RTTI
mismatch issues with dependencies.

Bug: 215802826
Test: m USE_HOST_MUSL=true host-native
Change-Id: I93edfd617d99efcac0eca58bb3f3c173c4fa121a
2022-07-01 02:58:25 +00:00
Trevor Radcliffe
4e99f88d41 Merge "Add support and tests for export_*_lib_headers" am: 130d98f8b2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2134738

Change-Id: I7573ebe34941edc361d2f5f13ad55ee9394f06e1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-30 17:49:47 +00:00
Trevor Radcliffe
130d98f8b2 Merge "Add support and tests for export_*_lib_headers" 2022-06-30 17:30:16 +00:00
Xin Li
42307c80c7 Merge "Merge tm-dev-plus-aosp-without-vendor@8763363" into stage-aosp-master 2022-06-29 21:16:54 +00:00
Trevor Radcliffe
2be7f54b45 Add support and tests for export_*_lib_headers
There are 3 different properties about exporting headers in Soong:

1. export_static_lib_headers
2. export_shared_lib_headers
3. export_header_lib_headers

The static and header cases are already supported in bp2build but
do not have tests. This CL adds support for the shared case and
adds tests for all cases.

Fixes: 236268577
Test: Unit tests
Change-Id: Idfb788271e607919d4ac6bc0e4eb4e6ff8f78e8d
2022-06-29 15:25:01 +00:00
Colin Cross
88a029f710 Reland: Don't use hwasan for non-bionic arm64 targets
Don't use hwasan for non-bionic arm64 targets, including
arm64-linux-musl and arm64 darwin.

This relands I67c07f26f25a9f9807ee21ee79c113ea11f65473 which was
accidentally reverted in I47a9322929baff2492c6e8db989ece01fcbeb133.

Bug: 236052820
Test: build arm64 musl sysroot
Change-Id: I77753ecb6f07aafa1b6e00ad6bf432f9c9744f79
2022-06-28 15:15:40 -07:00
Xin Li
313fdb5812 Merge tm-dev-plus-aosp-without-vendor@8763363
Bug: 236760014
Merged-In: I1421fb0dbcdb759281259abfae7bddc9aecdaa56
Change-Id: If059be00e6bdaaa94171b456afae1d585540639c
2022-06-28 21:23:06 +00:00
Vinh Tran
dd3ea92609 Merge "Replace API level codename with number" 2022-06-28 13:39:37 +00:00
Ivan Lozano
3742d6ad9e Merge "rust: Allow rust_ffi_shared in jni_libs" 2022-06-28 12:57:05 +00:00
Treehugger Robot
8624baab51 Merge "Move global asflags to config to share with Bazel" 2022-06-28 02:34:59 +00:00
Vinh Tran
f192474a60 Replace API level codename with number
This CL fixes a bug when Soong pass `-target` with a non-digit suffix in Clang. As mentioned in b/236753843, Clang's version parsing expects to see an integer in the target string so it ignores the
S suffix.

Test: m gwp_asan_crash_handler && make sure -target is aarch64-linux-androidS instead of aarch64-linux-android31
Test: go test -run ^TestNonDigitMinSdkVersionInClangTriple$ android/soong/cc
Bug: 236753843
Change-Id: I258ecc52083dbf3471d23cf310e0ad54440f1908
2022-06-28 01:33:18 +00:00
Liz Kammer
7128d38da5 Remove alternative stl names in bp2build
Test: bp2build.sh
Change-Id: Ie2bdac79306f9a5b50331f808f00187e172e46ab
2022-06-27 17:20:17 -04:00
Ivan Lozano
7f67c2a665 rust: Allow rust_ffi_shared in jni_libs
Allow listing rust_ffi_shared modules as a jni_libs dependency
in conjunction with platform_api: true. This allows inclusion by
android_app modules.

Bug: 237304791
Test: android_app module builds with a rust_ffi_shared dependency.
Change-Id: I3a28e1baa522ad8f9c2aa86f1d23b19ce9f967e1
2022-06-27 16:00:26 -04:00
Colin Cross
2bce04f76f Merge "Add linux_musl arm+arm64" 2022-06-27 18:37:07 +00:00
Evgenii Stepanov
943cfcec8e Merge "Revert "Revert "Keep minimal abort when enabling integer overflow check""" 2022-06-27 18:04:37 +00:00
Colin Cross
a9b2aacf07 Add linux_musl arm+arm64
Add toolchains to support cross compiling to aarch64-linux-musl and
arm-linux-musleabihf.

Bug: 236052820
Test: build arm and arm64 musl sysroots
Change-Id: I47a9322929baff2492c6e8db989ece01fcbeb133
2022-06-24 13:46:36 -07:00
Evgenii Stepanov
59012814a6 Revert "Revert "Keep minimal abort when enabling integer overflow check""
This reverts commit c480fbc5ef.

When cherry-picking this change to a branch, make sure that the target:
* either DOES NOT include
  https://android-review.googlesource.com/c/platform/build/soong/+/1980451/
* or includes
  https://android-review.googlesource.com/c/platform/build/soong/+/2130354/

Bug: b/235090315
Bug: b/235181175
Bug: b/233840743
Test: libcutils.so (in symbols) includes more than 0 and less than 10 functions
      with __ubsan_handle in the name, and does not export any.

Change-Id: I4f30b5814b5460468004efcc543cc681ad0022dc
2022-06-24 13:21:40 -07:00
Yi Kong
c3977fa99b Use LLD for Darwin host binaries
Test: m adb
Bug: 236924555
Change-Id: I4c793eb93af37fd7fe16991d20fcfcc5001c5d18
2022-06-24 13:45:32 +00:00
Yi Kong
cf57a641ba Don't pass deprecated -single_module linker flag on Darwin
man ld:
> -single_module
>     This is now the default so does not need to be specified.

Bug: 236924555
Test: m adb
Change-Id: If33a5c955deca4548c57703b232a3b9c0eaa3563
2022-06-24 18:49:04 +08:00
Treehugger Robot
44c20b886f Merge "Don't use hwasan for non-bionic arm64 targets" 2022-06-23 23:51:00 +00:00
Colin Cross
438bd4af48 Don't use hwasan for non-bionic arm64 targets
Don't use hwasan for non-bionic arm64 targets, including
arm64-linux-musl and arm64 darwin.

Bug: 236052820
Test: build arm64 musl sysroot
Change-Id: I67c07f26f25a9f9807ee21ee79c113ea11f65473
2022-06-23 14:53:52 -07:00
Liz Kammer
e4d1bdaa57 Move global asflags to config to share with Bazel
Test: CI
Change-Id: Ib76bd63f9d021f581b232522d1206d968d7b1599
2022-06-22 21:02:08 +00:00
Trevor Radcliffe
58461be7d6 Merge "Remove implementation_deps from cc_library headers" am: 2923fa8bcf am: 073217461d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2127884

Change-Id: I21137fe037517d79e7087717b5caab1413356750
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-22 15:23:08 +00:00
Trevor Radcliffe
2923fa8bcf Merge "Remove implementation_deps from cc_library headers" 2022-06-22 14:45:18 +00:00
Trevor Radcliffe
fb6c522420 Remove implementation_deps from cc_library headers
Don't add implementation_deps to cc_library_headers in bp2build

Fixes: 236404654
Test: unit tests, USE_MIXED_BUILDS=1 m
Change-Id: I0f6a35c10284f261b6a8b7a4831655d5fa084977
2022-06-21 22:34:11 +00:00
Lukács T. Berki
28e86cdebd Merge "Migrate sanitizers to transition mutators." am: 5ad0185b63 am: c0d25950f2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2123434

Change-Id: I05b8668cd8b2b24c31bc07633e639f0492aa0cd9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-18 20:17:49 +00:00
Lukács T. Berki
5ad0185b63 Merge "Migrate sanitizers to transition mutators." 2022-06-18 19:26:55 +00:00
Lukacs T. Berki
6c71676d6c Migrate sanitizers to transition mutators.
The logic is not 100% provably the same since HEAD was quite
confusing at some points, but I did make an effort to preserve
functional equivalence.

In case that effort was not enough, it should be pretty easy to
tweak the logic at HEAD since it's still quite malleable.

Bug: 231370928
Test: Presubmits.
Change-Id: I17b2efbfb5c4d0aedd922caed54ff8d857e578df
2022-06-18 06:20:28 +02:00
Treehugger Robot
f88731d0bc Merge "Reland: Fix -Wl,--exclude-libs for clang runtime libraries" am: e11164351a am: 967c9d6faf
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2130354

Change-Id: I1d99655893c555077a7fcd12e9881d7abfb654d3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-18 02:25:28 +00:00
Treehugger Robot
e11164351a Merge "Reland: Fix -Wl,--exclude-libs for clang runtime libraries" 2022-06-18 01:43:15 +00:00
Colin Cross
b6652c54e7 Merge "Revert "Fix -Wl,--exclude-libs for clang runtime libraries"" am: 3bd8c1bb3e am: 87037635da
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2130353

Change-Id: I9bd8039dffee609b792463c3bf6dbf0d58096806
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-17 23:06:12 +00:00
Colin Cross
bf1ee022c4 Merge "Fix -Wl,--exclude-libs for clang runtime libraries" am: 3650bd0a0f am: f6926be3cb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2124262

Change-Id: Ia145365682f3a6415b6ad8a7612bb6aa511c01d4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-17 23:06:02 +00:00
Treehugger Robot
9f7fa50427 Merge "Restrict IsSanitizerEnabled() to android.Config()." am: 1c6502eba2 am: 7125d5d606
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2127446

Change-Id: Ie6b578793fa05304b869795af4e0ca4455b75d5b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-17 23:05:53 +00:00
Colin Cross
3e5e778969 Reland: Fix -Wl,--exclude-libs for clang runtime libraries
The sanitize code was assuming that the names of the clang runtime
library modules were the same as their static library output files,
but that's not true after I39e2cf8ae14edf8510276dab38011afaef85822c.
Use the dependency to get the name of the library to pass to
-Wl,--exclude-libs.

This relands If6ca7838800c76f90105fb02d39e8a68cec96314 with a fix
for skipping tests that don't work on mac.
   
Bug: 235624976
Test: TestUbsan
Change-Id: I32894d10d24473ad48b6afc5663f91fa48a6a0ba
2022-06-17 22:48:22 +00:00
Colin Cross
3bd8c1bb3e Merge "Revert "Fix -Wl,--exclude-libs for clang runtime libraries"" 2022-06-17 22:16:42 +00:00
Colin Cross
567d98346c Revert "Fix -Wl,--exclude-libs for clang runtime libraries"
This reverts commit 59de280a48.

Reason for revert: Broke mac tests
Bug: 235624976

Change-Id: I358bb14ec565f106483378f4798e3fc88c491f8f
2022-06-17 22:15:00 +00:00
Colin Cross
3650bd0a0f Merge "Fix -Wl,--exclude-libs for clang runtime libraries" 2022-06-17 22:03:08 +00:00
Lukacs T. Berki
01a648afa0 Restrict IsSanitizerEnabled() to android.Config().
Turns out, the whole context is not needed and then let's not
plumb it any further than necessary.

Test: Presubmits.
Change-Id: I1a25738e5a6ca20dea0d973c2ce435b5e152399b
2022-06-17 08:59:37 +02:00
Chih-hung Hsieh
b4d031f788 Merge "Set NoWarningsAsErrorsInTidyFlags" am: 4fd41ddb4a am: 3850c88cbc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2122977

Change-Id: Ie41228e52143e4a24614c97e80b569c72e26c089
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-14 17:16:02 +00:00
Chih-Hung Hsieh
9f876e9eab Set NoWarningsAsErrorsInTidyFlags
* Reject -warnings-as-errors in the tidy_flags.
* Fix one grammar error in comment.

Bug: 229801437
Test: WITH_TIDY=1 make; make tidy-soong_subset
Change-Id: I4fae229add65131b64cd5a1d06507d27198010ed
2022-06-13 23:58:12 +00:00
Colin Cross
59de280a48 Fix -Wl,--exclude-libs for clang runtime libraries
THe sanitize code was assuming that the names of the clang runtime
library modules were the same as their static library output files,
but that's not true after I39e2cf8ae14edf8510276dab38011afaef85822c.
Use the dependency to get the name of the library to pass to
-Wl,--exclude-libs.

Bug: 235624976
Test: TestUbsan
Change-Id: If6ca7838800c76f90105fb02d39e8a68cec96314
2022-06-13 15:55:06 -07:00
Chih-hung Hsieh
88054dac68 Merge "Prepare to obsolete -warnings-as-errors in tidy_flags" am: 6ba1a7d661 am: 9096a6b0c1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2122976

Change-Id: I1d458e8b49f50112255dd54846e6661c5e4a4438
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-13 20:17:02 +00:00
Yu Liu
110f78ca8e Merge "Support cc code coverage for mixed build" am: 57c1edc4d9 am: 56868c621b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2103671

Change-Id: Ibe7fab143ee1ebbdbe4df73c1d173cc9c3c5a315
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-13 20:16:29 +00:00
Chih-hung Hsieh
6ba1a7d661 Merge "Prepare to obsolete -warnings-as-errors in tidy_flags" 2022-06-13 19:07:21 +00:00
Yu Liu
57c1edc4d9 Merge "Support cc code coverage for mixed build" 2022-06-13 18:57:50 +00:00
Chih-Hung Hsieh
794b81d9d1 Prepare to obsolete -warnings-as-errors in tidy_flags
* A follow up CL will set const NoWarningsAsErrorsInTidyFlags
  and make it an error to use -warnings-as-errors in tidy_flags.
* Append TidyGlobalNoChecks after local tidy_checks to disable some checks.
* Append TidyGlobalNoErrorChecks after local tidy_checks_as_errors
  (-warnings-as-errors) to allow some warnings globally.
* Move bugprone-signed-char-misuse and bugprone-branch-clone to
  globalNoErrorCheckList so we can find and fix some of those warnings.

Bug: 229801437
Test: WITH_TIDY=1 make; make tidy-soong_subset
Change-Id: I0128b859b7be6eb9bbda1916b89a6a471b052150
2022-06-12 20:25:43 -07:00
Treehugger Robot
139cee9521 Merge "Revert "Keep minimal abort when enabling integer overflow check"" am: 85f2c4eadc am: 288d88b244
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2122286

Change-Id: I8050c0dea79de4f7b8b50bd4000557c642c94636
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-11 04:17:11 +00:00
Treehugger Robot
85f2c4eadc Merge "Revert "Keep minimal abort when enabling integer overflow check"" 2022-06-11 03:32:19 +00:00
Colin Cross
0d7bd9deb6 Merge "Use -fdebug-default-version=4 for assembly files" am: 49fc44f6b2 am: 96aad8abcf
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2120563

Change-Id: Ib8863b915723faae69be8f11abc9b38e5f5224f6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-10 20:32:39 +00:00
Chih-hung Hsieh
d84cfaf477 Merge "Disable tidy checks in TidyGlobalNoChecks" am: 6f9312127c am: eae21b5c3d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2120564

Change-Id: Id8a3ef4046dbb89a7b8ed3240298d76413fe5ad5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-10 20:31:57 +00:00
Evgenii Stepanov
c480fbc5ef Revert "Keep minimal abort when enabling integer overflow check"
This reverts commit 34448f2430.

Reason for revert: RAM regression + something mainline related
Bug: b/235090315
Bug: b/235181175
Bug: b/233840743

Change-Id: Ia1d1b1428c19b1e297dc75618d640bdac81713b0
2022-06-10 19:47:26 +00:00
Colin Cross
49fc44f6b2 Merge "Use -fdebug-default-version=4 for assembly files" 2022-06-10 18:32:35 +00:00
Chih-hung Hsieh
6f9312127c Merge "Disable tidy checks in TidyGlobalNoChecks" 2022-06-10 18:01:08 +00:00
Yasin Kilicdere
aa02f8fc0b Revert "Disallow -warnings-as-errors in tidy_flags" am: 5a8ce13c2a am: a3cc2a6b11
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2122465

Change-Id: Iadf24ea22c108d6c4556ce6b9758c36d6f547ebb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-10 15:03:02 +00:00
Yasin Kilicdere
5a8ce13c2a Revert "Disallow -warnings-as-errors in tidy_flags"
This reverts commit 2d481842b1.

Reason for revert: b/235569235#comment4

Change-Id: I5c87b1d5a1bdf0bad7f436c397688fe3fc20d04e
2022-06-10 12:18:07 +00:00
Chih-Hung Hsieh
c650faa8e5 Disallow -warnings-as-errors in tidy_flags am: 2d481842b1 am: f3a8ef4231
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2080669

Change-Id: I918c00e10ed94af1fefdc292464534be7cfd5faf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-10 09:55:42 +00:00
Chih-Hung Hsieh
43b920e707 Disable tidy checks in TidyGlobalNoChecks
* Save repeated strings in TidyFlags of build.ninja rules.
* Some of these checks were disabled to upgrade clang-tidy.
  They could later be moved to TidyDefaultGlobalChecks and
  TidyExternalVendorChecks if not breaking the build.
  Some projects can then enable those checks locally.

Test: WITH_TIDY=1 make; make tidy-soong_subset
Change-Id: I70e4218c929e3c88f766f2c68c56c51356110e72
2022-06-09 17:58:41 -07:00
Chih-Hung Hsieh
2d481842b1 Disallow -warnings-as-errors in tidy_flags
* Also remove the undocumented complicated
  experiment to overwrite local warnings-as-errors.

Bug: 229801437
Test: WITH_TIDY=1 make; make tidy-soong_subset
Change-Id: I2fb32146b4685ab9f5198724c15c303f799b7a14
2022-06-09 11:12:10 -07:00
Colin Cross
cdcb680dbd Use -fdebug-default-version=4 for assembly files
-fdebug-default-version=5 is causing $TMPDIR to end up in the dwarf
debug data, which causes the buildbot results to be nondeterministic.
Pass -fdebug-default-version=4 for assembly files as a workaround.

Bug: 235105792
Test: lunch aosp_arm-userdebug && m libbase && llvm-dwarfdump --debug-line out/target/product/generic/symbols/system/lib/libbase.so
Change-Id: Ife04e3c898bbb1291f71b8365fbca854cd2d2b66
2022-06-09 11:08:50 -07:00
Trevor Radcliffe
d456182dd1 Merge "Enable Mixed Builds for Prebuilt Library" am: 74e8df0741 am: d6b70adce7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2101150

Change-Id: Ia64712d0ca085e856c569ac6d06e58299d54e34b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-08 14:53:08 +00:00
Trevor Radcliffe
74e8df0741 Merge "Enable Mixed Builds for Prebuilt Library" 2022-06-08 13:51:13 +00:00
Hsin-Yi Chen
4108552615 Merge "Remove unneeded logic from sourceAbiDiff" am: 6e9225d53c am: 76e7546a6b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2114875

Change-Id: I5768c30f4e80a65e0bb998c0700a7210c915e19d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-08 03:46:25 +00:00
Hsin-Yi Chen
6e9225d53c Merge "Remove unneeded logic from sourceAbiDiff" 2022-06-08 02:12:58 +00:00
Yi Kong
455b84363a Merge "Remove sampling profile support from pgo rule" am: 0e12680a2e am: 8067d9c871
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2117277

Change-Id: If3ef3a3ae492057d6509e431e32cd9765d1663de
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-07 21:56:21 +00:00
Chih-hung Hsieh
cdcb038d47 Merge "Shorten the -checks flag in clang-tidy rules" am: 7fd85c45f8 am: 6f807b422e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2116278

Change-Id: I8e87c5fa1dee29dba6e999cd55ac40e79c7ea959
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-07 21:56:10 +00:00
Yi Kong
0e12680a2e Merge "Remove sampling profile support from pgo rule" 2022-06-07 21:20:45 +00:00
Chih-hung Hsieh
7fd85c45f8 Merge "Shorten the -checks flag in clang-tidy rules" 2022-06-07 21:14:14 +00:00
Trevor Radcliffe
5d6fa4d857 Enable Mixed Builds for Prebuilt Library
This change provides support for mixed builds for
cc_prebuilt_library modules and allowlists some such modules.

Fixes: 225938765
Test: Unit tests, run mixed builds and verify correctness
Change-Id: I04396c79661df6b9a43907859e4f96d0191e8e1b
2022-06-07 20:36:53 +00:00
Yi Kong
fe841868c2 Remove sampling profile support from pgo rule
Sampling profiles should use afdo rule instead.

Test: presubmit
Bug: 218791486
Change-Id: I6073da27d184a779be0f6796f336e6ec051beceb
2022-06-07 15:23:08 +08:00
Treehugger Robot
59d37c8bb6 Merge "Remove AIDL modules from VndkMustUseVendorVariantList" 2022-06-07 01:00:06 +00:00
Elliott Hughes
b85366e699 Merge "Revert "Disable BTI for now."" am: ba4a566e2d am: 0770744797
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2020301

Change-Id: I9483bcf63e54ae8df300a3bef750575ac90d5aa4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-06 21:14:43 +00:00
Elliott Hughes
ba4a566e2d Merge "Revert "Disable BTI for now."" 2022-06-06 20:10:56 +00:00
Yu Liu
8d82ac58b4 Support cc code coverage for mixed build
Bug: 231322627
Test: Manual tests and unit tests
Change-Id: I786042af0d612192c54c3572f63a86a47174a242
2022-06-06 12:29:25 -07:00
Liz Kammer
d9b3cf60c2 Merge "Do not hardcode default/experimental c{pp}std" am: ace70d857e am: 72627266b9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2106991

Change-Id: Idc6f6c058d2d1b1e5cd930adb9be52a8a33397b5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-06 14:21:07 +00:00
Liz Kammer
ace70d857e Merge "Do not hardcode default/experimental c{pp}std" 2022-06-06 13:40:17 +00:00
Treehugger Robot
98306aa91c Merge "Keep minimal abort when enabling integer overflow check" am: dcec8e067b am: 48d7862515
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2114953

Change-Id: Idbbb36f82d3198126a939e015506d5aa4fbd95da
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-06 10:18:47 +00:00
Treehugger Robot
dcec8e067b Merge "Keep minimal abort when enabling integer overflow check" 2022-06-06 09:45:12 +00:00
Treehugger Robot
01346ff1a6 Merge "Use single clang-tidy build rule and clang-tidy.sh" am: b12ae4f2bd am: 011e470e5e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2110906

Change-Id: I52e5741db934b6166c3f6a9bb75bb0c6726b4bc5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-04 00:45:00 +00:00
Chih-Hung Hsieh
80e3e03aa9 Shorten the -checks flag in clang-tidy rules
* If a module defines tidy_checks with "-*",
  pass only "-*" and checks after it to clang-tidy.

Test: make tidy-soong_subset
Change-Id: I2a4a6111f67b934bc29e4e4fe8596a8dce4e7031
2022-06-03 17:17:17 -07:00
Treehugger Robot
b12ae4f2bd Merge "Use single clang-tidy build rule and clang-tidy.sh" 2022-06-04 00:06:26 +00:00
TreeHugger Robot
6f2ef6127c Merge "Remove AIDL modules from VndkMustUseVendorVariantList" into tm-dev-plus-aosp 2022-06-03 22:10:15 +00:00
Colin Cross
4ec2bf1467 Merge "Revert "Use --dependency-file when linking elf files."" am: b914e7f8c6 am: c43e5ff7cc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2115768

Change-Id: Ieed01217bf395e4951ff571a69b346327d584168
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-03 17:40:20 +00:00
Colin Cross
b914e7f8c6 Merge "Revert "Use --dependency-file when linking elf files."" 2022-06-03 16:53:54 +00:00
Jooyung Han
87f73e527c Remove AIDL modules from VndkMustUseVendorVariantList
Vendor variants of AIDL-gen CC modules are by default different from
core variants. So instead of adding them manually to the list, AIDL
builder can mark them as MustUseVendorVariant.

Bug: 233616647
Test: m
Merged-In: Ifca0eb64d60ecb49d72cd0347336b69fb332c58c
Change-Id: Ifca0eb64d60ecb49d72cd0347336b69fb332c58c
(cherry picked from commit b8d3df82ac)
2022-06-03 04:54:52 +00:00
Jooyung Han
43b2c668da Remove AIDL modules from VndkMustUseVendorVariantList
Vendor variants of AIDL-gen CC modules are by default different from
core variants. So instead of adding them manually to the list, AIDL
builder can mark them as MustUseVendorVariant.

Bug: 233616647
Test: m
Merged-In: Ifca0eb64d60ecb49d72cd0347336b69fb332c58c
Change-Id: Ifca0eb64d60ecb49d72cd0347336b69fb332c58c
2022-06-03 04:46:59 +00:00
Colin Cross
32320e89fd Revert "Use --dependency-file when linking elf files."
This reverts commit 97d87760b4.

Reason for revert: b/234772469

Bug: 137961579
Bug: 234772469
Change-Id: I478f5a2696e87144d0123e8872c9f8ac1d5f24b0
2022-06-02 23:02:01 +00:00
Hang Lu
34448f2430 Keep minimal abort when enabling integer overflow check
Cflag "-fsanitize-trap=all" will override "-fno-sanitize-trap=integer" if "-fsanitize-trap=all" is placed behind. Change the order to make minimal abort work, which will output the abort message to give user a better prompt.

Bug: 233840743
Test: "objdump -dS {CFI enabled so}" to check the instrumented abort instruction
Change-Id: Id85fa8ece3e13d1b21b4fdbf5f4b5124011890ca
2022-06-02 20:47:30 +08:00
Hsin-Yi Chen
dccddb6036 Remove unneeded logic from sourceAbiDiff
- The script creating reference dumps does not need --llndk. It can
  determine the library types automatically.
- NDK passes the ABI checks with -consider-opaque-types-different.
- All libraries checked by the ABI tools have exported headers and don't
  need -advice-only.

Bug: 232891473
Test: development/vndk/tools/header-checker/utils/create_reference_dumps.py \
      && make
Change-Id: Ia418022d6d0b46bfabefaa296fa81e80291fde32
2022-06-02 18:49:26 +08:00
Treehugger Robot
5d069fb876 Merge "Add diff_flags as a header_abi_checker property" 2022-06-02 04:14:57 +00:00
Chih-Hung Hsieh
30ab2f059f Use single clang-tidy build rule and clang-tidy.sh
* The old jobs of two build rules are now combined into
  a new clang-tidy.sh wrapper.
  The clang-tidy build rule now calls clang-tidy.sh.

Bug: 234406661
Test: WITH_TIDY=1 make; make tidy-soong_subset
Change-Id: I91961edf96e9a546f0c3088715a6f2ca8796a21b
2022-05-31 18:46:39 -07:00
Treehugger Robot
5a3b1c792c Merge "Remove -sha256 flag when calling bssl_inject_hash." am: ced67ded0b am: 7e786306df
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2101112

Change-Id: Ied93aad59538ecae30b560265dbf63006f0e5e76
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-31 17:23:26 +00:00
Treehugger Robot
ced67ded0b Merge "Remove -sha256 flag when calling bssl_inject_hash." 2022-05-31 16:53:06 +00:00
Liz Kammer
a5a29de677 Do not hardcode default/experimental c{pp}std
Prevent bugs like b/232866078 by using the same values across Bazel and
Soong

Test: bp2build.sh
Change-Id: If257f9f5f8e8a70bbf3a8cf5479758c703c25c3f
2022-05-27 09:38:03 -04:00
Hsin-Yi Chen
6ad1e4b5ea Add diff_flags as a header_abi_checker property
The property allows developers to add extra flags to header-abi-diff for
specific libraries.

Bug: 232891473
Test: m libbinder.vendor
Change-Id: I203af73c784dfc7738bb64f57b224c08d5c595ce
Merged-In: I203af73c784dfc7738bb64f57b224c08d5c595ce
(cherry picked from commit 4f992b663f)
2022-05-26 15:12:37 +08:00
Hsin-Yi Chen
ab255ae347 Merge "Add diff_flags as a header_abi_checker property" into tm-dev am: 39a9db3bae
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/18482834

Change-Id: I6f53043eead9258ecc9903a3d779ed04df60aef2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-26 05:24:08 +00:00
Hsin-Yi Chen
39a9db3bae Merge "Add diff_flags as a header_abi_checker property" into tm-dev 2022-05-26 04:21:54 +00:00
Trevor Radcliffe
2bb24935e4 Merge "Generate genlex rules from bp2build for cc targets" am: 5731d0fffd am: c68fbc38e7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2092784

Change-Id: I91cba2b4927db6e1284efcf82161f81f4216bebb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-25 20:32:59 +00:00
Trevor Radcliffe
5731d0fffd Merge "Generate genlex rules from bp2build for cc targets" 2022-05-25 19:38:15 +00:00
Yi Kong
6faa9b759a Merge "Enable string-compare warning" am: f13a66adfd am: e99fbffa25
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2098017

Change-Id: I615039bbe1d8ba084bda367b836184b4c6606475
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-25 08:02:30 +00:00
Yi Kong
f13a66adfd Merge "Enable string-compare warning" 2022-05-25 07:02:34 +00:00
Muhammad Haseeb Ahmad
35ca6bc67f Merge "Make IsSanitizerEnabledForJni return false" am: 53a129db89 am: e353655540
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2105764

Change-Id: Icb9a49ce6817fe2f7fa6a6d35b6b2345cd07035c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-25 06:59:42 +00:00
Muhammad Haseeb Ahmad
e6567fe56b Make IsSanitizerEnabledForJni return false
Change-Id: I5e1722bc32b63649fc9973d11e9fd5bdea72ddbe
Test: m
2022-05-25 00:13:08 +00:00
Liz Kammer
3d704c2826 Merge "Handle multiple linkages in sdk snapshots" am: 91f10eccc6 am: 1446249224
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2097793

Change-Id: I5f428f85d998cde7a90d3cf361480a66363ae3db
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-24 14:55:28 +00:00
Trevor Radcliffe
ef9c900ec3 Generate genlex rules from bp2build for cc targets
This change will cause bp2build to generate genlex targets any
time a .l or .ll file is present in the srcs for a cc target and
add those genlex targets to the srcs attribute of the original
target.

Bug: 207408632
Test: unit tests
Change-Id: I1bce82c9d3c3d458eae1cef547ffae3d6e975134
2022-05-24 14:42:51 +00:00
Liz Kammer
91f10eccc6 Merge "Handle multiple linkages in sdk snapshots" 2022-05-24 14:13:19 +00:00
Yi Kong
8ecb22d402 Enable string-compare warning
Test: presubmit
Bug: 153764102
Change-Id: I6fbf7a841cb6ea7bc8433fd2fddd5a825f68aa22
2022-05-24 16:16:21 +08:00
Liz Kammer
a99444cf9d Merge "Remove library decorator for extracting headers" am: 707f65d3d5 am: f5e9440e45
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2097186

Change-Id: Id8724a1650f87ab39809ebf5abdeb9b4034ca3dd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-23 20:02:54 +00:00
Christopher Parsons
424baa8f24 Merge "cc bazel handlers: use better interface checking" am: b002f87d2e am: 6be00cbfac
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2098663

Change-Id: I500bf1f35121d0ae51c56703928d05e4df04a53f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-23 20:02:00 +00:00
Liz Kammer
707f65d3d5 Merge "Remove library decorator for extracting headers" 2022-05-23 19:36:57 +00:00
Christopher Parsons
b002f87d2e Merge "cc bazel handlers: use better interface checking" 2022-05-23 18:54:50 +00:00
Treehugger Robot
a2a665b40e Merge "Clean up some bp2build technical debt" am: 5bec8d41ea am: d5c19f1eb9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2075729

Change-Id: Ia782f52cc1dfb7a43cef80f8fd374160b0208526
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-23 18:53:44 +00:00
Treehugger Robot
5bec8d41ea Merge "Clean up some bp2build technical debt" 2022-05-23 18:01:04 +00:00
Yi-yo Chiang
b421d787b2 Merge "Add android.hardware.gnss-V2-ndk to VndkMustUseVendorVariantList" into tm-dev am: 6fc324a9e0
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/18473525

Change-Id: I10dfdeec83a8bd75fd744d9de9cf4590553794fa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-23 16:43:38 +00:00
Liz Kammer
96320dfff8 Handle multiple linkages in sdk snapshots
Currently, if the same library is specified for multiple of native_libs,
native_shared_libs, and native_static_libs for different arch/oses,
there can be a few errors:

1. specifying a .so file as `srcs` within a cc_prebuilt_library rather
than being specified only for shared
2. the final type of prebuilt library is dependent on the arch/os

This change introduces:
* an ability for a member type to override the type for specified
  properties
  * checks for a library being used with incompatible member types
  * basing linkage nesting on the member type in addition to variants

  This will ensure that the correct library type is used, regardless of
  the order of iteration over oses/arches, and support nesting linkages
  where necessary but only one linkage variant exists.

Test: soong tests
Test: CI
Change-Id: I81dee013b09b99c34ca6c18f9cfcc12ee56d33d1
2022-05-23 10:51:22 -04:00
Christopher Parsons
89aeb9181b Merge "Refactor mixed builds to only take one pass" am: 489128b8ef am: 935261d614
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2094705

Change-Id: I64c79ef138c4a5ee8e6197d2ce2b50bb7397ea7d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-20 16:15:37 +00:00
Chris Parsons
6ce2cf9b69 cc bazel handlers: use better interface checking
This is a far better approach for ensuring that bazel handlers implement
the BazelHandler interface, as it causes a compile error if they do not
implement the appropriate interface methods.

Test: Manually verified no change in ninja file
Change-Id: I63a4f8b57e3aedd4c0915c2fd2eb7029e9a993aa
2022-05-20 10:54:17 -04:00
Christopher Parsons
489128b8ef Merge "Refactor mixed builds to only take one pass" 2022-05-20 14:13:49 +00:00
Chris Parsons
f874e46153 Refactor mixed builds to only take one pass
This large refactoring has both immense performance implications and
improves mixed builds complexity / usability. Summary:

1. Queueing calls to Bazel is done in a new mutator instead of a full
   soong_build pass. Normal soong_build flow is interrupted (via a
   functional hook in blueprint) to invoke bazel and parse its response.
2. Implementing mixed build support for additional modules is as simple
   as implementing MixedBuildsBuildable. In this interface, define the
   request that must be queued to Bazel, and then subsequently define
   how to handle the returned bazel cquery metadata.
3. Mixed builds consists of only a single pass. This greatly
   improves mixed build performance.

Result:
  A 33% runtime improvement on soong analysis phase with mixed builds.

Caveats:
  C++ BazelHandler handling still remains a bit of a mess; I did what
  I could within this CL's scope, but this may require additional cleanup.

Test: Treehugger
Test: Verified that aosp_arm ninja file is bit-for-bit identical with or
without this change.

Change-Id: I412d9c94d429105f4ebfafc84100d546069e6621
2022-05-20 10:04:13 -04:00
Md Shahriar Hossain Sajib
c79d12269c Merge "Revert "Turn gtest isolated true by default"" am: cf5161be7c am: 85b58b0eb9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2100876

Change-Id: I98ebf64aecc369ccbf7208c1f7d77faf07ca35c6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-20 13:25:53 +00:00
Md Shahriar Hossain Sajib
cf5161be7c Merge "Revert "Turn gtest isolated true by default"" 2022-05-20 08:16:01 +00:00
Md Shahriar Hossain Sajib
d8b58663ff Revert "Turn gtest isolated true by default"
This reverts commit d2a9d88410.

Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=git_master&target=aosp_bramble-userdebug&lkgb=8618360&lkbb=8620137&fkbb=8618374, bug b/233280626

Bug: 233280626
Change-Id: If56b36ea1c883415b90bd2153707cb69df29776e
2022-05-20 08:02:50 +00:00
Yi Kong
81e711424e Merge "Rename modulesAddedWall to modulesWarningsAllowed" am: 8e836ba4b7 am: b2c1ea9749
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2098612

Change-Id: Id1360bc05eeef79518176bc2177dacc25743638b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-20 00:49:01 +00:00
Yi Kong
8e836ba4b7 Merge "Rename modulesAddedWall to modulesWarningsAllowed" 2022-05-20 00:26:18 +00:00
Julien Desprez
4d995a5b76 Merge "Turn gtest isolated true by default" am: 754edfa660 am: c05fce0836
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2092883

Change-Id: I60ae5b76029b0542130bf40472ed254f769176a1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-19 21:13:38 +00:00
Julien Desprez
754edfa660 Merge "Turn gtest isolated true by default" 2022-05-19 20:38:45 +00:00
Lukács T. Berki
3982666000 Merge "Keep a "sanitizer dependency" flag for each sanitizer." am: 913b3c7585 am: 0907ebaf1e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2098988

Change-Id: I9405aba0b9b38ad185591f48bedd210286edc6d5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-19 12:50:49 +00:00