Commit graph

8758 commits

Author SHA1 Message Date
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
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
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
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
Kiyoung Kim
3a7caee04b Merge "Move LLNDK related logic to llndk_library" into main 2024-05-02 00:46:11 +00:00
Abhishek Gadewar
41cbccc88d cc: Remove exclude_header_libs from export_header_lib_headers
This was already done for target.recovery, but was forgotten for
target.vendor and target.product.

Test: add exclude_header_libs to a target with export_header_lib_headers and build successfully

Tags:
Change-Id: Ib206f54b2176830e32af33b9b093b71d4f1351ac
Signed-off-by: Abhishek Gadewar <abhishekgadewar@meta.com>
2024-05-01 11:36:27 -07:00
Treehugger Robot
08f670ab4a Merge "soong: Use the CpExecutable rule for copying libraries" into main 2024-05-01 18:20:41 +00:00
Florian Mayer
39b536260a Merge "Pass -mllvm flags for memtag-stack correctly to linker" into main 2024-05-01 17:29:31 +00:00
Florian Mayer
99addb1802 remove hwasan-use-after-scope=1 which is default now
This is part of Android LLVM toolchain:

https://cs.android.com/android/platform/superproject/main/+/main:prebuilts/clang/host/linux-x86/clang-r510928/BUILD_INFO;l=79

477610d4d0/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp (135)

Change-Id: I2812fac89584a8324126d15525b6ee78f5494a50
2024-05-01 00:56:22 +00:00
Florian Mayer
ab97e28bf6 Pass -mllvm flags for memtag-stack correctly to linker
Bug: 309446520
Change-Id: I08519db0323a754c66acaa0ace5c41d962809ac6
2024-05-01 00:36:06 +00:00
Florian Mayer
5ccc4218d5 Make memtag_stack a variant
Otherwise we cannot disable memtag_stack on first stage init, because it
statically links in a lot of libraries.

This was benign, but if we want to add a stack history buffer, we do not
want to emit these instructions for first stage init.

Bug: 309446520
Change-Id: Ifbdcbe5ba06eb46970bc1e9b64a26c1ca59ba5f2
2024-04-30 10:53:33 -07:00
Kiyoung Kim
973cb6f555 Move LLNDK related logic to llndk_library
Currently VNDK contains some logic for LLNDK libraries as they are
treated in a similar way with VNDK. However, those logics should stay from
VNDK deprecation. To keep the logic, this change moves LLNDK related
logic into llndk_library.

Bug: 330100430
Test: Soong tests passed
Test: llndk.libraries.txt did not change from CF build
Change-Id: I1d02a3c2a398f1b1060b4f2bdd23af32310503bb
2024-04-30 13:05:19 +09:00
Inseob Kim
37e0bb0db4 Merge logtags from cc modules too
Merged logtags files will be used for Soong built filesystem images.

Bug: 336189540
Test: m out/soong/.intermediates/all-event-log-tags.txt
Test: m out/target/common/obj/all-event-log-tags.txt
Change-Id: Ib590c2bc8073e9acee6b45ef08092768237cf9d3
2024-04-29 17:40:40 +09:00
Hsin-Yi Chen
f6fc525a1a Let header-abi-linker filter llndk, apex, and systemapi symbols
This commit adds --include-symbol-tag and --symbol-tag-policy to
header-abi-linker commands. The arguments make header-abi-linker load
the symbols tagged with llndk/apex/systemapi from the version script.
It filters the function declarations by the symbols. The output dumps
will not contain unfinalized ABI.

Test: make findlsdumps
Bug: 333532038
Change-Id: I28234a3749f389b8a5a09ac84341b1fcd1ee88a6
2024-04-25 23:11:49 +08:00
Hsin-Yi Chen
473b3557f1 Merge "Split APEX ABI dumps from implementation ABI dumps" into main 2024-04-25 14:58:20 +00:00
Hsin-Yi Chen
98da02128c Split APEX ABI dumps from implementation ABI dumps
This commit adds a rule that builds APEX ABI dumps separately from the
implementation libraries' ABI dumps. The rule takes the
export_include_dirs and the symbol_file of the stubs as parameters.
The dump paths are tagged with "APEX" in lsdump_paths.txt. The script
updating the prebuilt reference dumps can differentiate the APEX dumps
from the opt-in dumps tagged with "PLATFORM".

This commit also adds an ABI diff rule. Soong compares the APEX ABI
dumps with the reference dumps in version 35. It compares the
implementation dumps with the reference dumps in old versions.

Bug: 333532038
Test: make
Change-Id: I76902a8e3b7d0e96a5ad756f493924371cd7ad3c
2024-04-25 17:57:29 +08:00
Spandan Das
79cd6899c7 Remove cc_api_library related code from sdkMutator
This module type was used for multi-tree, which has since been
deprioritized.

Test: go test ./cc
Change-Id: If661aa1215022301cfa10cbe2cec4565faf89c14
2024-04-23 23:52:15 +00:00
Yi Kong
33fb507271 Revert^3 "Upgrade to clang-r522817"
This reverts commit 7a4012586b.

Still more build breakages...

Change-Id: I2081d68e37bf260da78c651bb8fb9ae0d05b4c37
2024-04-22 23:04:07 +00:00
Yi Kong
7a4012586b Revert^2 "Upgrade to clang-r522817"
This reverts commit 321dd23b34.

Breakage is fixed by https://r.android.com/3051002.

Change-Id: I70925c7aa01fb78ec701971ee97192993aef0edd
Test: abtd
Bug: 322868540
2024-04-22 07:22:02 +00:00
Phenix Chen
321dd23b34 Revert "Upgrade to clang-r522817"
This reverts commit dccbef36a4.

Reason for revert: Potential culprit for b/335755564

Change-Id: I3fd02f2b08ad94a4e022cbebcd96afc2fab2e1d8
2024-04-19 05:30:10 +00:00
Yi Kong
dccbef36a4 Upgrade to clang-r522817
Bug: 322868540
Change-Id: Ia75c1e71574b0c0dfc11d5d4e9d06cf855f28c36
2024-04-18 14:11:37 +09:00
Ronald Braunstein
6a08d4915a Add test-only for test-per-src cc modules
When testing test-only validations, I noticed that some cc_test modules
where not reporting that they were test-only.

This happened because test-per-src variations were short-circuiting
writing out the provider.

The `all_teams` target is using the first variation for a module, but
it possibly should see if any variation is test-only.
For now, just making this fix to cc.

Test: m all_teams  && gqui from  "flatten(out/soong/ownership/all_teams.pb, teams)" proto build/soong/android/team_proto/team.proto:AllTeams ' where teams.kind = "cc_test" and teams.target_name="libnativebridge-tests"'
Test: go test ./cc
Change-Id: I6d44a521f5f2457527049399509d979559d7dc17
2024-04-15 23:21:23 +00:00
Hsin-Yi Chen
c0df1afc07 Merge "Pass system include dirs to header ABI checker" into main 2024-04-15 05:34:44 +00:00
Treehugger Robot
9a7898d800 Merge "Allow override of -Wno-error=format" into main 2024-04-12 23:43:06 +00:00
Juan Yescas
fc5cdcbdf5 Include __BIONIC_NO_PAGE_SIZE_MACRO flag to avoid breaking libraries
The __BIONIC_NO_PAGE_SIZE_MACRO flag has to be passed to
the build system because there are C/C++ libraries using
__BIONIC_NO_PAGE_SIZE_MACRO to decide whether to use getpagesize()
or PAGE_SIZE macro.

Bug: 333973679
Test: Build manually
Change-Id: Ie5d71f4b2b256ab8f429ed4724b8d249b364d5da
2024-04-12 07:06:12 +00:00
Ronald Braunstein
a115e2615b Add "test-only" flag for cc modules
As part of aosp/3022586 where we added the idea of "test-only" modules
and top_level_test_targets, this CL implements that for cc_ modules.

We let users set "test-only" on cc_library, but not on other modules
where the module kind is implicitly test-only, like cc_test.
Here the implementation, not the user decides it is test-only.

% gqui from  "flatten(~/aosp-main-with-phones/out/soong/ownership/all_teams.pb, teams)" proto team.proto:AllTeams 'select teams.kind, count(*) where teams.top_level_target = true group by teams.kind'                    aosp_shiba[6:15:47]/0
+--------------+----------+
|  teams.kind  | count(*) |
+--------------+----------+
| art_cc_test  |       56 |
| cc_benchmark |       68 |
| cc_fuzz      |      515 |
| cc_test      |     3518 |
| cc_test_host |        6 |
+--------------+----------+

 % gqui from  "flatten(~/aosp-main-with-phones/out/soong/ownership/all_teams.pb, teams)" proto team.proto:AllTeams 'select teams.kind, count(*) where teams.test_only = true group by teams.kind'                           aosp_shiba[6:16:26]/0
+--------------------------+----------+
|        teams.kind        | count(*) |
+--------------------------+----------+
| art_cc_test              |       56 |
| art_cc_test_library      |       13 |
| cc_benchmark             |       68 |
| cc_fuzz                  |      515 |
| cc_test                  |     3518 |
| cc_test_host             |        6 |
| cc_test_library          |      484 |
+--------------------------+----------+

Bug: b/327280661

Test: m nothing --no-skip-soong-tests
Test: go test ./cc
Test: m all_teams
Change-Id: I344436c424a9dfbdcf27e10f42f5cebc3d2b1261
2024-04-12 02:15:05 +00:00
David Duarte
eefabc8a67 Allow override of -Wno-error=format
Move -Wno-error=format from noOverrideGlobalCflags to
commonGlobalCflags so that projects can re-enable it with
"-Werror=format"

Bug: 315250603
Test: Add -Werror=format to bluetooth_cflags
Change-Id: I677cee5373c670c1a3b0eceeea1b7c35d28a17c2
2024-04-10 23:15:08 +00:00
Steven Moreland
8d1b2db53f Merge "Use __BIONIC_DEPRECATED_PAGE_SIZE_MACRO." into main 2024-04-10 20:57:45 +00:00