Commit graph

8782 commits

Author SHA1 Message Date
Kiyoung Kim
41a1ff1a28 Merge "Move sanitizer.libraries.txt logic into Soong" into main 2024-05-24 00:39:00 +00:00
Kiyoung Kim
0d8908c2e4 Move sanitizer.libraries.txt logic into Soong
Currently sanitizer.libraries.txt module is defined from Makefile, while
all logics to create the list of modules is implmented within the Soong.
This change moves sanitizer.libraries.txt module definition into Soong,
so it can be generated without sharing list of modules over Make
variable.

Bug: 339131599
Test: AOSP CF build succeeded, with same list of modules in
/system/etc/sanitizer.libraries.txt

Change-Id: I987684877aa8dae221a03227d784f2a8ca4f5cc4
2024-05-23 17:50:46 +09:00
kellyhung
de1b6b0f64 Fix post command of clang_verify.
Bug: 311284462
Test: go test -run TestClangVerify
Change-Id: I116c4a3e1e5734a71e1bfd503ea2268a1a5643dd
2024-05-23 02:16:26 +00:00
Treehugger Robot
1c07aaac6a Merge "Add clang_verify property for cc." into main 2024-05-21 08:00:45 +00:00
Hsin-Yi Chen
cf90c1596a Merge "Add --release and --lib-variant to the instructions to update ABI dumps" into main 2024-05-21 04:56:19 +00:00
kellyhung
d62ea30647 Add clang_verify property for cc.
This property is to support cflags "-Xclang -verify" build pass in Soong. The behaviors of clang_verify:
- append cflags "-Xclang -verify"
- append "&& touch $out" to the clang command line

Bug: 311284462
Test: go test -run TestClangVerify

Change-Id: Ic5825e2d649da4c3c5ed6da916e9804d7e3c03da
2024-05-21 11:31:48 +08:00
Yi Kong
9b9d29b845 Turn off relaxed-template-template-args as a workaround
ToT switched on "relaxed-template-template-args" by default. This does
not work with our outdated libc++. Turn it off until we have the new
libc++.

Test: build with Kokoro ToT Clang (build 2417)
Bug: 341084395
Bug: 332594828
Change-Id: I994c476c1f7b4abd81e5ae0bde4e1f9afd1aa920
2024-05-20 02:48:42 +09:00
Priyanka Advani
99d9068bfc Merge "Revert "Enable -Wfortify-source"" into main 2024-05-17 20:07:50 +00:00
Priyanka Advani
89ed157a2f Revert "Enable -Wfortify-source"
This reverts commit 4412723f63.

Reason for revert: Droidmonitor triggered revert due to build breakage in b/341339765. 

Change-Id: Id2880f6c0e38504f1adace5e4dab3fd7f6b9b792
2024-05-17 19:42:55 +00:00
Aditya Kumar
6c9f524953 Merge "Enable -Wfortify-source" into main 2024-05-17 18:58:08 +00:00
Ivan Lozano
e8fcd37775 Merge changes from topic "rust-made-to-order-staticlibs" into main
* changes:
  rust: made-to-order rust staticlibs
  rust: refactored transformSrctoCrate
2024-05-17 12:40:36 +00:00
Yi Kong
728e9178bd Merge "Revert^5 "Upgrade to clang-r522817"" into main 2024-05-17 03:06:24 +00:00
Priyanka Advani
55d4abde48 Revert^5 "Upgrade to clang-r522817"
This reverts commit 0135499554.

Reason for revert: Droidmonitor triggered revert due to b/341148479 and b/341138217. Will be verifying through ABTD before submission.

Change-Id: I22e069178dfda0b1791bd77c908afff8cb87bf26
2024-05-16 22:00:02 +00:00
Yi Kong
aac481527e Merge "Revert^4 "Upgrade to clang-r522817"" into main 2024-05-16 18:07:51 +00:00
Aditya Kumar
4412723f63 Enable -Wfortify-source
This reverts commit 9b7e07c7aa.
Workaround for the post-submit failure in b/339523786 has been merged.

Fixes: 315245071
Change-Id: I517f13334ad169429daaa68bda7d5f600f653977
2024-05-16 17:00:53 +00:00
Ivan Lozano
0a468a4f3b rust: made-to-order rust staticlibs
Whenever any two Rust static libraries are included
as static libraries anywhere in a CC dependency tree, we sometimes
get duplicate symbol errors. To avoid this, we no longer
directly link multiple rust static libs to CC modules.

Instead, we build rust_ffi_rlib modules and produce the actual
static library that gets linked against the CC module based on
that CC module's full list of Rust rlib dependencies.

This introduces a new static_rlibs property for cc modules to
define the rust_ffi_rlib dependencies, which are then used to
generate the module above.

This CL is intended to deprecate rust_ffi_static. It leaves
rust_ffi_static and rust_ffi static variants in place until
the remaining rust_ffi_static declarations and uses can be
removed. In the meantime, rust_ffi_static produces
rust_ffi_rlib variants as well to make the transition easier.

Bug: 254469782
Test: m # with no changes
Test: m libapexsupport # with static_rlibs
Test: m libunwindstack # with static_rlibs
Test: m netsimd # with static_rlibs, no duplicate symbols
Test: m blueprint_tests # New Soong tests

Change-Id: I47e27ac967ef0cad46d398ebf59d8275929ae28a
2024-05-16 13:00:43 -04:00
Hsin-Yi Chen
d5919c1636 Add --release and --lib-variant to the instructions to update ABI dumps
The ABI dumps depend on the LLNDK API level and SDK version defined
in the release configurations. The error messages shows additional
parameters for the user to select the right version and variant.

Test: make libvulkan
Bug: 323447559
Change-Id: If12f3f74be49c3036516f42fb5d91979b610fafe
2024-05-16 15:32:06 +08:00
Tomasz Wasilczyk
a910dce1a3 Merge "cc_cmake_snapshot: improve support for AIDL" into main 2024-05-15 17:43:14 +00:00
Tomasz Wasilczyk
1e831bfa87 cc_cmake_snapshot: improve support for AIDL
- link correct libbinder for AIDL modules
- fix building AIDL interfaces with non-empty AidlRoot
- don't silently drop non-existent dependencies

Bug: 302718225
Test: aosp/3081709
      atest binder_sdk_docker_test_clang
Change-Id: I181ef5a994f728f8af19134a6697b065a9aee261
2024-05-14 13:45:34 -07:00
Colin Cross
783fa37807 Merge "Add $ORIGIN to rpath for cc_test modules" into main 2024-05-13 20:59:01 +00:00
Hsin-Yi Chen
d75bc49454 Merge "Ensure opt-in platform ABI dumps are configured with ref_dump_dirs" into main 2024-05-13 03:01:44 +00:00
Tomasz Wasilczyk
d848dcc9e6 Disable cc_cmake_snapshot outside of Linux
Test: cd build/soong/cc && go test
Bug: 339782737
Change-Id: Ide6693123c741a39d37164a1a39841be1bd84862
2024-05-10 21:32:23 +00:00
Colin Cross
b881e324d2 Add $ORIGIN to rpath for cc_test modules
cc_test modules can use data_libs to put shared libraries alongside
the test.  Add $ORIGIN to rpath so they can load them as DT_NEEDED
libraries or with dlopen.

Test: treehugger
Change-Id: I4227d16ff80e70dfecb481a2de6dd15af66348bc
2024-05-10 20:27:32 +00:00
Tomasz Wasilczyk
cd8dc70806 Merge "Skip cmake_snapshot_test(s)" into main 2024-05-10 15:00:34 +00:00
Tomasz Wasilczyk
ea2fbd6787 Skip cmake_snapshot_test(s)
These tests fail on sdk-sdk_mac-trunk_staging because this feature is
not intended to run outside of Linux. Let's skip these tests for now
until we figure out how to disable snapshot feature properly.

Bug: 339782737
Test: go test
Change-Id: Ibe70a0e3dc92262c78ce9e3a8af58f2da3bfeda2
2024-05-10 14:20:15 +00:00
Justin Yun
40182b6ff3 Remove duplicated CollectDependencyAconfigFiles()
android.ModuleBase already calls aconfigUpdateAndroidBuildActions()
that is the same with CollectDependencyAconfigFiles(). Remove the
CollectDependencyAconfigFiles() to avoid duplication with
aconfigUpdateAndroidBuildActions().

To make the aconfig information available in
GenerateAndroidBuildActions() of all modules, call
aconfigUpdateAndroidBuildActions() before calling
GenerateAndroidBuildActions() of each module.

Also, we don't need SetAconfigFileMkEntries(), which is a duplicate
of aconfigUpdateAndroidMkData()

Bug: 335363964
Test: diff `adb shell printflags` before and after the change.
Change-Id: I52808e442e9fed7db1eae7b7c5ed0b1c5ba74f5d
2024-05-10 10:00:14 +09:00
Tomasz Wasilczyk
ae0d23fc18 Merge "Implement cc_cmake_snapshot" into main 2024-05-09 23:53:02 +00:00
Hao Chen
1c8ea5b6e1 Implement cc_cmake_snapshot
Bug: 302718225
Test: cd build/soong/cc && go test
Test: https://r.android.com/2803466
Change-Id: Ie7df635233ed68c40d917ea1f83f9fd4b5bfe729
2024-05-09 15:25:27 -07:00
Sam Chiu
4ba7b435e4 Merge "Revert "Enable -Wfortify-source"" into main 2024-05-09 13:27:54 +00:00
Hsin-Yi Chen
3d5c6791bc Ensure opt-in platform ABI dumps are configured with ref_dump_dirs
Test: make
Bug: 323447559
Change-Id: I8eaa38970c81c71b7473bdb9e77dfe9b49a93c92
2024-05-09 18:24:06 +08:00
Sam Chiu
9b7e07c7aa Revert "Enable -Wfortify-source"
This reverts commit a6e022c835.

Reason for revert: To verify the broken build b/339553761

Change-Id: Ib5546879effc283464a9ef66a20378960f9a56bf
2024-05-09 06:52:15 +00:00
Aditya Kumar
29e3483546 Merge "Enable -Wfortify-source" into main 2024-05-09 04:10:54 +00:00
Jiyong Park
2aff024c18 Merge "Don't install sdk variants, not platform variants" into main 2024-05-08 22:26:33 +00:00
AdityaK
a6e022c835 Enable -Wfortify-source
Fixes: 315245071
Change-Id: Ic8ca6a1c0dafea62f2bca3d20f5c86b3e3225ea0
2024-05-08 16:35:51 +00:00
Jiyong Park
acd5f590af Don't install sdk variants, not platform variants
Background: if a lib has `sdk_version` set, it is mutated into two
variants: platform and sdk. The latter is for the inclusion into
unbundled APKs which can be installed on older platforms. The former is
what is installed to the platform.

So far, for unbundled app builds, (1) the platform variant was marked as
uninstallable, (2) while the sdk variant was left installable. (1) is
causing a problem (b/339262059) when an APEX containing a filesystem
module is built as unbundled. The filesystem skips installing the
platform variant. (2) is not causing a problem, but is unnecessary
because the sdk variant is not something to be installed (on the
platform). It is built into the APK via the jni_libs property. It's not
considered an installation.

This change fixes (1) and (2). For (1), the platform variant is always
marked installable even for unbundled build. For (2), the sdk variant is
always marked non-installable.. because, again, it's not designed to be
installed to the platform.

Bug: 339262059
Test: banchan com.android.virt aosp_arm64
UNBUNDLED_BUILD_SDKS_FROM_SOURCE=true m apps_only dist
check libc++.so, libcrypto.so are in the microdroid image in the APEX.

Change-Id: I8999b724926cd9ab6d56796133e218fefcc1910b
2024-05-08 11:29:11 +09:00
Tomasz Wasilczyk
e3eb59db9f Merge "BaseCompilerProperties: add AidlInterface struct for aidl_interface info" into main 2024-05-07 19:09:50 +00:00
Cole Faust
3f01580c04 Merge "Make the enabled property configurable" into main 2024-05-07 17:49:10 +00:00
Kiyoung Kim
0d4a9ca792 Fix build error from llndk.libraries.txt
llndk.libraries.txt build fails from clang tools build, as there is no
valid target path for llndk.libraries.txt from the build. This change
skips llndk.libraries.txt build if target output path is empty.

Bug: 330100430
Test: prebuilts/clang-tools/build-prebuilts.sh passed
Change-Id: I867dc90dbf98e3d8c24b191a744686286740b230
2024-05-07 16:11:41 +09:00
Yi Kong
0135499554 Revert^4 "Upgrade to clang-r522817"
This reverts commit 33fb507271.

Change-Id: Ib29f98c8540b3cda04ae99743d34e9a81dc0e6ad
2024-05-07 04:50:16 +00:00
Hsin-Yi Chen
a27230aaf6 Merge "Disable header ABI checker for NDK" into main 2024-05-07 02:28:04 +00:00
Tomasz Wasilczyk
5b007eaa91 BaseCompilerProperties: add AidlInterface struct for aidl_interface info
This is necessary for cc_cmake_snapshot to snapshot and generate build
rules for actual source files (AIDL files) and not generated cpp
sources. Otherwise, this information is inaccessible for cc module after
aidl_interface pass.

Bug: 302718225
Test: Build aosp/2798713
Change-Id: I991e73f74d7551d21f337a7161cce55ba51fec71
2024-05-06 14:18:37 -07:00
Ivan Lozano
7e21ca0a9c Merge "rust: Support for generated c files from bindgen" into main 2024-05-06 13:00:41 +00:00
Ivan Lozano
5fea568440 Merge "cc: Remove unneeded ubsan library linkage on host" into main 2024-05-06 13:00:20 +00:00
Ivan Lozano
3b591c771a rust: Support for generated c files from bindgen
To handle static inline functions, bindgen generates a C file which is
expected to be compiled and linked into dependents on the generated
bindgen source.

This CL adds support for cc modules ingesting this output and for
bindgen to produce it (and link it against the bindgen rust_library
variant as well).

Bug: 290347127
Test: m blueprint_tests
Test: Example module with static inline functions builds locally
Change-Id: I167a8356eb6e0059fc21169fd3bfc6bf4d9c812f
2024-05-03 14:01:09 -04:00
Ivan Lozano
2a2d509a32 cc: Remove unneeded ubsan library linkage on host
The sanitizer runtime logic was rewritten in aosp/2438959 to simplify
static sanitizer library selection. However, enabling ubsan diagnostics
for host tests would result in incorrectly adding an unnecessary
libclang_rt.asan.so dependency.

This check should have been removed as well -- the library dep
determination for c.sanitize.Properties.UbsanRuntimeDep is now handled
higher up in the logic.

(Some formatting fixes are included as well)

Bug: 323237381
Test: UBSanitized Host test with diagnostics runs correctly.
Change-Id: I97bd01344b7b676fccb9f250c0f801b8bc212a1a
2024-05-03 12:20:40 -04:00
Hsin-Yi Chen
6fd2895273 Disable header ABI checker for NDK
NDK team requested not to generate the dumps by header ABI checker in
the finalization process.

Test: m out/target/product/generic_arm64/lsdump_paths.txt
Bug: 332959609
Change-Id: Ia04c6f266088968ff731c0fabbbfce26300109ae
2024-05-03 18:37:33 +08:00
Inseob Kim
364740b4a4 Merge "Merge logtags from cc modules too" into main 2024-05-03 05:10:22 +00:00
Florian Mayer
37d17209b2 Merge "Make memtag_stack a variant" into main 2024-05-03 00:20:37 +00:00
Cole Faust
a963b94cde Make the enabled property configurable
This allows using select statements with it.

Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I6f3efaaa3d82505e38a91ee4ba0e18e404360191
Merged-In: If355d24506e3f117d27b21442a6c02bca3402dc7
2024-05-02 15:41:24 -07:00
Cole Faust
dbd91b0323 Merge "cc: Remove exclude_header_libs from export_header_lib_headers" into main 2024-05-02 17:58:59 +00:00