Commit graph

1068 commits

Author SHA1 Message Date
Andrew Walbran
a5deb7307d Revert^4 "Integrate Rust-specific System Properties into rules generation."
This reverts commit 2766baa922.

Reason for revert: Relanding after fix in I3b190ebc1a1096972d0a1273e490972e04684dd2

Change-Id: Ie34301c506d3469ec3306f433631b0842b66d032
2024-02-21 11:53:18 +00:00
Joonhun Shin
af9fc549ca Merge "Revert "Make building Rust targets faster in eng builds"" into main 2024-02-16 07:56:01 +00:00
Joonhun Shin
fad3e69d7f Revert "Make building Rust targets faster in eng builds"
This reverts commit 6146cf4b98.

Reason for revert: <b/325547632>

Change-Id: Ifd3619c5db5b989edb4aa2c37f85e5cd88d0c633
2024-02-16 07:26:14 +00:00
Chris Wailes
3fae67a32d Merge "Make building Rust targets faster in eng builds" into main 2024-02-15 23:12:27 +00:00
Paul Duffin
a0f0bdbced Merge "Revert^3 "Integrate Rust-specific System Properties into rules generation."" into main 2024-02-15 12:45:47 +00:00
Paul Duffin
2766baa922 Revert^3 "Integrate Rust-specific System Properties into rules generation."
This reverts commit ac0c87311d.

Reason for revert: breaking the same bug, b/323833345 as before

Change-Id: I474c032148f22c4b98f7adf23be61807fa0500a0
2024-02-15 11:54:17 +00:00
Andrew Walbran
e38e2c0071 Merge "Revert^2 "Integrate Rust-specific System Properties into rules generation."" into main 2024-02-15 10:31:49 +00:00
Andrew Walbran
ac0c87311d Revert^2 "Integrate Rust-specific System Properties into rules generation."
This reverts commit be3ea4f149.

Reason for revert: Reland

Change-Id: Ic003c52a1477da9a6a70b82e4d4ae4a55edc584f
2024-02-14 10:25:55 +00:00
Ivan Lozano
c2d4959bb4 Merge "rust: Re-enable host address sanitizer." into main 2024-02-13 16:34:42 +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
Ivan Lozano
357433ae73 rust: Re-enable host address sanitizer.
Our toolchain supports a flag "-Z external-clangrt=true" which prevents
rustc from emitting a missing dependency to librust-dev_rt. Instead, we
link in libclang_rt.

Bug: 304507701
Bug: 324826914
Test: SANITIZE_HOST=address m aconfig
Change-Id: I8020c550b7a922c80620f61c22e01848a4f4a349
2024-02-12 14:16:26 -05:00
Stephen Hines
f8ffb6d4c2 Allow clippy::unnecessary_fallible_conversions
This lint is part of Rust 1.75.0, but has a lot of problems with FFI
data types that change size between 32-bit and 64-bit targets. This
makes the lint check far less useful, so we are just globally
suppressing it for now.

Bug: http://b/321303117
Test: m
Change-Id: I39531c961a26f533451d73b025caca02e593a269
2024-02-09 15:36:35 -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
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
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
Rico Wind
444d6b68ae Merge "Revert "Integrate Rust-specific System Properties into rules generation."" into main 2024-02-05 14:41:56 +00:00
Rico Wind
be3ea4f149 Revert "Integrate Rust-specific System Properties into rules generation."
This reverts commit 65374edd0e.

Reason for revert: b/323833345

Change-Id: Ia722b68923617b4abfe3fd96b54b3fe108e9de74
2024-02-05 14:02:56 +00:00
Andrew Walbran
4b8e361b4c Merge "Integrate Rust-specific System Properties into rules generation." into main 2024-02-05 10:50:59 +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
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
Treehugger Robot
838b29ebc7 Merge "Rename LOCAL_USE_VNDK" into main 2024-02-02 02:48:35 +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
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
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
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
e28cdf362e Merge "Convert coverageMutator to a TransitionMutator" into main 2024-01-25 23:19:29 +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
Chris Wailes
c0f587029a rustc-1.74.1 Build 11331546
Bug: https://issuetracker.google.com/issues/310977762
Test: m rust
Change-Id: Ia3a5bcd1c63e09d1fd4e399598d4ab25245b7af4
2024-01-19 01:40:19 -08: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
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
Steven Moreland
62d10495eb Merge "fuzz packaging: implement system/vendor split" into main 2024-01-03 22:14:24 +00: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
Ludovic Barman
78b2519e19 Remove unused use_protobuf3 flag
This is a No-op.
Protobuf3 is used regardless of this flag since https://android-review.git.corp.google.com/c/platform/build/soong/+/2817733

Test: m rust

Bug: 308790516
Change-Id: I1bfbca5d8a30e4e10f03e4e045d6c6ceddb30c87
2023-12-21 17:53:51 +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
Colin Cross
51428c451a Merge changes I6f116385,Id77f514d,I73479de1,If58f4b53 into main
* changes:
  Convert ModuleProvder to generic providers API
  Convert OtherModuleProvider to generic providers API
  Convert Provider to generic providers API
  Convert SetProvider to generic providers API
2023-12-18 22:43:45 +00:00
Colin Cross
b2c65a26d6 Merge changes from topic "provider_generics" into main
* changes:
  Convert NewProvider/NewMutatorProvider to generic providers API
  Use generics for providers API
  Fix TestAarImportProducesJniPackages/aar-no-jni
2023-12-18 19:15:39 +00:00
Ludovic Barman
19739bf6a5 Rust protobuf 2->3: Update build system
tldr: remove protobuf2 from Android Rust and upgrade everything to pb3.

These commits update:
- The grpcio rust crate to use protobuf 3
- The build system to always use the new libprotobuf (pb3) instead of the _deprecated variant (for pb2); they also force-enable libprotobuf everywhere, ignoring the use_protobuf3 flag, removes the tests related to pb2
- The following modules, which required syntax changes:
-- packages/modules/Bluetooth
-- device/google/cuttlefish
-- vendor/auto

Bug: 308790516
Test: m rust
Ignore-AOSP-First: must be done in main to upgrade cuttlefish+vendor with the rest all at once
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:7d0783ce22b3d7d369786d4b16067c79c033185b)
Merged-In: I1d07c433aca41ccfe2e710821cf930c413dc12d6

Change-Id: I1d07c433aca41ccfe2e710821cf930c413dc12d6
2023-12-15 13:23:33 +00: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