Commit Graph

8954 Commits

Author SHA1 Message Date
Cole Faust
5b1a39a92a Merge "Make the WholeStatic/Static/Shared libs properties configurable" into main 2024-08-19 22:48:16 +00:00
Cole Faust
f0006e7137 Make the WholeStatic/Static/Shared libs properties configurable
So that you can use selects with them.

Bug: 342006386
Bug: 358377461
Test: m nothing --no-skip-soong-tests
Change-Id: I5a8350f670d51b7da411ad5c3cdbf5f2d6cdd63b
2024-08-19 14:39:19 -07:00
Yu Liu
d46e5ae670 Remove more internal fields from ModuleBase.
Bug: 358425833
Test: Manual compare the generated ninja and mk files and CI.
Change-Id: I4edd0dc646ac035594f47cd9044cc4eb5f710e64
2024-08-16 00:20:27 +00:00
Yu Liu
e89b6dd497 Merge "Remove installFiles from ModuleBase." into main 2024-08-15 17:23:59 +00:00
Yu Liu
ddc2833b7f Remove installFiles from ModuleBase.
This is to limit the direct accesses to the internal fields of a
module in order to better support incremental caching. To access
the install files data from singleton context or other modules'
context use providers thru the provided wrapper; to access it
from the same module inside GenerateBuildActions use ctx which is
short-lived only inside this method.

Bug: 358425833
Test: CI
Change-Id: I337b07a2ef95fb2a898ac2f9277160a3f76a603c
2024-08-14 22:56:30 +00:00
Dan Albert
61bd3d11e9 Merge "Revert^2 "Verify that ndk_headers headers are valid C."" into main 2024-08-14 22:25:10 +00:00
Treehugger Robot
67e25d144a Merge "Always generate PDB for Windows executable" into main 2024-08-14 21:26:48 +00:00
Fabien Sanglard
aa8020ac13 Always generate PDB for Windows executable
Test: NA
Bug: 350154912
Change-Id: I0a4ebfb62643eb2c8d2b20992e728bcb8b5219a9
2024-08-14 13:31:55 -07:00
Dan Albert
266f991cc5 Revert^2 "Verify that ndk_headers headers are valid C."
181934cc26

Change-Id: I7720331ee8132ead8d0b5624a0b99841884300d3
2024-08-13 22:01:23 +00:00
Yu Liu
246b43049c Merge "Merge SingletonProviderContext with OtherModuleProviderContext" into main 2024-08-13 15:56:16 +00:00
Yi Kong
c128a6808e Merge "Remove workaround for old libc++" into main 2024-08-13 02:07:31 +00:00
Treehugger Robot
aa65374cc1 Merge "Make the srcs and exclude_srcs properties configurable" into main 2024-08-13 01:20:23 +00:00
Yu Liu
663e4508dc Merge SingletonProviderContext with OtherModuleProviderContext
Bug: 358425833
Test: CI
Change-Id: I8e3f40dc3cfc5337008b419801f8e6bf2d48e8b2
2024-08-12 22:50:19 +00:00
Cole Faust
96a692bfa9 Make the srcs and exclude_srcs properties configurable
Bug: 358377461
Bug: 342006386
Test: Presubmits
Change-Id: I21c20254a3ad3e75dd401ab807eb57ddbbeac047
2024-08-12 15:27:02 -07:00
Yi Kong
703c2e3d64 Merge "Bump pessimizing-move from -Wno to -Wno-error" into main 2024-08-12 18:31:42 +00:00
Yi Kong
f4801135a6 Remove workaround for old libc++
We now have a modern libc++, and no longer needs to explicitly turn off
deprecated-dynamic-exception-spec warning for it.

Test: presubmit
Change-Id: Ie282b32ed9ac2b0246fd8245f4c5d29526cbda76
2024-08-12 23:53:30 +08:00
Yi Kong
fd50d175ad Bump pessimizing-move from -Wno to -Wno-error
This is a useful warning that can point out lower performance code.

https://r.android.com/q/hashtag:pessimizing-move-cleanup cleaned up many
cases. Let's bump this up to a non-error warning while we fix up the
remaining cases.

The warning remains off for all external code.

Test: presubmit
Bug: 154270751
Change-Id: If6b69cbaa1384e81336b6842607a587bf6c7f38b
2024-08-12 17:51:38 +08:00
Colin Cross
a66b4630f6 Add PrepareForTestWithBuildFlag
Add a helper function that creates a test fixture preparer that
sets a build flag, and use it everywhere that was setting build flags
manually.

Test: all soong tests
Flag: EXEMPT refactor
Change-Id: I68d50d68787a30d091f0827e8caa51f5c5a762ef
2024-08-09 16:47:45 -07:00
Dan Albert
fbe5780312 Disable ABI tracking for bionic.
This is being done with a path-based filter rather than as a property
of ndk_library because there would be no way to prevent people from
disabling ABI tracking without API council review if it were a
property, since there's no per-module OWNERS.

Bug: http://b/358653811
Test: m ndk
Change-Id: If6af638accc917294eee18cb08551c5df25462ad
2024-08-09 21:16:56 +00:00
Yi Kong
2e2d753760 Move -Wno-error=format from external NoOverride to external flags
Test: presubmit
Bug: 315250603
Change-Id: Ib1ed2aed52818e177c1b40da17e192606308243a
2024-08-09 14:56:58 +09:00
Priyanka Advani (xWF)
d882a0c92d Merge "Revert "Verify that ndk_headers headers are valid C."" into main 2024-08-08 23:29:41 +00:00
Priyanka Advani (xWF)
181934cc26 Revert "Verify that ndk_headers headers are valid C."
Revert submission 3207854-ensure-c-ndk-headers

Reason for revert: Droidmonitor created revert due to b/358445530.

Reverted changes: /q/submissionid:3207854-ensure-c-ndk-headers

Change-Id: I649941a4d063d76a1c6a8e58fb885da2c44331c0
2024-08-08 22:49:18 +00:00
Treehugger Robot
894a93840d Merge "Verify that ndk_headers headers are valid C." into main 2024-08-08 21:37:29 +00:00
Yi Kong
9b94da79cd Re-enable -Wformat warning
Change-Id: I9af8606a1e782dfb809d7f4df7b043d53ea7ba9f
Test: presubmit
Bug: 315250603
2024-08-08 15:12:42 +09:00
Dan Albert
a866829885 Verify that ndk_headers headers are valid C.
https://github.com/android/ndk/issues/1920 recently reported a handful
of NDK headers where C-incompatible syntax had slipped in which wasn't
caught by review. This is also something that we often manually catch
in API review, but the manual inspection is, as can be seen from that
bug, error prone.

This check is pretty stupid. I've tried on other occasions to do a
more thorough check that would build each header using the same flags
as cc_library or similar would, but was never able to get that
working. This isn't as thorough, but that's maybe not such a bad
thing, since it saves on build time to only check on variant. In
practice the rudimentary approach I've taken here would have caught
every instance reported in the bug above, and probably all the other
cases that we'd previously caught in API review as well, so it's
definitely a step in the right direction if not good enough forever.

Bug: http://b/113359184
Test: m ndk
Change-Id: Id4e8cc511413acc61c4f625f25c3004d7439263c
2024-08-06 00:10:17 +00:00
Yi Kong
3d9bed9204 Do not enable AFDO for coverage builds
This works around an incompatibility between coverage and the
-fdebug-info-for-profiling flag.

also moved -fdebug-info-for-profiling flag so that it is only applied to
the libraries that enabled AFDO.

Test: gzip -cd out/verbose.log.gz | grep debug-info-for-profiling
Bug: 345593672
Change-Id: I68493511da1e61091209d0ed1b2c86c7ba0e21f4
2024-08-05 07:07:09 +00:00
Inseob Kim
af2994ccb6 Remove HWADDRESS_SANITIZER_GLOBAL_OPTIONS
It doesn't need to be a Makefile variable exported from Soong as it's
hard-coded.

Bug: 353429422
Test: boot shiba with SANITIZE_TARGET=hwaddress
Change-Id: I4a98eaaf1002aa7aba5d5131ff251bdcbdd2e0ef
2024-08-01 10:30:02 +09:00
Zijun
09fdda5b3b Turn on relaxed-template-template-args as a workaround
Update compiler to r536225 and the error: argument '-fno-relaxed-template-template-args' is deprecated arises.

Bug: b/341084395
Test: presubmit
Change-Id: If714f96e4537b5f8d695cd7c0d1cd0a8ddcbb96e
2024-07-31 05:12:41 +00:00
Yu Liu
8975548e9c Merge "Only add darwin specific rules/variables when building on mac." into main 2024-07-30 22:18:01 +00:00
Ryan Prichard
d49f0868c3 Merge "Revert "Revert "Switch NDK libc++ from prebuilts/ndk to prebuilt..."" into main 2024-07-30 21:42:23 +00:00
Yu Liu
2c0327695c Only add darwin specific rules/variables when building on mac.
To support skipping ninja file writing during incremental build, we
add all the global rules/variable/pools from static sources because
when we restore from cache we don't have the build defs available to
build the globals. This means all the global rules and variables are
added blindly, so we need to exclude these darwin specific ones since
they will fail due to they depends on the tool that only exists on MAC.

Bug: 335718784
Test: local tests and CI
Change-Id: Ife835545f0f76ffaec77e48bdd89ab7384a1b995
2024-07-30 18:22:43 +00:00
Ryan Prichard
2a69eb6573 Revert "Revert "Switch NDK libc++ from prebuilts/ndk to prebuilt..."
Revert submission 3198506-revert-3195358-ndk-libcxx-UOZAIZERUU

Reason for revert: reland topic

Reverted changes: /q/submissionid:3198506-revert-3195358-ndk-libcxx-UOZAIZERUU

Bug: http://b/332594828
Test: treehugger
Change-Id: I9c11fd697cd35bdd1d6b679cb2e2fff239de272c
2024-07-30 02:07:15 +00:00
Liana Kazanova
8effb623fd Merge "Revert "Switch NDK libc++ from prebuilts/ndk to prebuilts/clang"" into main 2024-07-29 23:05:00 +00:00
Liana Kazanova
08d5d260db Revert "Switch NDK libc++ from prebuilts/ndk to prebuilts/clang"
Revert submission 3195358-ndk-libcxx

Reason for revert: Droidmonitor created revert due to b/356220894. Will be verifying through ABTD before submission.

Reverted changes: /q/submissionid:3195358-ndk-libcxx

Change-Id: Ic9cd3d30637d5ac187d3fc80b34d45083f37064e
2024-07-29 22:58:39 +00:00
Ryan Prichard
02d80236a3 Merge "Switch NDK libc++ from prebuilts/ndk to prebuilts/clang" into main 2024-07-29 20:46:39 +00:00
Treehugger Robot
2487d8daf4 Merge "cc: Enable select syntax for cppflags" into main 2024-07-29 19:11:46 +00:00
Aleks Todorov
0384c97337 cc: Enable select syntax for cppflags
Bug: 325444956
Test: m
Test: m [custom build target with select in cppflags]
Change-Id: I7d27096526ce5b37afe447f900613a6fbb639986
2024-07-26 17:20:23 +01:00
Andrea Marchini
49ce87ef75 Soong cc proto fix for grpc plugin
- Update output file names when using grpc plugin (grpc.pb instead of pb)

Change-Id: I702553713d1a667f90a5502291bd15b7cedd7eb7
Signed-off-by: Andrea Marchini <amarchini@google.com>
2024-07-26 06:00:30 +00:00
Ryan Prichard
5228aebbde Switch NDK libc++ from prebuilts/ndk to prebuilts/clang
Remove old NDK libc++ Soong modules, and use libunwind instead of
ndk_libunwind.

Bug: http://b/332594828
Test: m nothing --no-skip-soong-tests
Test: m blueprint_tests
Change-Id: I6763a4dbba660240e47a4a2eb179382c0a0a9840
2024-07-25 18:31:23 -07:00
Spandan Das
02be101893 Allow C symbol file to be arch variant
The libclang_rt.* prebuilt libraries have an autogenerated map.txt for
each arch. e.g.
```
$ ls prebuilts/clang/host/linux-x86/clang-r530567/lib/clang/19/lib/linux/libclang_rt.asan*map.txt
prebuilts/clang/host/linux-x86/clang-r530567/lib/clang/19/lib/linux/libclang_rt.asan-aarch64-android.map.txt  prebuilts/clang/host/linux-x86/clang-r530567/lib/clang/19/lib/linux/libclang_rt.asan-riscv64-android.map.txt
prebuilts/clang/host/linux-x86/clang-r530567/lib/clang/19/lib/linux/libclang_rt.asan-arm-android.map.txt      prebuilts/clang/host/linux-x86/clang-r530567/lib/clang/19/lib/linux/libclang_rt.asan-x86_64-android.map.txt
prebuilts/clang/host/linux-x86/clang-r530567/lib/clang/19/lib/linux/libclang_rt.asan-i686-android.map.txt
```

These map.txt files are currently a noop, but will be used to compile
stub srcs. In preparation for that, make stubs.symbol_file and
llndk.symbol_file arch variant

Test: m nothing # no diff in ninja file
Bug: 220898484
Change-Id: I7316546905c1327c764ee67a48c77a2a68465d77
2024-07-24 01:21:53 +00:00
Spandan Das
1f22939d81 Ingore CC prebuilts from cmake snapshots
The cmake snapshot scripts currently looks at the `cc.Module.compiler`
property to determine whether a cc_* module is a prebuilt. As part of
b/275273834. some cc_* prebuilt modules which provide APIs will have a
non-nil `compiler` to convert the API .txt file to stub .c files.

This CL updates the cmake generation script to ignore prebuilts using
the `IsPrebuilt` function rather than `cc.Module.compiler`

Bug: 275273834
Test: m nothing --no-skip-soong-tests
Change-Id: Id8ba22b1c5ad13fb31e75a407a25e97a8040d0b1
2024-07-23 22:36:10 +00:00
Spandan Das
e20c56cdf0 Add C symbol file to module sdk snapshot
cc_prebuilt_library_shared does not currently support generating stubs
from API symbol_files, and therefore the symbol file was removed from
the module sdk snapshots in https://ag.corp.google.com/11394495

As part of b/275273834, the stubs will be generated from the API files
for cc_prebuilt_library_shared, so add the symbol file back to the
module sdk

Bug: 275273834
Test: m nothing --no-skip-soong-tests
Test: m art-module-sdk and verified the map.txt is copied to the zip
next to the Android.bp file

Change-Id: I9551e7b8a76ceb9db3ed0434d315b6839f5e3d54
2024-07-23 22:18:00 +00:00
Spandan Das
2f68f1903a Drop module sdk MakeUninstallable special case
Platform variants of module sdk libraries were marked as uninstallable
originally in https://r.android.com/1974259. This special case is no
longer necesssary - android.MutateApexTransition will call
MakeUninstallable on the platform variant on both the source and
prebuilt soong modules when the following conditions are met
- //apex_available:platform is not listed in apex_available (explicitly
  or via the default implicit)
- the soong module is included in an apex that exists in the tree
  (listed in native_shared_libs)

Since MakeUninstallable is set by apex specific mutators, the relevant
unit test has been moved to the apex package. The Android.bp of the test
has also been extended with an apex that includes the shared library.

Test: m nothing --no-skip-soong-tests
Test: no diff in out/soong/Android-$product.mk
Test: added prebuilt_libdexfile to art's apex_contributions locally, no
diff in out/soong/Android-$product.mk

Bug: 220898484
Change-Id: I43a324882d486451bb921028853508d7ec3d76bf
2024-07-22 23:13:20 +00:00
Colin Cross
ea1b3b78b8 Merge changes from topic "elide_empty_variants" into main
* changes:
  Convert sdk mutator to TransitionMutator
  Convert link mutator to TransitionMutator
  Convert version mutator to TransitionMutator
  Convert python_version mutator to TransitionMutator
  Convert rust_libraries and rust_stdlinkage mutators to TransitionMutators
2024-07-18 17:37:38 +00:00
Colin Cross
ac57a6c6df Convert sdk mutator to TransitionMutator
Replace cc.sdkMutator with a TransitionMutator.

Bug: 319288033
Flag: EXEMPT refactor
Test: all soong tests pass
Change-Id: If9034ff73e02f1e6ee08bc3afc9a0576e0641651
2024-07-17 15:50:36 -07:00
Colin Cross
767819fede Convert link mutator to TransitionMutator
Replace cc.linkageMutator with a TransitionMutator.

Bug: 319288033
Flag: EXEMPT refactor
Test: all soong tests pass
Change-Id: I776515ab58a35c4a0a8e06cb9d0a256f8fb2ac5e
2024-07-17 15:50:36 -07:00
Colin Cross
add04a8c94 Convert version mutator to TransitionMutator
Replace cc.versionMutator with a TransitionMutator.

Bug: 319288033
Flag: EXEMPT refactor
Test: all soong tests pass
Change-Id: Idfd4157115d6f03997a339b43b3da9c2dfe2418d
2024-07-17 15:50:36 -07:00
Sean Hua
cd5c7d757a Merge "Use default fallback when generating cc deps" into main 2024-07-17 22:44:19 +00:00
Yabin Cui
96fbf8ba93 Merge "Reapply "Upgrade to clang-r530567"" into main 2024-07-17 16:13:19 +00:00
Treehugger Robot
6485cf11dc Merge "Add libdexfiled to the stub library multi APEX exception list." into main 2024-07-17 13:35:50 +00:00