Commit graph

8788 commits

Author SHA1 Message Date
Luis Useche
342fa6b927 Add global C flags to compile_commands
This solves linter warnings in editor by adding flags to ignore errors
we don't care about. This also means that compile_commands.json is
closer to the flags we actually use for compilation.

Test: Checked generated compile_commands for new flags.

Change-Id: Id583da6eb5151a9baa9a47771f5f937c88bc43f7
2024-04-02 13:58:13 -07:00
Kiyoung Kim
fa13ff194c Remove PlatformVndkVersion property
Platform VNDK version is no longer available based on VNDK deprecation.
Remove all code using Platform VNDK version.

Bug: 330100430
Test: AOSP CF build succeeded
Change-Id: I7d0f7e23eff5d153346890f242a94b78bad6736b
2024-04-01 16:37:20 +09:00
Kiyoung Kim
82488ca457 Merge "Remove VNDK information from CC and APEX tests" into main 2024-03-29 04:37:25 +00:00
Kiyoung Kim
149f8e1502 Merge "Remove vendor_snapshot_test" into main 2024-03-29 02:50:32 +00:00
Kiyoung Kim
0d1c1e6aef Remove VNDK information from CC and APEX tests
VNDK is deprecated in 24Q2, so soong should be tested with no device and
platform vndk versions. This change removes all VNDK related tests and
VNDK versions from soong-cc and soong-apex tests.

Bug: 330100430
Test: m nothing --no-skip-soong-tests passed
Change-Id: I45e6c13e6c0a6bc9710b120e8d5b167e2051631e
2024-03-28 15:15:01 +09:00
Kiyoung Kim
d8ec229bc0 Remove vendor_snapshot_test
Remove vendor_snapshot_test from cc and rust as they are no longer in
support.

Bug: 330100430
Test: m nothing --no-skip-soong-tests passed
Change-Id: Ia798bc1c87d3f1d73ea5866dc85ff4073f5f9c5b
2024-03-28 15:11:16 +09:00
Chungro Lee
139218906b Merge "Revert^3 "Enable full LTO optimization by default"" into main 2024-03-28 01:35:37 +00:00
Chungro Lee
97f68587ff Revert^3 "Enable full LTO optimization by default"
7549990a95

Reason for revert: b/331528903
Change-Id: Idb013e97c84aeaf969522dc77abf94f23f721181
2024-03-28 01:25:42 +00:00
Yi Kong
2590054333 Merge "Revert^2 "Enable full LTO optimization by default"" into main 2024-03-27 01:58:09 +00:00
Yi Kong
7549990a95 Revert^2 "Enable full LTO optimization by default"
55019c43f4

We set the default optimization mode to --lto-O0 for LTO enabled
projects, in order to save build time. This is missing some performance
optimizations, esp. related to vectorization. Now that we suggest eng
build for developers, we can enable full optimization by default.

When we introduced --lto-O0, we achieved a 4.2% saving in
system-processes-memory-direct. Enabling full LTO optimization will
trade some of the memory / binary size savings for better code
performance. For system-processes-memory-direct, it is 2.0% increase
compared to --lto-O0, or a net 2.2% saving compared to baseline.

Change-Id: I747939ac4d6e4a66e3ef776f4c36eebc7bf34c86
2024-03-27 01:57:22 +00:00
Elliott Hughes
c903b8d69f Re-enable abi checking for hwasan builds.
The tool that had the bug this disablement worked around is no longer in
use, and the current tool "works for me"...

Test: ran locally
Change-Id: I801da20a00f54a90777b99ea264d9ab420b7f942
2024-03-25 16:29:26 -07:00
Yi Kong
949157d582 Merge "Remove ThinLTO workaround for VNDK" into main 2024-03-25 07:14:29 +00:00
Treehugger Robot
e58af3da5a Merge "Add required, host_required, and target_required as dependencies" into main 2024-03-25 04:10:50 +00:00
Treehugger Robot
bfa7f261d1 Merge "Revert "Enable full LTO optimization by default"" into main 2024-03-22 09:01:23 +00:00
Yi Kong
55019c43f4 Revert "Enable full LTO optimization by default"
Revert submission 2988057-default-full-lto

Reason for revert: broken test

Reverted changes: /q/submissionid:2988057-default-full-lto
Bug: 330811070

Change-Id: I46487ad92d25741347c7f30e944a5794941d5d69
2024-03-22 05:51:09 +00:00
Yi Kong
2703b42ccb Merge "Enable full LTO optimization by default" into main 2024-03-22 02:15:46 +00:00
Yi Kong
e022cf58dd Remove ThinLTO workaround for VNDK
VNDK is deprecated. The build is passing without the workaround.

Test: presubmit
Bug: 169217596
Change-Id: I7cf2c33984c50d06f3e69ebc916ce6a89468204a
2024-03-21 16:34:56 +00:00
Pirama Arumuga Nainar
950e8c97fe [cc:riscv64] Do not pass -mno-strict-align while linking
Bug: http://b/327307773

Newer clang rejects this flag as unsupported.  It is not necessary while linking because the flag is passed as an IR feature.

Change-Id: I781afd913be7c07612196e736c3ae58773791071
2024-03-20 17:25:20 +00:00
Elliott Hughes
bc7c97b15b Merge "Defer to clang for --hash-style." into main 2024-03-20 16:47:40 +00:00
Elliott Hughes
b48fb83936 Defer to clang for --hash-style.
We fixed the clang driver to "do the right thing" based on target api level years ago, but these manual workarounds predate that (or were copy & pasted from places that predated that). We don't need them any more.

See https://github.com/android/ndk/issues/2005 for more detail.

Change-Id: I995741b8606e389e8de8272f1cc532624516245a
2024-03-20 14:50:26 +00:00
Jiyong Park
8bcf3c64f1 Add required, host_required, and target_required as dependencies
So far, the installation of required modules were handled by Make. This
prevents us from implementing the module installation and packaging
entirely in Soong.

This CL is the first step towards that goal. Soong now correctly tracks
the dependencies and they are correctly returned by
TransitivePackagingSpecs(), which is used by packaging modules like
android_system_image.

Bug: 321626681
Test: build
Change-Id: I9192b5333ceaa0b7d1c5c4abeec2af62febcd976
2024-03-20 17:05:17 +09:00
Treehugger Robot
1f4ffda2ed Merge "Support multilib property for cc_genrule" into main 2024-03-20 02:38:30 +00:00
kellyhung
750334a0c0 Support multilib property for cc_genrule
Change genrule Out to `android:"arch_variant"` for supporting
multilib variants.

Bug: 323295272
Test: go test -run TestMultilibGenruleOut

Change-Id: I102d64b45a5a2a5193f813001fc32da0d1fe9d36
2024-03-20 09:25:41 +08:00
Pirama Arumuga Nainar
0593537f58 [cc:riscv64] change -munaligned-access to -mno-strict-align
Bug: http://b/327307773

cd071253c7 removed -munaligned-access

Change-Id: I7a102fa1cdc49564cb0b724e6f177d33b3636f55
Test: presubmit
2024-03-19 16:28:31 +00:00
Elliott Hughes
c2600464c7 Fully document all the riscv64 flags.
In particular, make it clearer when/how we can remove each of them.

Change-Id: Ic3156e53ea56479324781fea737390588bc086b5
2024-03-18 19:37:13 +00:00
Yu Liu
f509eba41d Merge "Validate aconfig libs are built with the correct modes." into main 2024-03-14 18:39:12 +00:00
Jooyung Han
ed9005b556 Merge "Clean up LLNDK stubs" into main 2024-03-14 03:58:14 +00:00
Jooyung Han
2b8b2b2064 Merge "ndkstubgen: use llndk=<version> for new llndk stub" into main 2024-03-14 01:48:36 +00:00
Jooyung Han
33eb615eb0 ndkstubgen: use llndk=<version> for new llndk stub
We want LLNDK symbols to be explicitly marked with llndk tag to
handle LLNDK freezing which happens before SDK freezing. If symbols
need to be frozen as LLNDK, those symbols must be marked explicitly with
correct vFRC version.

In the following example,

LIBFOO { # introduced=35
  foo;
  bar;
  bar; # llndk=202404
  baz; # llndk=202404
  qux; # llndk=202505
};

NDK libfoo will have foo and bar while LLNDK libfoo stub will have bar
and baz for 202404.

Bug: 329012338
Test: test_ndkstubgen test_symbolfile
Change-Id: I384f589b240fa047e8871964bf9550f426024dfc
2024-03-14 06:06:26 +09:00
Kalesh Singh
9f38694fc3 Merge "soong: ldflags: Add separate-loadable-segments" into main 2024-03-13 18:41:14 +00:00
Kalesh Singh
fa1ebf5943 soong: ldflags: Add separate-loadable-segments
To suport >4KB page sizes, the loader may extend LOAD segment mappings
to be contiguous in the virtual address space. This is done in order to
reduce the use of unreclaimable kernel slab memory for the otherwise
necessary gap VMAs (when the runtime-page-size < ELF-segment-p_align).

Such mappings may beyond the end of the backing file when extended;
which breaks the common userspace assumption that file memory maps are
entirely backed by the underlying file.

Existing apps (not yet updated for larger page size support) may
encounter breakages if they parse /proc/self/[s]maps and use the
[start, end] addresses to operate on system libraries that have
crt_pad_segment optimization (VMA extension) [1].

In order to avoid breaking exisiting apps, update the build system to
ensure the platform ELFs' segments are entirely backed by the file
even when the VMA is extended to be contiguous with the subsequent
segment's. This is achieved using the linker flag
-z separate-loadable-segments, which inserts enough padding (zeros)
to also align each segment's offset on file by it's p_align
(max-page-size).

Although laying out the ELF segments on disk to respect the p_align
causes an increase in the file's apparent size (i_size), on Android the
actual disk usage increase is not significant due to most of the padding
being zero blocks which don't get alloacted in the read-only partitions.

The following results were obtained on an ARM64 device on a recent
git_main build:

 No Separate     Separate     Delta         Delta %   Partition
   Loadable      Loadable
   Segments      Segments

   4208.90MB    4214.6MB       5.70MB       0.14%     All RO Partitions

Note: The overhead of -z separate-loadable-segments is minimized by the
fact that ARM64 android already builds with -z separate-code. [2]

[1] https://cs.android.com/android/platform/superproject/main/+/main:bionic/libc/arch-common/bionic/crt_pad_segment.S
[2] 733198152d:build/soong/cc/config/arm64_device.go;l=53

Bug: 328797737
Test: Manually test previously crashing application
Change-Id: Icb14ad10b5c9282855d54c7945b065b7b4184163
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2024-03-12 17:04:50 -07:00
Jooyung Han
5e8994e5ed Clean up LLNDK stubs
So far we created {"", "current"} stubs for LLNDK modules. But we don't
need "current" because "" itself is a stub.

This change only removes unused LLNDK stub modules with "current"
version, which aren't used at all.

Bug: 329183083
Test: m blueprint_tests
Change-Id: Ib8e880b6d88952b489657ea1ac557a48afe562a4
2024-03-12 16:26:18 +09:00
Hsin-Yi Chen
f1f276c904 Let header ABI checker load core variants' version scripts
Header ABI checker dumps the ABI from core variants and filters it by
version scripts. Ideally it should load different version scripts for
LLNDK, NDK, APEX, etc, but the build rules have not been completed. The
current solution is to load core variants' version scripts. It works
for every existing library because a library's variants share one
version script.

Test: make
Bug: 329078703
Change-Id: I4e26275e24daf93c7d3bb7e70b542a1197ae2129
2024-03-12 04:40:59 +00:00
Yu Liu
67a28425a7 Validate aconfig libs are built with the correct modes.
Bug: 323071835
Test: Unit tests and manual tests.
Change-Id: I32de90826c7c8bb4d8495608e959d554820ab9a2
2024-03-07 18:51:16 +00:00
Yi Kong
ce23b9ba16 Enable full LTO optimization by default
We set the default optimization mode to --lto-O0 for LTO enabled
projects, in order to save build time. This is missing some performance
optimizations, esp. related to vectorization. Now that we suggest eng
build for developers, we can enable full optimization by default.

When we introduced --lto-O0, we achieved a 4.2% saving in
system-processes-memory-direct. Enabling full LTO optimization will
trade some of the memory / binary size savings for better code
performance. For system-processes-memory-direct, it is 2.0% increase
compared to --lto-O0, or a net 2.2% saving compared to baseline.

Test: presubmit
Bug: 328163089
Change-Id: Ia4d0f74e668ed057d6d9d6fc6c60196c2e355fb9
2024-03-07 07:02:45 +00:00
Spandan Das
972917d794 Support partial module variants with apex_contributions
Some libraries like `libnativehelper_compat_libc++` only exist as shared
library in module sdk. When prebuilt of this library is selected using
apex_contritbutions, only shared linkages should be redirected to the
prebuilt version. The static linkage should come from source.

Test: Added a unit test
Bug: 322175508

Change-Id: Ic65d376b2354b4a42c7b9ea3ed1cd80c37e2840f
2024-03-04 08:39:20 +00:00
Spandan Das
f2c1057586 Fix non-determinism in prebuilt selection
This relands aosp/2978137 with acknowledgement of soong namespaces.

If multiple versions of the prebuilt module sdk share the same soong
config namespace, then PrebuiltPostDepsMutator rewrites rdeps to one of
those prebuilts in a non-deterministic way.

This CL uses apex_contributions to make this deterministic. Multiple
prebuilts will not be allowed to have their prefer evaluate to true. If
this happens, one of the prebuilts must be explicitly declared in
apex_contributions.

This CL also fixes the special-casing of the top-level
java_sdk_library_import in ReplaceDirectDependencies. For
framework-foo.v2, it will use BaseModuleName framework-foo instead of
SdkLibraryName framework-foo.v2 to determine if the source module has
been selected.

Test: ran the previously failing cmd of b/327552112
Test: Added a unit test
Test: aninja -t query
    out/soong/.intermediates/packages/modules/Permission/SafetyCenter/Config/safety-center-config/android_common/javac/safety-center-config.jar
    | grep module_sdk is empty (should not cause a regression for
    323454855)
Change-Id: Id484a41192085c50b7e34ad415c6e195edb0d006
2024-03-04 07:59:34 +00:00
Ryan Prichard
45ac47edab Merge changes I34385c48,I1e48947c into main
* changes:
  disablePrebuilt: also clear sanitizer-dependent Srcs
  Define libc++ config macros to nothing
2024-02-29 20:51:48 +00:00
Spandan Das
af66212522 Revert "Fix non-determinism in prebuilt selection"
This reverts commit 2d8884a377.

Reason for revert: Build breakage https://groups.google.com/a/google.com/g/android-build-police-core/c/00mM-B9unVg/m/0FxBxpMbAwAJ. The validation does not check for namespace isolation which breaks libtonemap

Change-Id: Ieb4d3bc4f3ade856877ebb62a567620f5a1ed08c
2024-02-29 08:57:08 +00:00
Spandan Das
2d8884a377 Fix non-determinism in prebuilt selection
If multiple versions of the prebuilt module sdk share the same soong
config namespace, then PrebuiltPostDepsMutator rewrites rdeps to one of
those prebuilts in a non-deterministic way.

This CL uses apex_contributions to make this deterministic. Multiple
prebuilts will not be allowed to have their prefer evaluate to true. If
this happens, one of the prebuilts must be explicitly declared in
apex_contributions.

This CL also fixes the special-casing of the top-level
java_sdk_library_import in ReplaceDirectDependencies. For
framework-foo.v2, it will use BaseModuleName framework-foo instead of
SdkLibraryName framework-foo.v2 to determine if the source module has
been selected.

Test: Added a unit test
Test: aninja -t query
    out/soong/.intermediates/packages/modules/Permission/SafetyCenter/Config/safety-center-config/android_common/javac/safety-center-config.jar
    | grep module_sdk is empty (should not cause a regression for
    323454855)

Bug: TODO
Change-Id: I7191200c330c5bcb9d5532006d3c573a60db61cc
2024-02-29 06:34:49 +00:00
Ryan Prichard
21e2c10cd2 disablePrebuilt: also clear sanitizer-dependent Srcs
The new libc++ prebuilt has HWASan and non-HWASan variants for arm64.

Bug: 175635923
Test: checkout use-prebuilt-libcxx topic, build libc++demangle, verify
  that libc++demangle-install is not a valid build target

Change-Id: I34385c48aa7ad1401e2547d65d30a14fa342e304
2024-02-28 19:14:59 -08:00
Ryan Prichard
718cf5bf19 Define libc++ config macros to nothing
libc++[abi] always check whether one of these macros is defined, not
the value the macro is defined to. With the new libc++, there is a
Windows __config_site header that automatically defines
_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS and _LIBCPP_HAS_THREAD_API_WIN32
to nothing, so these definitions need to match to avoid a redefinition
error.

Bug: 175635923
Test: treehugger
Test: m adb
Change-Id: I1e48947c3b45e59804cdacd48776c7f3bd9a18c6
2024-02-28 19:14:24 -08:00
Aditya Kumar
592b54c443 Merge "Update unaligned-vector-mem to -munaligned-access" into main 2024-02-28 19:35:39 +00:00
Spandan Das
3faa792093 Use BaseModuleName of dep when writing to make
Since BaseModuleName of the dep becomes its LOCAL_MODULE name in the
generated mk file, we should also use BaseModuleName of dep for populating
properties such as LOCAL_SHARED_LIBS of rdeps

Test: m nothing --no-skip-soong-tests
Bug: 322175508

Change-Id: I6b47112faa63f85d19b5b71e0e102cea0ab68e3b
2024-02-28 18:03:00 +00:00
AdityaK
2c90a92d77 Update unaligned-vector-mem to -munaligned-access
Latest compiler has merged both unaligned access flags into one.

TODO:  This is needed until we change clang driver to enable -munaligned access by default.for Android b/327307773

Bug: 326790418
Change-Id: Ia8c29dc56104d2cffb8ac41aae6eeacccae68e61
2024-02-28 06:14:57 +00:00
Aditya Kumar
6edbaa369f Merge "Remove wtautological warnings added during toolchain update" into main 2024-02-21 18:43:28 +00:00
Aditya Kumar
30aec0dfb1 Merge "Error on the usage of -target flag" into main 2024-02-21 06:30:45 +00:00
Treehugger Robot
3ce80aef7f Merge "Version LLNDK ABI dumps with VendorApiLevel" into main 2024-02-17 05:58:03 +00:00
Hsin-Yi Chen
53eb289ad0 Merge "Separate LLNDK ABI diff reports from the other variants" into main 2024-02-17 02:15:39 +00:00
AdityaK
a0ad736b91 Remove wtautological warnings added during toolchain update
Bug: b/301328082

Change-Id: I0bf10e4a9456dff1b3a521ca13cb5170e738f80a
2024-02-16 19:44:26 +00:00
AdityaK
f6fbaac34c Error on the usage of -target flag
Bug: http://b/323415017
Change-Id: I31897ff0101965088280ad9adc7a23a7c190536a
2024-02-16 19:42:15 +00:00
Colin Cross
a82de712b3 Merge changes from topic "revert-2952265-revert-2925209-KVPWEBRQHT-BBCOVJBOVF" into main
* changes:
  Remove fdoProfileMutator
  Convert AFDO mutators to TransitionMutator
2024-02-12 19:31:00 +00:00
Yu Liu
b882375fe0 Merge "Only link the profile extras lib for device variant." into main 2024-02-12 18:12:14 +00:00
Pirama Arumuga Nainar
7493929ff2 Enable -Wambiguous-reversed-operator
Bug: http://b/323152930
Bug: http://b/324323434

The ambiguity in frameworks/av/media/codec2 is resolved.

Test: build partner branch, and presubmit
Change-Id: Ie1aa0b6c965b1a9076333d7d25fd9f9664467a31
2024-02-09 22:45:58 +00:00
Colin Cross
09e1e8d1fb Merge "Fix TestAfdoDeps for darwin" into main 2024-02-09 22:41:46 +00:00
Colin Cross
3513fb17cd Remove fdoProfileMutator
Add the dependency on the fdo_profile module in afdoTransitionMutator
and read the provider in GenerateAndroidBuildActions.

This relands Ied8fd7b52d5694a3691652318e87b8fe14dda126 with a fix
to use the correct LTO ldflag when an afdo variant doesn't have a
profile.

Bug: 319288033
Bug: 324141705
Test: afdo_test.go
Change-Id: I024ca316cfb565b5fb0251793f05a54ce16cc1cb
2024-02-09 13:49:02 -08:00
Colin Cross
e00614ecba Fix TestAfdoDeps for darwin
LTO does not set the -import-instr-limit flag when building for
darwin, don't test it on darwin host modules.

Test: afdo_test.go
Change-Id: I83f77006a875f8b0a6af9ae11eb3bad88b0681b1
2024-02-09 12:22:13 -08:00
Treehugger Robot
c7c666a354 Merge "Remove macros that the Linux host no longer needs." into main 2024-02-09 19:39:06 +00:00
Colin Cross
545ebf0c40 Merge changes I255fcbb8,I3ed4ce03 into main
* changes:
  Disable more of AFDO for host modules
  Add more AFDO tests
2024-02-09 19:30:29 +00:00
Elliott Hughes
49e8f25966 Remove macros that the Linux host no longer needs.
We patched our ancient glibc to match current glibc (and bionic/musl).

Test: treehugger
Change-Id: I6377b5dfb94d3a0e2209d4c2f0661ef81d362fc3
2024-02-09 16:43:34 +00:00
AdityaK
12f239fd37 Move Wno-ambiguous-reversed-operator to noOverrideGlobalCflags
Some builds were still failing when it was in noOverrideExternalGlobalCflags

Bug: b/324323434
Change-Id: Ibaaa611f085d94e7defac7f2a6aa70b9eef08552
2024-02-08 16:28:20 -08:00
AdityaK
94688b5a4f s/Wno-error=unused-variable/Wno-unused-variable
http://b/315246135

Change-Id: I2086c644afc9a371732ccbe18d09fa078286ece0
2024-02-08 16:25:01 -08:00
Aditya Kumar
d18128fa12 Merge "Add Wno-ambiguous-reversed-operator to get around the operator== lookup issue in clang" into main 2024-02-08 12:17:05 +00:00
AdityaK
839eda517e Add Wno-ambiguous-reversed-operator to get around the operator== lookup issue in clang
Bug: b/323152930
Change-Id: Iee1bc4dd9db9a0fe38d7cf871c34abb638abc092
2024-02-07 20:30:55 -08:00
Colin Cross
d38feb0d4a Convert AFDO mutators to TransitionMutator
Convert afdoDepsMutator and afdoMutator to a TransitionMutator as a
step towards variants-on-demand.

This relands Ib05845455ccf43a07b3915a0d7b0a95896062f13 with a fix
to maintain the current behavior of not using AFDO variants for
dependencies of the linker static binary.

Bug: 319288033
Bug: 324141705
Test: afdo_test.go
Change-Id: I76e30021173fc5b7e9e1fa826039776eb3dc7b6e
2024-02-07 15:51:40 -08:00
Elliott Hughes
5897fd6a5e Merge "Remove __STDC_FORMAT_MACROS." into main 2024-02-07 23:50:37 +00:00
Colin Cross
15fa814560 Disable more of AFDO for host modules
afdo.addDep would never add a depencency on a profile for a host
module, but afdoDepsMutator would still propagate AfdoRDeps to
dependencies, afdoMutator would still create afdo variants, and
afdo.flags would still add the -funique-internal-linkage-names
flag.  Exit early from all of these functions, since the afdo
variations will never be useful.

Test: afdo_test.go
Change-Id: I255fcbb86c99871916e571fbc74075d918b24745
2024-02-07 15:49:47 -08:00
Colin Cross
da4c89f750 Add more AFDO tests
Add more coverage to the afdo tests for the arm32 variant of a module
that only has an arm64 profile, for the -funique-internal-linkage-names
flag, and for the interaction between LTO linker flags and AFDO.

Test: afdo_test.go
Change-Id: I3ed4ce033c2431ea3e2fee536744b5e5b4cad296
2024-02-07 15:48:13 -08:00
Elliott Hughes
1c80585cd6 Remove __STDC_FORMAT_MACROS.
Our mingw doesn't use this. (It does however still use
__STDC_CONSTANT_MACROS and __STDC_LIMIT_MACROS.)

Test: treehugger
Change-Id: I415017093b9ccffd21fd41f17a2f4387839a0f53
2024-02-07 20:45:25 +00:00
Elliott Hughes
ac43c55656 Remove macros that Darwin never used.
Test: treehugger
Change-Id: I4b31c1f40142c0346ac2d2c9e9b831954c4d9468
2024-02-07 18:30:22 +00:00
Hsin-Yi Chen
2c4a9779cd Version LLNDK ABI dumps with VendorApiLevel
LLNDK version will be decoupled from SDK version. The ABI checker
loads the reference ABI dumps from
prebuilts/abi-dumps/vndk/<VendorApiLevel>.

Test: m libnativewindow
Bug: 314010764
Change-Id: I3e9f2cab58db0d1cc42f8c1abc13968617dacf14
2024-02-07 17:32:00 +08:00
Hsin-Yi Chen
362c1883d1 Separate LLNDK ABI diff reports from the other variants
- Soong generates the rules to compare prebuilts/abi-dumps/vndk and
  the intermediate dumps tagged with LLNDK.
- The LLNDK ABI diff report names contain ".llndk". Because LLNDK
  versioning has not been implemented, the reports are identical to
  those for NDK and PLATFORM.
- optInAbiDiff does not take isLlndkOrNdk as a parameter, as it is
  false for all known use cases.

Test: m libnativewindow
Bug: 314010764
Change-Id: I17097505472b9d6ab97a605f3f8dca8ea53d22c8
2024-02-07 15:35:36 +08:00
Ke-Yu Lu
196d9493c4 Merge changes from topic "revert-2925209-KVPWEBRQHT" into main
* changes:
  Revert "Convert AFDO mutators to TransitionMutator"
  Revert "Remove fdoProfileMutator"
2024-02-06 05:46:07 +00:00
Ke-Yu Lu
0be9d6034e Revert "Convert AFDO mutators to TransitionMutator"
Revert submission 2925209

Reason for revert: b/323975183

Reverted changes: /q/submissionid:2925209

Change-Id: Ie907d23081817d601a1a2083347b5f683829a36c
2024-02-06 02:15:03 +00:00
Ke-Yu Lu
351d36490d Revert "Remove fdoProfileMutator"
Revert submission 2925209

Reason for revert: b/323975183

Reverted changes: /q/submissionid:2925209

Change-Id: I33b2e71ba7b36e12e5c491e0ad14a7f7df3edd78
2024-02-06 02:15:03 +00:00
Kiyoung Kim
e5b8b97322 Merge "Reapply "Rename LOCAL_USE_VNDK"" into main 2024-02-06 00:57:21 +00:00
Colin Cross
6c392749d5 Merge changes Ied8fd7b5,Ib0584545 into main
* changes:
  Remove fdoProfileMutator
  Convert AFDO mutators to TransitionMutator
2024-02-05 23:03:49 +00:00
Kiyoung Kim
84b6508604 Reapply "Rename LOCAL_USE_VNDK"
Similar with aosp/2897612, rename LOCAL_USE_VNDK into
LOCAL_IN_VENDOR or LOCAL_IN_PRODUCT to make variable useful from
VNDK deprecation.

Bug: 316829758
Test: AOSP CF build succeeded
Change-Id: If7bead24add014ed9e0e9e1d265b0199b911be89
2024-02-05 10:31:23 +09:00
Aditya Kumar
b2a56627a2 Merge "Revert^2 "Update clang version to clang-r510928"" into main 2024-02-03 12:54:13 +00:00
Treehugger Robot
fe423e39fb Merge "Reduce warning spam from "unused-" flags in //external, //vendor, //hardware" into main 2024-02-03 03:25:58 +00:00
Aditya Kumar
ef7c121a6b Revert^2 "Update clang version to clang-r510928"
22686bab04

Change-Id: I1117546bb71548e1146c6ae43419b6aef772f812
2024-02-02 14:32:47 -08:00
Treehugger Robot
0e5f6e4e9f Merge "Revert "Rename LOCAL_USE_VNDK"" into main 2024-02-02 10:38:49 +00:00
Kiyoung Kim
ed63c02e9b Revert "Rename LOCAL_USE_VNDK"
Revert submission 2931430-local_use_vndk

Reason for revert: build fails with barbet targets

Reverted changes: /q/submissionid:2931430-local_use_vndk

Change-Id: Ic5b850e2905d1b93e8b4d08921106940991587b8
2024-02-02 08:06:52 +00:00
Aditya Kumar
14b5f6e05b Merge "Remove x86 specific flags from bpf target" into main 2024-02-02 06:05:20 +00:00
AdityaK
6cfd07e524 Remove x86 specific flags from bpf target
Test: cd external/bcc/libbpf-tools && mm

Bug: b/308826679

Change-Id: Ibb76832c4013360b6561a6d3676f35adc9ecde5f

Change-Id: Ibb76832c4013360b6561a6d3676f35adc9ecde5f
2024-02-01 20:51:48 -08:00
Hsin-Yi Chen
c9d4eab9fe Merge "Separate LLNDK from the platform library dumps" into main 2024-02-02 04:34:50 +00:00
Treehugger Robot
838b29ebc7 Merge "Rename LOCAL_USE_VNDK" into main 2024-02-02 02:48:35 +00:00
Treehugger Robot
b370adbdcc Merge "Build VNDK with VNDK prebuilts without BOARD_VNDK_VERSION" into main 2024-02-02 01:06:37 +00:00
Kalesh Singh
f4ffe0a026 soong: Add crt_pad_segment to .so's
crt_pad_segment adds a NOTE to the ELF which is used by the binoic
loader to determine whether it should pad segments when mapping them
into the virtual address space, such that there are no gaps between
mappings of consecutive segments. This avoids an increase in
unreclaimable kernel slab memory usage for VMAs on devices where the
runtime-page-size > elf-segment-p_align.

Since -fandroid-pad-segment [1] respects -nostdlib used in android
platform builds, soong must link in crt_pad_segment to platform shared
libraries.

For simplicity, link crt_pad_segment everywhere that crtend_so is
applicable, ignoring nocrt property, as there is no other reason
to track these separately.

Example:

❯ readelf -WS /system/lib64/libc++.so [Output simplified]

...
Section Headers:
  [Nr] Name              Type            Address          Off    Size   ES Flg Lk Inf Al
...
  [ 2] .note.android.pad_segment NOTE            0000000000000288 000288 000018 00   A  0   0  4
...

[1] https://github.com/llvm/llvm-project/pull/77244

Bug: 316403210
Test: readelf -WS <lib>.so
Change-Id: Icc06611376cfd5ee4de7281b4134f9f8ffe7ca60
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2024-01-31 19:42:31 -08:00
Kiyoung Kim
0fcadd89e2 Build VNDK with VNDK prebuilts without BOARD_VNDK_VERSION
Current VNDK prebuilts are disabled if BOARD_VNDK_VERSION is not set,
but VNDK prebuilts should be enabled even BOARD_VNDK_VERSION is not set
because VNDK APEXes should be available from VNDK deprecation. This
change removes some restrictions on VNDK prebuilts to enable those from
VNDK deprecation.

Bug: 316829758
Test: AOSP Cuttlefish build succeeded without BOARD_VNDK_VERSION
Change-Id: Id780811dab26f2125097c3efc5b2b4a59416b826
2024-02-01 11:20:14 +09:00
Hsin-Yi Chen
50884dce3c Separate LLNDK from the platform library dumps
LLNDK will not be finalized at the same time with NDK and APEX
libraries. The ABI dumps need to be generated and stored separately.
In lsdump_paths.txt, each dump path is tagged with LLNDK, NDK, etc. A
library may have multiple dumps with different tags. The finalization
scripts will read lsdump_paths.txt and select the dumps for LLNDK.

LLNDK versioning for trunk stable has not been implemented. Currently
the dumps for LLNDK, APEX, NDK are identical.

Bug: 314010764
Test: make out/target/product/generic_x86_64/lsdump_paths.txt
Change-Id: Ia8eed555dc176b221e67b3b049dd3db76f9bc658
2024-01-31 11:21:13 +00:00
Pirama Arumuga Nainar
22686bab04 Revert "Update clang version to clang-r510928"
Revert submission 2804373-clang_r510928

Bug: http://b/301328082

Reason for revert: Broke aosp-main/aosp_x86-next-userdebug

Reverted changes: /q/submissionid:2804373-clang_r510928

Change-Id: I6802b329e8dbd9dce5a75aab76c43960765a8594
2024-01-31 06:51:49 +00:00
AdityaK
0790ce2e56 Update clang version to clang-r510928
Bug: b/301328082
Test: N/A
Change-Id: Ied250c42c33d9e2d8bd9b9161b9028874540addb
2024-01-30 15:09:29 -08:00
Prashanth Swaminathan
13b063730a Reduce warning spam from "unused-" flags in //external, //vendor, //hardware
Some clang unused-* warnings are not covered by "-Wno-unused". Add them
explicitly to avoid noise from these warnings, given that they don't
generally get fixed.

Test: Local clean builds.
Change-Id: I13f5089fd68f1a67a11be14fa41807688d803ba3
2024-01-30 20:31:25 +00:00
Hsin-Yi Chen
7acf94b221 Merge "Find LLNDK dumps in prebuilts/abi-dumps/vndk" into main 2024-01-30 09:05:16 +00:00
Kiyoung Kim
1132b8cdaa Rename LOCAL_USE_VNDK
Similar with aosp/2897612, rename LOCAL_USE_VNDK into
LOCAL_IN_VENDOR or LOCAL_IN_PRODUCT to make variable useful from
VNDK deprecation.

Bug: 316829758
Test: AOSP CF build succeeded
Change-Id: I76741e45a2d80000adec6abfd8e9d6ee97c4ea23
2024-01-30 16:52:10 +09:00
Treehugger Robot
a8a5f64222 Merge "Support mechanism to select a specific version of module sdk prebuilt" into main 2024-01-29 19:22:57 +00:00
Colin Cross
04a59937d2 Merge "Convert orderfile mutators to TransitionMutator" into main 2024-01-29 18:57:28 +00:00
Hsin-Yi Chen
704c12d0bb Find LLNDK dumps in prebuilts/abi-dumps/vndk
LLNDK will not be finalized at the same time as APEX and NDK. The
dumps have to be placed in a different directory. The new LLNDK dumps
will be created in "vndk" directory.

Test: lunch aosp_x86_64-next-eng ; make
Bug: 314010764
Change-Id: I0726e3eabcfdbfb94a10f01ddd6dfb971552bd50
2024-01-29 16:15:29 +08:00
Yi-Yo Chiang
c21f548fd4 Merge "cc: Vendor modules should NOT derive its "SDK" level from VNDK" into main 2024-01-29 03:14:22 +00:00
Aditya Kumar
03dcd93ea0 Merge "Disable shrink-wrap optimization for arm32 devices Bug: b/319464283 Bug: b/322359235" into main 2024-01-27 03:47:22 +00:00
Spandan Das
2b6dfb554d Support mechanism to select a specific version of module sdk prebuilt
This CL is scoped to cc_* module types. With trunk stable, we will have
multiple prebuilts of the cc modules in
prebuilts/module_sdk/art/<v>/host-exports/, and this CL introduces a
mechanism to use apex_contributions to select a specific versioned
prebuilt when building.

If a soong module is selected using apex_contributions, all rdeps will
get that soong module, which includes
- rdep soong modules which might be depending on it via Android.bp
- Soong's rule builder HostToolPath API

Implementation details: Create a new source_module_name property to
identify the root module. rdeps referring to the root module will get
redirected if necessary. This property also
becomes the stem, if `stem` is not set explicitly.

Bug: 322175508

Test: Added a unit test

Change-Id: Ic8725602c81999621fcb33ce2a57fe4b9751baa8
2024-01-26 23:32:13 +00:00
AdityaK
c4b7a18ffc Disable shrink-wrap optimization for arm32 devices
Bug: b/319464283
Bug: b/322359235

Change-Id: Ia720f88a8967d00c7fc3ac7d690d4d37123818f1
2024-01-26 21:55:19 +00:00
Colin Cross
5d6c1eee0d Merge "Convert LTO mutators to TransitionMutator" into main 2024-01-26 20:34:30 +00:00
Colin Cross
943aa5c862 Remove fdoProfileMutator
Add the dependency on the fdo_profile module in afdoTransitionMutator
and read the provider in GenerateAndroidBuildActions.

Bug: 319288033
Test: afdo_test.go
Change-Id: Ied8fd7b52d5694a3691652318e87b8fe14dda126
2024-01-26 11:09:25 -08:00
Colin Cross
a6b407fbf5 Convert AFDO mutators to TransitionMutator
Convert afdoDepsMutator and afdoMutator to a TransitionMutator as a
step towards variants-on-demand.

Bug: 319288033
Test: afdo_test.go
Change-Id: Ib05845455ccf43a07b3915a0d7b0a95896062f13
2024-01-26 11:08:32 -08:00
Colin Cross
33e0c81093 Convert orderfile mutators to TransitionMutator
Convert orderfileDepsMutator and orderfileMutator to a TransitionMutator
as a step towards variants-on-demand.

Bug: 319288033
Test: orderfile_test.go

Change-Id: I27df65b7264a5b059a900e7ea04c18dfb2787a84
2024-01-26 11:06:45 -08:00
Colin Cross
6ac83a8f85 Convert LTO mutators to TransitionMutator
Convert ltoDepsMutator and ltoMutator to a TransitionMutator as a
step towards variants-on-demand.

Bug: 319288033
Test: lto_test.go
Change-Id: I2c9af73fd526adf58ff626831ababea466338205
2024-01-26 11:06:45 -08:00
Colin Cross
e28cdf362e Merge "Convert coverageMutator to a TransitionMutator" into main 2024-01-25 23:19:29 +00:00
Treehugger Robot
471e181f92 Merge "Replace goldmont-without-xsaves build with goldmont-without-sha-xsaves" into main 2024-01-25 08:11:40 +00:00
Treehugger Robot
2a7e184383 Merge "Export clang coverage flags" into main 2024-01-25 06:18:23 +00:00
Colin Cross
f5f4ad3db6 Convert coverageMutator to a TransitionMutator
Convert coverageMutator to a TransitionMutator as a step towards
variants-on-demand.

Bug: 319288033
Test: coverage_test.go
Test: treehugger coverage builds
Change-Id: Ic50c0040dea8b42c36b5d784221daa00b7b0d379
2024-01-24 10:17:10 -08:00
Satoshi Niwa
b6d818dbf0 Replace goldmont-without-xsaves build with goldmont-without-sha-xsaves
For chromebooks, we need a new build variant whose target arch is
goldmont, but without SHA and XSAVES support (b/314243939#comment21)

Bug: 314243939
Test: Build an image with TARGET_ARCH_VARIANT:=goldmont-without-sha-xsaves
Change-Id: If73660b515b443d5c138ca367fa3d1c6f18485b5
2024-01-24 16:27:56 +09:00
Treehugger Robot
1e33a311c6 Merge "Really disable auto-vectorization." into main 2024-01-23 17:46:58 +00:00
Yi-Yo Chiang
88960aa827 cc: Vendor modules should NOT derive its "SDK" level from VNDK
Although vendor modules can be built bundled, they are technially not
part of the "platform", as it cannot access platform libraries (system
partition) directly.
They can only link to a restricted set of platform libraries (LLNDK),
and access restricted set of APIs.
We used to derive the LLNDK API level from the VNDK version. However
after VNDK deprecation, there is no "VNDK version" anymore.
Instead we would just derive the value from platform SDK version:
* If building an in-development build, build vendor modules against the
  in-development "current" API level.
* If building a REL / Final build, vendor should target the latest
  stable API.

Bug: 320423828
Test: go test
Test: presubmit
Test: build and boot
Change-Id: I2c5ef6530e9046b2dcc282bc1f020d8a505eab15
2024-01-23 12:43:38 +08:00
Elliott Hughes
2ced4b5c66 Greatly reduce build warning spam.
No-one ever fixes unused-* or deprecated-* warnings in external/ (nor should they!).

-Wno-deprecated-enum-enum-conversion should probably have been added
next to -Wno-deprecated-anon-enum-enum-conversion when it was added,
since it's a major spam contributor, and equally unlikely that anyone
will clean them up.

-Wno-deprecated-dynamic-exception-spec is a weird special case because
it should be irrelevant after our next libc++ update, but in the
meantime -- because libc++ is used everywhere -- this is a massive spam
contributor that no-one on Android cares about because we don't use
exceptions (and the people seeing this can't fix libc++ anyway).

Test: local clean builds
Change-Id: I098202337e9e5026c4c5215dbf5a2abf1fbbdca8
2024-01-22 18:34:10 -08:00
Elliott Hughes
6c93f6953f Really disable auto-vectorization.
The previous patch was insufficient. Craig Topper explains:

  -fno-vectorize only disables the loop vectorizer

  -fno-slp-vectorize only disables the SLP vectorizer

  The backend can also use vector instructions for memcpy/memset or
  combining multiple scalar loads and/or stores. That is independent
  of -fno-vectorize.

  -mllvm -vector-bits-min=0 will disable any use of fixed vectors. And
  will make attribute(vector_size) get scalarized.

  -mno-implicit-float will disable both vectorizers and
  prevent the backend for using vectors for memcpy/memset
  oor multiple scalar loads/stores. It will not affect
  attribute(vector_size). -mno-implicit-float also prevents scalar
  floating point instructions from being used for anything that didn’t
  use float/double/_Float16/etc. type in source, but I don’t think that
  happens on RISC-V today. 32-bit X86 can use a 64-bit x87 FP load as an
  atomic load for uint64_t, for example. Basically -mno-implicit-float
  is supposed to prevent the compiler from using FP or vectors when the
  source doesn’t explicitly use FP or vectors.

So -mno-implicit-float was what we were actually looking for here. I've
done a clean build with this change, and see only the expected
(hand-written assembler) vector code in bionic, and the ART
ClassLinker::LoadClass() issue is gone too. As far as I can tell, the
remaining vector code is all deliberate in that sense.

We may still end up back here again, to change "gcv" to "gc", but that
still requires some code changes just to build, and still makes it less
obvious that this is just a temporary workaround for a qemu bug
(specifically https://gitlab.com/qemu-project/qemu/-/issues/1976).

Bug: http://b/320416684
Test: objdump
Change-Id: Ibd104e4289d6d1aaf441efa0440fedc90e3da29a
2024-01-22 15:00:21 -08:00
Pirama Arumuga Nainar
5376892762 [riscv64] disable vectorizer during LTO
With LTO, vectorization needs to be disabled separately in the linker flags as well.

Change-Id: I71d813974a9b7a40954d3dab5b1704baed610fd0
2024-01-19 23:02:01 +00:00
AdityaK
431c0b9c8e Pass jump-is-expensive flag both to compiler and linker
Change-Id: I89e30f98188aed4c5076a34f150e80386fc63f48
2024-01-19 07:32:59 -08:00
Colin Cross
1b1b9a937b Merge changes from topic "soong-tests-presubmit" into main
* changes:
  Add script to run Soong tests with go tools
  Disable TestVariantSingletonModule when go test -short is used
  Fix data race in propagateRROEnforcementMutator
  Fix data race in finder_test.go
  Fix data race in dex_bootjars
  Fix race CommonGlobalCflags when running tests in parallel.
  Fix data race in snapshot singletons when running parallel tests
2024-01-18 23:58:45 +00:00
Elliott Hughes
c0ea850bfb Disable auto-vectorization.
Until https://gitlab.com/qemu-project/qemu/-/issues/1976 is fixed, this
is just causing too much confusion and wasted time.

Removing V from the architecture string has the same effect, but
requires some code changes (to be able to compile code that's
_explicitly_ using V), and makes it less obvious that this is just a
temporary workaround for a qemu bug.

Bug: http://b/320416684
Test: objdump
Change-Id: Iec7d63ab227b31f82f530dabbdc4f3aa54277f04
2024-01-17 14:24:53 -08:00
Colin Cross
bcf53701b7 Fix race CommonGlobalCflags when running tests in parallel.
Clone the commonGlobalCflags global variable when modifying it so that
it gets a unique object per context.

Test: go test -race ./...
Change-Id: Ia4b91c40939d4b4d338bd11e4d4f523521874548
2024-01-17 11:11:03 -08:00
Kiyoung Kim
8487c0b876 Soong works with empty VNDK version
This change is to fix more misc issues to enable Soong without VNDK
version. This change contains

* Update properties in generated Android.mk
* Update VNDK APEX build to work without VNDK version

Bug: 316829758
Test: AOSP Cuttlefish build succeeded
Change-Id: I10f3c798299afe2d539ec3426b8e2b6068a158f6
2024-01-15 17:31:10 +09:00
Gabriel Chen
1589c9699b Export clang coverage flags
Configurate clang coverage flags in soong and export to makefile.

Change-Id: I47a89e4131893b8813b10a6582f8b487b3700b91
2024-01-12 11:19:24 -08:00
JaeMan Park
1c4cc3d40e Merge "Disable tidy checks for generated code" into main 2024-01-11 02:18:21 +00:00
Hsin-Yi Chen
1c683b372d Merge "Do not build ABI dumps for VNDK" into main 2024-01-11 02:00:45 +00:00
LaMont Jones
afe7baf47d Propagate aconfig providers for more modules.
Bug: 308625757
Test: manual
Change-Id: Iaf6d45a4259f1c6c34476c34c431344283ae2830
2024-01-10 14:03:30 +00:00
LaMont Jones
acae2d7656 move SetAconfigFileMkEntries to android
This will need to be called by some modules handled in android.

Bug: 308625757
Test: manual
Change-Id: Ic56e8ef3a453c59866aab6d39a21108cf8536b56
2024-01-10 14:03:29 +00:00
JaeMan Park
3dba4d2c60 Disable tidy checks for generated code
Generated codes like cpp code from *.ll for *.yy files always run
clang-tidy, when generated code has warning, where is no way to fix it.

So, disable clang-tidy for generated code.

Bug: 162909698
Test: go test android/soong/cc
Change-Id: I0fee137d6170ef4bf6cf641abad572e448aceaa1
2024-01-10 16:29:51 +09:00
Treehugger Robot
395c47f635 Merge "Generate VNDK independent image variant with cc genrule" into main 2024-01-10 02:51:34 +00:00
Kiyoung Kim
4c41458f9c Merge "Split usage of UseVndk" into main 2024-01-10 01:15:45 +00:00
Kiyoung Kim
853e391eca Generate VNDK independent image variant with cc genrule
Image variants for CC modules were covered to work without VNDK version
from previous commit, but CC genrule has its own image variant rule, so
it should be also updated to generate vendor / product image variant
without VNDK version.

Bug: 316829758
Test: m nothing --no-skip-soong-tests passed
Test: AOSP cuttlefish build succeeded

Change-Id: I425dd425efcc57c7ff8f9964b303ad6f539c3b57
2024-01-10 10:13:31 +09:00
Elliott Hughes
10363161e7 "master" was renamed "main".
Test: N/A
Change-Id: I86d5578eaac260e55a9583db7ab49812b4ba1f5d
2024-01-09 22:09:07 +00:00
Hsin-Yi Chen
27bafd02e0 Do not build ABI dumps for VNDK
Since VNDK in the main branch will not be finalized, this commit
deletes the build rules that generate the ABI dumps.

Test: make
Bug: 314010764
Change-Id: I2bbab7612d8cbc27312dc4a3c47a0592177918d8
2024-01-09 12:58:16 +08:00
Kiyoung Kim
aa39480d21 Split usage of UseVndk
UseVndk is a function to check if the module can use VNDK libraries, but
this function was also used to check if the module is installed in the
treblelized partition (vendor or product). As of VNDK deprecation,
UseVndk funtion will return false even when the module is installed in
vendor / product partition, so we need a separated function to check
this. This change introduces a new function 'InVendorOrProduct' which
replaces UseVndk based on its usage.

Bug: 316829758
Test: m nothing --no-skip-soong-tests passed
Change-Id: Ic61fcd16c4554c355f6005894a4519b044b27fe5
2024-01-09 11:37:14 +09:00
Vladimír Marko
80abaa85e8 Merge "Add a new x86(_64) arch variant "goldmont-without-xsaves"" into main 2024-01-05 12:29:33 +00:00
Kiyoung Kim
6284e0a935 Merge "Generate image variation without version" into main 2024-01-05 04:57:26 +00:00
Kiyoung Kim
b5fdb2e966 Generate image variation without version
Current CC/Rust Image variations are generated with target VNDK version.
However, this is no longer valid if VNDK is deprecated. This change
generates image variation without version ("vendor", "product") if VNDK
is deprecated.

Bug: 316829758
Test: m nothing --no-skip-soong-tests passed
Test: aosp_cf_x86_64_phone build succeeded
Change-Id: I2387ed8a2632bfd9462621f882a947695ae1653d
2024-01-05 11:15:23 +09:00
Spandan Das
01f17ffc54 Merge "Skip unique apex_available enforcement on libz (a stub library)" into main 2024-01-04 17:43:52 +00:00
Spandan Das
1a0c6e19f7 Skip unique apex_available enforcement on libz (a stub library)
libz is a stub library, but needs to be available to runtime apex
because it gets statically linked into bionic linker

Bug: 281077552
Bug: 277651159
Test: m nothing
Change-Id: I04f6f13768d8f9c160ce84202e2003b195176355
2024-01-04 01:52:28 +00:00
Steven Moreland
98aa78ab22 Merge "validate tags for typos" into main 2024-01-04 00:26:54 +00:00
Steven Moreland
62d10495eb Merge "fuzz packaging: implement system/vendor split" into main 2024-01-03 22:14:24 +00:00
Steven Moreland
8d5b9d01e9 validate tags for typos
it turns out there were typos which are now fixed :D

Bug: 317293882
Test: build tree
Change-Id: I91dc08f00e8dd2e9dcb9101307d9b04bdcadea11
2024-01-03 21:48:03 +00:00
Colin Cross
36ce95848b Merge "Use ModuleInfoJSONProvider for cc modules" into main 2024-01-03 19:27:51 +00:00
Colin Cross
4a9e6ec903 Use ModuleInfoJSONProvider for cc modules
LOCAL_STATIC_LIBRARIES, LOCAL_WHOLE_STATIC_LIBRARIES,
and LOCAL_HEADER_LIBRARIES are only  exported to Make
so that it can generate module-info.json.  Export
ModuleInfoJSONProvider from cc modules so that Soong can
generate the module-info.json entries, and remove the
properties from the generated Android.mk.  This will prevent
Kati reanalysis when making some Android.bp changes.

Bug: 309006256
Test: Compare module-info.json
Test: Compare Kati's build.ninja
Change-Id: I6660f6802b9cea46eed553cac12f09a373eeb019
2024-01-02 16:06:09 -08:00
Steven Moreland
d86fec5495 fuzz packaging: implement system/vendor split
This wasn't needed when fuzzers had their own
lib directories, but because the lib directories
were combined, this caused interactions because
system and vendor libraries were mixed in the
same folder, sometimes overriding each other.

Comments are left with some details about
future issues. Bug has a series of recommendations
to prevent issue again.

The main goal of this patch is to get the fuzzers
working, not fix every issue here.

Bug: 307611931
Test: run vendor fuzzer and check lsof:

    android.hardwar 22719       root  txt       REG             254,94   4350056       3455 /data/fuzz/x86_64/android.hardware.drm-service.<name>.aidl_fuzzer/vendor/android.hardware.drm-service.<name>.aidl_fuzzer
    android.hardwar 22719       root  mem       REG             254,94   4350056       3455 /data/fuzz/x86_64/android.hardware.drm-service.<name>.aidl_fuzzer/vendor/android.hardware.drm-service.<name>.aidl_fuzzer
    android.hardwar 22719       root  mem       REG             254,94   1047232       3464 /data/fuzz/x86_64/lib/vendor/libbase.so
    android.hardwar 22719       root  mem       REG             254,94   4027304       3460 /data/fuzz/x86_64/lib/vendor/libcrypto.so
    android.hardwar 22719       root  mem       REG             254,94   4021632       3467 /data/fuzz/x86_64/lib/vendor/libbinder.so
    android.hardwar 22719       root  mem       REG             254,94    329408       3466 /data/fuzz/x86_64/lib/vendor/libcutils.so
    android.hardwar 22719       root  mem       REG             254,94    508968       3463 /data/fuzz/x86_64/lib/vendor/libutils.so
    android.hardwar 22719       root  mem       REG             254,94    592944       3465 /data/fuzz/x86_64/lib/vendor/libclang_rt.ubsan_standalone-x86_64-android.so
    android.hardwar 22719       root  mem       REG             254,94   2328616       3462 /data/fuzz/x86_64/lib/vendor/libc++.so

and run a system fuzzer

    servicemanager_ 27878       root  txt       REG             254,94    609736      67408 /data/fuzz/x86_64/servicemanager_fuzzer/servicemanager_fuzzer
    servicemanager_ 27878       root  mem       REG             254,94    609736      67408 /data/fuzz/x86_64/servicemanager_fuzzer/servicemanager_fuzzer
    servicemanager_ 27878       root  mem       REG             254,94   4390560       4074 /data/fuzz/x86_64/lib/libvintf.so
    servicemanager_ 27878       root  mem       REG             254,94     13872       4077 /data/fuzz/x86_64/lib/libvndksupport.so
    servicemanager_ 27878       root  mem       REG             254,94     13872       4077 /data/fuzz/x86_64/lib/libvndksupport.so
    servicemanager_ 27878       root  mem       REG             254,94     13872       4077 /data/fuzz/x86_64/lib/libvndksupport.so
    servicemanager_ 27878       root  mem       REG             254,94     11584       4086 /data/fuzz/x86_64/lib/libdl.so

and run a system fuzzer

    servicemanager_ 27878       root  txt       REG             254,94    609736      67408 /data/fuzz/x86_64/servicemanager_fuzzer/servicemanager_fuzzer
    servicemanager_ 27878       root  mem       REG             254,94    609736      67408 /data/fuzz/x86_64/servicemanager_fuzzer/servicemanager_fuzzer
    servicemanager_ 27878       root  mem       REG             254,94   4390560       4074 /data/fuzz/x86_64/lib/libvintf.so
    servicemanager_ 27878       root  mem       REG             254,94     13872       4077 /data/fuzz/x86_64/lib/libvndksupport.so
    servicemanager_ 27878       root  mem       REG             254,94     13872       4077 /data/fuzz/x86_64/lib/libvndksupport.so
    servicemanager_ 27878       root  mem       REG             254,94     13872       4077 /data/fuzz/x86_64/lib/libvndksupport.so
    servicemanager_ 27878       root  mem       REG             254,94     11584       4086 /data/fuzz/x86_64/lib/libdl.so

Change-Id: I91a51d2f1cb537cfaae8379998078188f2b10a98
2023-12-28 03:04:20 +00:00
Colin Cross
225ad7e8b2 Merge "Remove cc.moduleContext override of android.ModuleContext.*Specific" into main 2023-12-19 23:39:54 +00:00
LaMont Jones
aa005ae080 move CollectDependencyAconfigFiles to android
This needs to be called by some modules in android.

Bug: 308625757
Test: manual
Change-Id: I389fcfd88a3f4bd85a9218fdd4dd66d8a239bb67
2023-12-19 19:34:00 +00:00
Colin Cross
ea30d85a65 Remove cc.moduleContext override of android.ModuleContext.*Specific
Overriding android.ModuleContext's implementations of *Specific()
methods in cc.moduleContext and then passing that back to
android.PathForModuleInstall to affect the install path causes
problems if android.ModuleBase.GenerateBuildActions also tries
to call android.PathForModuleInstall directly with the
android.ModuleContext as it gets a different result.

Add InstallIn* methods to the android.Module interface, implement
default versions in android.ModuleBase, and override them in
cc.Module and rust.Module.  Use them in android.PathsForModuleInstall
to allow the module to customize the behavior directly.

Test: TestInstallPartition
Change-Id: I7840e07eae34ac4f4d3490b021143d5f33a83626
2023-12-18 15:07:05 -08:00
Satoshi Niwa
c41f21121c Add a new x86(_64) arch variant "goldmont-without-xsaves"
Its target arch is goldmont, but without xsaves support.
This ensures efficient execution on a broad range of Intel/AMD CPUs used
in Chromebooks, including those lacking xsaves support.
(e.g. Kaby Lake, Gemini Lake, Alder Lake and AMD Zen series)

Bug: 314243939
Test: Build an image with TARGET_ARCH_VARIANT:=goldmont-without-xsaves
Change-Id: I9963cc3356394815f068fc998a9708bdb30c8266
2023-12-15 14:25:55 +09:00