Commit graph

8140 commits

Author SHA1 Message Date
Treehugger Robot
2976fa1185 Merge "Use a less hacky way to detect if a module is Fuzzer enabled" 2023-06-06 17:13:20 +00:00
Yu Liu
e0a7318331 Merge "Add CFI flags to Compile Action" 2023-06-05 22:47:52 +00:00
Yu Liu
89575db9c6 Merge "CFI Bp2Build" 2023-06-05 22:47:52 +00:00
Spandan Das
91a8820688 Merge changes from topics "xsd_config_bp2build_cc_rdeps", "xsd_config_bp2build_java_rdeps"
* changes:
  bp2build for cc libraries that use xsd_config as gen srcs
  bp2build for java libraries using xsd_config srcs
2023-06-05 22:23:37 +00:00
Trevor Radcliffe
f1836e4728 Add CFI flags to Compile Action
Bug: 261733820
Test: Unit Tests
Change-Id: I7c7cb8ab07da2c66df5d69e1e4af3337e3b24e6d
2023-06-05 18:09:21 +00:00
Trevor Radcliffe
27669c0c9e CFI Bp2Build
Bug: 261733820
Test: Unit Tests and manual verification
Change-Id: Ife1b33c58e3770177eab1b6168edbf7969418ad7
2023-06-05 18:08:07 +00:00
Yi Kong
ed79fa382b Use a less hacky way to detect if a module is Fuzzer enabled
Bug: 169004486
Test: presubmit
Change-Id: I7fad86041622979b9befb7c86897a13f604bdf3d
2023-06-05 14:21:48 +09:00
Yabin Cui
48fa309aa3 Merge changes from topic "clang_stable_r498229"
* changes:
  Suppress clang-tidy warnings causing build errors after clang update
  Suppress performance-avold-endl clang-tidy warning
2023-06-03 02:05:19 +00:00
Treehugger Robot
b25cbb3449 Merge "Support test runnner option in auto generated test configs" 2023-06-02 11:20:23 +00:00
Yi Kong
a00f8efaa7 Merge "Remove Full LTO support" 2023-06-01 22:46:23 +00:00
Yabin Cui
c31c2fb0b0 Suppress clang-tidy warnings causing build errors after clang update
These warnings are not critical. We can fix them later.

Bug: 285361108
Bug: 285356805
Bug: 285356799
Test: build with WITH_TIDY=1 using clang-r498229
Change-Id: I594279a10ffb4fda07dfc33350b44d09c42d3f97
2023-06-01 19:15:40 +00:00
Spandan Das
922171dbdf bp2build for cc libraries that use xsd_config as gen srcs
In Soong, cc libraries depend on source files generated from xsd_config
using generated_sources and generated_headers. In Bazel, these souces
will be wrapped in a static library. Updated bp2build so that these are
written to implementation_whole_archive_deps instead.

Bug: 211678537
Test: bp2build test in sibling CL in system/tools/xsdc
Change-Id: Ib57c563a1eb7483bd7b04ba0d3852ecac17cde6c
2023-06-01 19:12:12 +00:00
Yi Kong
0713e336d9 Remove Full LTO support
We do not have any more projects directly depending on Full LTO (except
CFI which manages their own LTO flags), remove full LTO support from the
build system.

Test: presubmit
Bug: 169004486
Change-Id: I8d6b7999d716158b5d8fe34b2f197653d7bae8dd
2023-06-01 00:10:26 +00:00
Yabin Cui
2c336fe5b5 Suppress performance-avold-endl clang-tidy warning
This is a new warning introduced in clang-r498229.

Bug: 285005947
Test: build
Change-Id: Ia66c1f2555e2654614137e950832070e4e8dd54f
2023-05-31 19:27:52 +00:00
Spandan Das
02e8a0dba1 Merge "Deprecate api bp2build of ndk_library and ndk_headers" 2023-05-31 16:01:07 +00:00
Spandan Das
230c312f83 Deprecate api bp2build of ndk_library and ndk_headers
To support export of NDK APIs in multi-tree, we added functionality to
generate Bazel targets of ndk related Soong module types. Since this use
case does not exist anymore, deprecate this to prevent bitrot

The removed code includes
- `ConvertWithApi2Build` implementation of these libraries, which
  generates the Bazel targets in the synthetic `api_bp2build` workspace
- (api) bp2build unit tests for these module types

Test: go build ./cc
Bug: 284029211
Change-Id: Id3278fa119e0ab87f31f39a3783197a81b655e43
2023-05-31 03:44:51 +00:00
Yi Kong
a7a345d55e Remove Use_clang_lld in lto
We have moved all LTO projects to LLD, this is unused.

Test: presubmit
Change-Id: I385b3302c04243be8fde80605b29df7646ec40ce
2023-05-30 15:19:06 +09:00
Dan Shi
ec7314336a Support test runnner option in auto generated test configs
Bug: 284179405
Bug: 236980335
Test: unittest
Change-Id: Ifae3d556ff79153ca6c3067347fc259b665fb2e1
2023-05-26 21:34:22 +00:00
Treehugger Robot
cd4e6a609e Merge "Sandbox inputs to aidl rule in cc" 2023-05-23 23:40:35 +00:00
Vinh Tran
095819530a Sandbox inputs to aidl rule in cc
Bug: 279960133
Test: go test
Test: Remove hdrs prop from IDropBoxManagerService_aidl && run  BUILD_BROKEN_DISABLE_BAZEL=true m libservices && Expect an error from aidl
Change-Id: Ifdb260d8e2da9a5767f1e212393de4134b210616
2023-05-23 15:53:10 -04:00
Treehugger Robot
47514686b9 Merge changes from topic "parallel-singletons"
* changes:
  Parallelize singleton execution
  android: Allow running some singletons in parallel.
2023-05-22 16:40:16 +00:00
LaMont Jones
0c10e4dcc0 Parallelize singleton execution
Bug: 281536768
Test: manual, presubmits
Change-Id: I57fdc76ba6b277e88e196b506af87127a530fd37
2023-05-19 20:31:32 +00:00
Trevor Radcliffe
197f4306d5 Merge "CFI Versionscript changes in bp2build" 2023-05-19 20:14:29 +00:00
Colin Cross
b3f28b2e04 Merge changes from topic "musl_arm64"
* changes:
  Disable sanitizers that use runtimes for linux_musl arm64
  Separate host and host cross fuzz packaging
2023-05-19 18:03:22 +00:00
Spandan Das
fcb86824be Merge "Export host available libraries to soong_injection" 2023-05-19 16:18:01 +00:00
Trevor Radcliffe
f06dd91420 CFI Versionscript changes in bp2build
Bug: 261733820
Test: Unit Tests
Change-Id: I0bf2f42944738c0fefb10e59e859d2af44402792
2023-05-19 14:51:41 +00:00
Aditya Kumar
e5dc6158d2 Merge "Enable LTO for riscv64" 2023-05-19 04:27:38 +00:00
Treehugger Robot
9e5c391c85 Merge "export WarningAllowedProjects to bazel" 2023-05-18 04:04:40 +00:00
Spandan Das
6550358a05 Export host available libraries to soong_injection
This information will be used to validate linkopts for host targets.

Test: m bp2build
Bug: 216626461
Change-Id: Ie7ac46268e6177cf0688ca0389bdaa92b67f9a58
2023-05-17 22:19:53 +00:00
Colin Cross
390fc746d0 Disable sanitizers that use runtimes for linux_musl arm64
We don't built clang sanitizer runtimes for host arm64 yet,
disable sanitizer that need them when building for linux_musl arm64.

Test: builds
Change-Id: Id4fcb7f9743ac30121157b2294eb60216eaff7b3
2023-05-17 21:59:32 +00:00
Colin Cross
64a4a5f5cd Separate host and host cross fuzz packaging
Prevent collisions between host and host cross fuzz packaging when
both are supported as fuzz targets by using a different value for
hostOrTargetString.

Test: builds with HOST_CROSS_OS := linux_musl
Change-Id: I0e82bab2987899cece94c89eb8398d1733ebbd15
2023-05-17 21:59:27 +00:00
Aditya Kumar
efc36678a9 Enable LTO for riscv64
This partially reverts commit 1281b99495.

Bug: b/282584808, b/254713216

Reason for revert: LTO can be enabled as emultated tls is now globally disabled https://android-review.git.corp.google.com/c/platform/build/soong/+/2431153

Change-Id: I66c83b1116550179043490a11f66b8630c0e6b1b
2023-05-17 17:18:06 +00:00
Treehugger Robot
3daa129afa Merge changes from topic "adbd_host"
* changes:
  Allowlist python dependency of adb targets
  bp2build support for host_ldlibs
2023-05-17 05:23:21 +00:00
Pirama Arumuga Nainar
7e80f945d3 Merge "[cc] Remove deprecated clang flag for auto-var-init" 2023-05-17 04:17:04 +00:00
Spandan Das
fb04c41299 bp2build support for host_ldlibs
host_ldlibs are used during linking. Set these in `linkopts` for now.

Note that this CL does not do the `CheckBadHostLdLibs` validation of
Soong. There are some different ways to do this, and these are being
discussed in b/216626461. It is likely that we will need to create a new
property `host_ldlibs` to do the validation. But for now, re-use
`linkopts`.

Bug: 216626461
Test: bp2build unit tests
Change-Id: Id4c77e4460fb1fb003fa58ea27bab5b50ea8cefe
2023-05-16 22:44:37 +00:00
Vinh Tran
e684294fb2 Pass includes attrs to cc_aidl_library
https://source.android.com/docs/core/architecture/aidl/aidl-backends#custom-parcelables

Some aidl files have custom parcelables with references to cpp headers. Hence, we need to pass the include dirs from cc libs to cc_aidl_library so that custom cpp headers are findable by the generated cpp/h files.

Test: go test
Bug: 278704136
Change-Id: I4ede1d23fbc04bdbfb69823d955c6df6b0a7b4ee
2023-05-16 16:08:15 -04:00
Trevor Radcliffe
735013943a Merge "Change bp2build to reflect arm_isa refactor" 2023-05-16 19:41:08 +00:00
Vinh Tran
5e7011bc14 Merge "Use aidl_library in cc libraries" 2023-05-16 14:44:54 +00:00
Aditya Kumar
34296538c0 Merge "Disable LTO and CFI for riscv64" 2023-05-16 14:28:57 +00:00
Aditya Kumar
1281b99495 Disable LTO and CFI for riscv64
This reverts commit 24870216e9.

Reason for revert: b/282584808

Change-Id: I3808121b4437fdd01db5d305d8f0377e6ad7bd9e
2023-05-16 03:55:41 +00:00
Spandan Das
29c8ad3821 Merge "bp2build converter for cc libraries containing yacc" 2023-05-16 02:48:53 +00:00
Vinh Tran
367d89da78 Use aidl_library in cc libraries
Introduce aidl.libs prop on cc libraries to pass in aidl_library. The goal is to eventually disallow aidl.include_dirs (a pattern for passing aidl headers dir for aidl compilation) and enforce aidl headers to be explicitly specified in Android.bp.

Bug: 278704136
Test: go test
Change-Id: Ia78bc11dfa12f47d2d1bb90dc65372ddb17f7e14
2023-05-15 17:09:22 -04:00
Colin Cross
9801f9d7f7 Merge "Fix addrsig warnings" 2023-05-15 19:07:58 +00:00
Trevor Radcliffe
5f0c2ac535 Change bp2build to reflect arm_isa refactor
We now rely on a `with_features` clause to effectively disable
thumb when `arm_isa_arm` is enabled. Thus, we no longer need to
add `-arm_isa_thumb` in bp2build.

Bug: 261733820
Test: Unit tests
Change-Id: I9da85834855b297a75097ce3a11e101f55bd53f4
2023-05-15 18:00:59 +00:00
Aditya Kumar
7699d15864 Merge "Revert "Disable LTO and CFI for riscv64"" 2023-05-12 23:25:19 +00:00
Aditya Kumar
24870216e9 Revert "Disable LTO and CFI for riscv64"
This reverts commit ecf4e664e0.

Reason for revert: Not needed as emultated tls is now globally disabled https://android-review.git.corp.google.com/c/platform/build/soong/+/2431153

Change-Id: Idc3de2771afbbe2d5976f3c7974b3ffd15441b13
2023-05-12 18:46:42 +00:00
Yi Kong
e9850f8153 Revert "Turn off stack protector check for noreturn calls"
clang-r487747c contains upstream fix for the excessive stack protactor
checks (fc4494dffa54) and checks are no longer inserted for C only code
or C++ code built without exeception. The Android platform does not
enable C++ exception by default, thus turning on the check should not
have significant performance impact.

This reverts commit ecc18df6ff.

Test: presubmit
Bug: 277565884
Bug: 279955553

Change-Id: I2fc5826048ba5d00cabcc8401ac40a6f54812a44
2023-05-12 12:24:22 +01:00
Treehugger Robot
f8fbff1671 Merge "Drop redundant libraries from baseline apexAvailable map" 2023-05-12 06:04:23 +00:00
Yi Kong
db381aa7d9 Merge "Update clang version to clang-r487747c" 2023-05-11 14:50:01 +00:00
Spandan Das
df4c2134ea bp2build converter for cc libraries containing yacc
For cc_libraries containing .y/.yy srcs, we will generate an additional
cc_yacc_static_library target. This target will produce an .a file that
will be statically linked to the parent target.

Test: go test ./bp2build
Bug: 281546029
Change-Id: I094ba56f0a95869e5bc1e1d38b83c777192b7ddd
2023-05-11 01:11:56 +00:00