Commit graph

7735 commits

Author SHA1 Message Date
Liz Kammer
2a109bc820 Disable misc ubsan Soong test on mac
Test: run on mac build
Change-Id: I869775ce76fd619557bf6833f99c5b924bcc5a8e
2022-12-02 09:36:01 -05:00
Jingwen Chen
8ec23f846d Merge "Convert apex_available (for supported modules) to bazel tags." 2022-12-02 07:22:10 +00:00
Kiyoung Kim
62ed3dd5f8 Rename export_headers of cc_api_variant
Rename export_headers of cc_api_variant as export_include_dirs, because
the property only supports header directory.

Bug: 244244438
Test: Cuttlefish vendor build succeeded
Change-Id: I6e1468f51694150c70d3b0def2917f0ba74f7ea0
2022-12-02 10:31:48 +09:00
Treehugger Robot
a8ad378abc Merge "Remove workaround for -fexceptions and stack MTE" 2022-12-02 00:52:41 +00:00
Treehugger Robot
6721ab5d40 Merge "Allow hwasan variant for vendor_snapshot_static modules" 2022-12-02 00:27:22 +00:00
Treehugger Robot
5195178376 Merge "soong: add os name to cc_genrule" 2022-12-01 22:55:33 +00:00
Florian Mayer
06aca9b448 Remove workaround for -fexceptions and stack MTE
The upstream change was merged in https://r.android.com/2322236

Bug: 174878242
Change-Id: Ia23d4a9d6ef54ed2c286e0b1becec1f35df75160
2022-12-01 14:23:23 -08:00
Liz Kammer
f843436455 Merge changes Ia165e4be,I63fe74fb
* changes:
  Update sanitize to not modify user properties
  Extend sanitize_test.go
2022-12-01 22:10:18 +00:00
Treehugger Robot
b8ae9cd936 Merge "Limit propagating san config of shared to fuzzer" 2022-12-01 20:33:50 +00:00
Patrick Rohr
5307b3c790 soong: add os name to cc_genrule
While converting from gn to bp we stumbled upon genrules that have different cmd's for different targets. cc_genrule supports different architectures, but it does not give us any information about the OS types (some genrules are use for both host and android targets).

Change-Id: Ida531ad8b59d87a91d6faedbfe8fee9f75640bd1
Test: TH
2022-12-01 20:01:03 +00:00
Jingwen Chen
c4c34e1eab Convert apex_available (for supported modules) to bazel tags.
The tags will then be read by an aspect applied from apex attributes to
validate that the deps are explicitly opt-in to the appropriate apex.

The semantics of this is the same as the Soong apex_available property.

This also adds the "base_apex_name" attr to override_apex conversion so
that apex_available checks continue to work on the non-Google and non-Go
apex names.

Test: presubmits
Fixes: 218841706
Change-Id: I19b3637da9aa47573b252d74f62b601fbdc3784d
2022-12-01 06:25:25 +00:00
Hsin-Yi Chen
365dcdf655 Merge "Deprecate ABI reference dumps in gzip" 2022-12-01 05:18:05 +00:00
Treehugger Robot
c6bea2d26e Merge "Reland "Update clang version to clang-r475365"" 2022-12-01 04:08:08 +00:00
Kiyoung Kim
48c4b601b9 Merge "Support NDK variant of cc_api_variant" 2022-12-01 02:45:33 +00:00
Hsin-Yi Chen
09a88fa528 Merge "Refactor the build rules for ABI diff" 2022-12-01 02:21:07 +00:00
Chih-hung Hsieh
dd8eaf8dbe Merge "Reland "Enable sizeof-array-div warning"" 2022-12-01 02:00:58 +00:00
Chih-hung Hsieh
ecd88699fa Reland "Enable sizeof-array-div warning"
This reverts commit 6be24baec4.

Reason for revert: warnings fixed in source files

Change-Id: I223ff6343c41ac957485726a3de006a84b9369df
2022-12-01 01:02:10 +00:00
Yabin Cui
29f248b086 Reland "Update clang version to clang-r475365"
This reverts commit a558be6472.
Reason for revert: broken build was fixed

Bug: 253033919
Test: build
Change-Id: If6adf2ece00081eb2eeec7895461293751f94be1
2022-11-30 13:34:35 -08:00
Treehugger Robot
82c41a8a19 Merge "Improve error output for missing ABI dumps." 2022-11-30 19:18:48 +00:00
Yu Liu
734fefdf90 Merge "Support abi check in bazel." 2022-11-30 17:57:42 +00:00
Kiyoung Kim
d5d1ab1b3e Support NDK variant of cc_api_variant
Update cc build logic to support NDK variant of cc_api_variant. Any
cc_api_library with NDK variant of cc_api_variant would be treated as
similar with NDK library.

Bug: 259007436
Test: Cuttlefish vendor build succeeded
Change-Id: I75a7475f4fdcbac779f5aa64e76c60f94ea7ea1a
2022-11-30 16:36:14 +09:00
Hsin-Yi Chen
0af4e6728a Deprecate ABI reference dumps in gzip
ABI dumps in gzip are no longer supported because they cannot be
reviewed or merged.

Bug: 227282691
Test: make
Change-Id: I9fdf943fb8ae30aeae884d4d361a65034ab6fa94
2022-11-30 15:02:18 +08:00
Hsin-Yi Chen
a6ddb144f8 Refactor the build rules for ABI diff
- Move the logic that determines the versioned dump directories
  from pathForVndkRefAbiDump to linkSAbiDumpFiles.
- Move sourceAbiDiff which generates the flags for ABI diff from
  builder.go to library.go.
- Define two functions that generate the rules for cross-version and
  same-version ABI diff.

Bug: 227282691
Test: make
Change-Id: Ic33799e86dd9ae627f5680b70973f96e15c030e9
2022-11-30 11:34:39 +08:00
Yabin Cui
a7526ad43a Merge "Revert "Update clang version to clang-r475365"" 2022-11-30 02:02:37 +00:00
Yabin Cui
a558be6472 Revert "Update clang version to clang-r475365"
This reverts commit 7a53b71f3b.

Reason for revert: fix aosp_riscv64-userdebug build

Change-Id: Ie1579c5692335573b85fd5b062a4104023276287
2022-11-30 02:00:43 +00:00
Treehugger Robot
acf23fe098 Merge "Revert "Enable sizeof-array-div warning"" 2022-11-30 01:50:46 +00:00
Yabin Cui
4a06eea3cf Merge "Update clang version to clang-r475365" 2022-11-30 00:46:00 +00:00
Krzysztof Kosiński
6be24baec4 Revert "Enable sizeof-array-div warning"
This reverts commit 5a06f330ed.

Reason for revert: Breaks aosp_bramble-userdebug
https://android-build.googleplex.com/builds/submitted/9348502/aosp_bramble-userdebug/latest/view/logs/build_error.log

Change-Id: I4e360638dee2c2d620c814ccb1c752cef47c0d21
2022-11-29 23:19:34 +00:00
Chih-hung Hsieh
bd879db596 Merge changes I84cf63d1,Ia74af915
* changes:
  Enable sizeof-array-div warning
  Enable array-parameter warning
2022-11-29 21:41:24 +00:00
Yu Liu
56ccb1aecd Support abi check in bazel.
Bug: 253498204
Test: Manual and unit test.
Change-Id: Id23c4f772f67c4ba05704eaad77322133474b42b
2022-11-29 11:25:10 -08:00
Dan Albert
f7cb563a18 Improve error output for missing ABI dumps.
Bug: http://b/156513478
Test: tried using this, saw the error message
Change-Id: Ia5b292315a5c5d603ab0ba4dc3303b1b8ff2ef5b
2022-11-29 17:20:16 +00:00
Jingwen Chen
ed6240d1bc Merge "Revert "bp2build conversion for Sanitize.Integer_overflow"" 2022-11-29 02:35:07 +00:00
Chih-Hung Hsieh
5a06f330ed Enable sizeof-array-div warning
Except third-party external/vendor projects.

Bug: 148815709
Test: presubmit; make tidy-soong_subset
Change-Id: I84cf63d1b9e244acb3ff3bc913ee9c2f1eae0e5a
2022-11-29 00:13:01 +00:00
Chih-Hung Hsieh
823e0b7e12 Enable array-parameter warning
Except third-party external/vendor projects.

Bug: 241941550
Test: presubmit; make tidy-soong_subset
Change-Id: Ia74af9155d7d1aca0e6cecf1103f4d0de4345291
2022-11-29 00:12:07 +00:00
Jingwen Chen
0ead79bd11 Revert "bp2build conversion for Sanitize.Integer_overflow"
Revert submission 2277186-ubsan_bp2build

Reason for revert: b/260630869 broke mixed_droid
Reverted Changes:
Idd9b33e53:bp2build conversion for Sanitize.Integer_overflow
I0d636e439:Add Sanitizer libs up the dependency tree
If113de7bc:Introduce toolchain features for sanitizers

Change-Id: Idf7e7b62f6fb6d4ff92341cc4c9c4b7426b70951
2022-11-28 22:44:35 +00:00
Trevor Radcliffe
202f2afbf8 Merge "bp2build conversion for Sanitize.Integer_overflow" 2022-11-28 21:45:07 +00:00
Yabin Cui
7a53b71f3b Update clang version to clang-r475365
Bug: 253033919
Test: build
Change-Id: I3c0d133d57cc389ee62502dd6aa36ee019e624d6
2022-11-28 13:40:14 -08:00
Trevor Radcliffe
548fc5dcec bp2build conversion for Sanitize.Integer_overflow
and Sanitize.Misc_undefined.

Bug: 253428057
Test: Unit tests
Change-Id: Idd9b33e537d1b1c80b0c96a9590327dae13fada7
2022-11-28 19:31:34 +00:00
Yi-yo Chiang
9fd9129b57 Merge "cc: Add docstring for IsVndk() and UseVndk()" 2022-11-25 09:17:26 +00:00
Yi-Yo Chiang
1080f0c495 cc: Add docstring for IsVndk() and UseVndk()
Note that IsVndk() returns true for all variants of vndk-enabled
libraries. Not only vendor variant, but also platform and product
variants of vndk-enabled library return true.

OTOH, `UseVndk() && IsVndk()` returns true for vendor and product
variants of vndk-enabled libraries, which actually include the actual
VNDK libs (which goes into the VNDK apex) and VNDK extension libs (which
goes to /product or /vendor partition).

Bug: 259361996
Test: Presubmit
Change-Id: Ib735fe0f7433284ca768d0e251a4f599fff5185c
2022-11-24 20:29:35 +08:00
Justin Yun
39c303116a Allow hwasan variant for vendor_snapshot_static modules
vendor_snapshot_static modules can define hwasan variant as below:

vendor_snapshot_static {
    name: "libsnapshot",
    vendor: true,
    version: "33",
    arch: {
        arm64: {
            src: "libsnapshot.a",
            hwasan: {
                src: "libsnapshot.hwasan.a",
            },
        },
    },
}

Bug: 234772527
Test: m nothing
Change-Id: I0725028a4fdc302005d86f1e36561b98c0af623b
2022-11-24 17:51:08 +09:00
Liz Kammer
2c1d6aae37 Update sanitize to not modify user properties
Test: m nothing before/after and compare build.ninja (no diff)
Change-Id: Ia165e4beea0b34417f873247b592837a152d45cd
2022-11-22 13:14:39 -05:00
Liz Kammer
92c725994f Extend sanitize_test.go
Test: go test soong cc tests
Change-Id: I63fe74fb837e25f63074fb918a573f8b421562f1
2022-11-22 11:46:34 -05:00
Liz Kammer
fd8a49fb9d Limit propagating san config of shared to fuzzer
Prior to refactoring the sanitizers to use transition mutators, only
fuzzer sanitizer propagated configuration to shared dependencies
https://android-review.googlesource.com/c/platform/build/soong/+/2123434/9/cc/sanitize.go#b1365
However, this expanded to include TSAN in the refactoring
https://android-review.googlesource.com/c/platform/build/soong/+/2123434/9/cc/sanitize.go#1068.

Fortunately, TSAN is never enabled via Android.bp files in AOSP, so
there was no regression, but we should restore to the prevous state.

Test: go tests
Change-Id: I1a5ad8d033f7a9b4f7578393a2eac7c9362ab6f7
2022-11-22 11:46:32 -05:00
Alan Stokes
73feba3330 Allow stubs implementation to be omitted
When defining a stubs library, allow specifying that the
implementation library does not need to be installed. This allows for
cases where the implementation is deployed in some non-standard way -
e.g. inside a Microdroid virtual machine.

Without this, we get build errors like: "TARGET module
com.android.compos requires non-existent TARGET module: libvm_payload".

Default behavior is unchanged. The change is protected by an allowlist
to limit usage to the immediate use case.

Bug: 243512108
Test: builds; soong tests pass
Test: Remove allowlist, see build failure
Change-Id: Iaae75f2e93b842f5944a7518cc95069d62c5a638
2022-11-22 16:00:02 +00:00
Yabin Cui
df3168f60d Merge "Allow deprecated flags when building with LLVM_NEXT." 2022-11-18 00:40:57 +00:00
Yabin Cui
758dfa1c28 Allow deprecated flags when building with LLVM_NEXT.
-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang
is deprecated in the next compiler. So add -Wno-unused-command-line-argument
to skip it.

Bug: 253033919
Bug: 259559364
Test: run test_compiler.py
Change-Id: I9133a36700afd3ef411092fd8133a7fe1c2c7343
2022-11-17 13:00:40 -08:00
Treehugger Robot
80850d8639 Merge "Fix the ABI dump directory name for vendor libraries" 2022-11-17 04:46:25 +00:00
Sam Delmerico
d87f61ba18 Merge "export clang-tidy extraArgFlags to Bazel" 2022-11-16 14:17:43 +00:00
Elliott Hughes
9f0c951862 Remove a flag from riscv64 that was copied from arm64.
This causes us to align the text section to 4KiB, not just the data
section. From the bug that added this for arm64, there was an admission
that it costs 17MiB across the tree, and a not entirely convincing claim
of a performance improvement (undermined by the fact that "some stuff
was faster, some stuff was slower"). See http://b/150506341 for that.

Anyway, let's assume we don't want this for riscv64 for now.

Test: `mm -j` in bionic and readelf on the resulting libtest_empty.so
Change-Id: I0ed592a97ef705175191d9c66271a599af4eb18f
2022-11-15 00:56:04 +00:00