Commit Graph

8934 Commits

Author SHA1 Message Date
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
Sean Hua
e783ed59a5 Use default fallback when generating cc deps
The current logic enforces a device arch match and omits a module
altogether if none is found. To collect a more comprehensive list
of cc deps for IDE (ASfP) project setup, we introduce a fallback
that defaults to an arbitrary (first-processed) variant.

Bug: 322369312
Test: refreshmod
Change-Id: Ic5e1fd39e569735ff90b5c71ab1395632cca9af7
2024-07-16 23:28:14 +00:00
Yabin Cui
8c69b7852b Reapply "Upgrade to clang-r530567"
Reapply after fixing existing build and test failures.
This reverts commit 8e2c5c22be.

Bug: 342023558
Test: presubmit
Change-Id: I4d36bab7015f401e7580c6287b7f94ffa25c74fc
2024-07-16 16:15:26 -07:00
Priyanka Advani
45d61d8b11 Merge "Revert "Switch host native tests to -Og"" into main 2024-07-15 23:06:52 +00:00
Liana Kazanova
b88279f3b8 Revert "Switch host native tests to -Og"
Revert submission 2695387-host-tests-Og

Reason for revert: Droidmonitor triggered revert due to build breakage in b/353353713. Will be verifying through ABTD before submission.


Reverted changes: /q/submissionid:2695387-host-tests-Og

Change-Id: Ia8c75f9476f52dfce959c424bdf6b483bdf95c9f
2024-07-15 23:04:09 +00:00
Treehugger Robot
9408e95521 Merge "Fix asan build for Macos" into main 2024-07-15 22:24:54 +00:00
Fabien Sanglard
4eea1b8e92 Fix asan build for Macos
Test: Continuous build once aosp/3169208 is merged again
Fixes: 349869396
Fixes: 349870640
Change-Id: I1d000aac10ce9842a1cd1c6d9eda0e02874f4d8a
2024-07-15 13:19:43 -07:00
Yi Kong
b3769fcd23 Merge "Switch host native tests to -Og" into main 2024-07-15 08:11:55 +00:00
Martin Stjernholm
7559803b12 Add libdexfiled to the stub library multi APEX exception list.
We need to add stubs to it to produce a correct linker config for the
ART debug APEX in eng builds.

We should be able to clean up all the ART exceptions when the debug
APEX is removed. Add a TODO reference to the ticket tracking that.

Test: See the other CL in the topic.
Bug: 349767294
Change-Id: Ida7ea96ccc3e29c2899d5ec12c4e8c8ae983a355
2024-07-12 19:33:43 +01:00
Colin Cross
e1a8555581 Add IsAddingDependency to IncomingTransitionContext
Add an IsAddingDependency method to IncomingTransitionContext that
returns true if IncomingTransition is called after the transition
has already won while adding a new dependency.  This will be used
as part of the transition mutators to support an apex use case where
incoming dependencies during the initial apex mutator need to be
rewritten onto the platform variant for modules that don't support
the apex, but a later call to OtherModuleDependencyVariantExists
must not rewrite the requested apex variation onto the platform
variant.

This should be used sparingly, all uses will have to be removed in
order to support creating variants on demand.

Bug: 319288033
Test: TestIsAddingDependency
Flag: EXEMPT refactor
Change-Id: Ib8e419d35ff8f7cbff9667c1cd40d05ccfacab8b
2024-07-11 16:59:34 -07:00
Colin Cross
694fced1e3 Don't mutate non-property module fields
Setting sanitize and stl to nil in a mutator isn't valid, if any other
mutator creates a variant then the factory method will be called again
to create the new variants and will reset sanitize and stl to non-nil.
Add a property to sanitize and check it everywhere that checked for
sanitize != nil, and set the Stl property.

Bug: 319288033
Test: all soong tests pass
Flag: EXEMPT refactor
Change-Id: If99d5fa0f088ee4a73cc7dccdab4268618a6009f
2024-07-11 16:59:33 -07:00
Colin Cross
088123934b Merge "Remove test_per_src" into main 2024-07-11 20:32:23 +00:00
ELIYAZ MOMIN
52a4ae5744 Merge "Revert "Upgrade to clang-r530567"" into main 2024-07-11 12:38:30 +00:00
ELIYAZ MOMIN
9d00ea3e95 Revert "Upgrade to clang-r530567"
This reverts commit b4f05f1a05.

Reason for revert: <Potential culprit for b/352458178  - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.>

Change-Id: Idf6c69296c6537e8011c2ce5fcbdf45a29154acf
2024-07-11 12:35:41 +00:00
Pechetty Sravani
45ca89a4a2 Merge "Revert "Enable -Wfortify-source"" into main 2024-07-11 09:55:12 +00:00
Yabin Cui
295306f5f2 Merge "Upgrade to clang-r530567" into main 2024-07-11 04:01:25 +00:00
Liana Kazanova
852a98fd8c Revert "Enable -Wfortify-source"
This reverts commit cbf426fa50.

Reason for revert: Droidmonitor triggered revert due to build breakage in b/352395522. Will be verifying through ABTD before submission.

Change-Id: I214aa6e2a707ed22aac901db988a33affc37e269
2024-07-10 22:10:08 +00:00
Aditya Kumar
05f3927c09 Merge "Enable -Wfortify-source" into main 2024-07-10 21:07:26 +00:00
Yi Kong
12bebf9567 Switch host native tests to -Og
This helps to reduce build artifact size significantly, by 1.33GB for
`m cts` in the `out` directory on aosp-main. This should also make them
a lot faster to run.

Also turns off unused-result warning. This analysis is not run on -O0,
leaving behind a ton of code that triggers this warning. Since it is not
an important warning for tests anyway, turn it off by default for tests.

Right now, -Og is just an alias for -O1 in Clang. If the debuggability
is affected due to this change, we can identify and disable the relevant
optimization pass in -Og.

Change-Id: I84383cbc05a53d89c322ecb3679320f1338542e6
Bug: 294796809
Test: presubmit
2024-07-10 12:33:46 +00:00
Zi Wang
aee299e9f3 Merge "Remove OutputFiles method from llndk_libraries_txt and sanitizer_libraries_txt" into main 2024-07-09 19:30:39 +00:00
Treehugger Robot
72be248e10 Merge "cc_cmake_snapshot: drop Modules field" into main 2024-07-09 01:01:44 +00:00