Commit graph

8563 commits

Author SHA1 Message Date
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
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
Colin Cross
5a37718c95 Convert ModuleProvder to generic providers API
Convert all of the callers of ModuleProvider/ModuleHasProvider to use the
type-safe android.SingletonModuleProvider API.

Bug: 316410648
Test: builds
Change-Id: I6f11638546b64749e451cebbf33140248dc1d193
2023-12-14 16:12:22 -08:00
Colin Cross
313aa5475f Convert OtherModuleProvider to generic providers API
Convert all of the callers of OtherModuleProvider/OtherModuleHasProvider
to use the type-safe android.OtherModuleProvider API.

Bug: 316410648
Test: builds
Change-Id: Id77f514d68761a262d9ea830a601dbed804bbbe5
2023-12-14 16:12:22 -08:00
Colin Cross
ff694a8c88 Convert Provider to generic providers API
Convert all of the callers of Provider/HasProvider to use the type-safe
android.ModuleProvider API.

Bug: 316410648
Test: builds

Change-Id: I73479de1625fa2865b6c73444cd477e50d56dc5a
2023-12-14 16:12:21 -08:00
Colin Cross
402130276c Convert SetProvider to generic providers API
Convert all of the callers of SetProvider to use the type-safe
android.SetProvider API.

Bug: 316410648
Test: builds
Change-Id: If58f4b5355264ddab2045bc3591a4eac19cd58fc
2023-12-14 16:12:20 -08:00
Colin Cross
bc7d76cca2 Convert NewProvider/NewMutatorProvider to generic providers API
Convert all of the callers to NewProvider and NewMutatorProvider
to use a generic type parameter instead of an example object.

Bug: 316410648
Test: builds
Change-Id: Ic9cdafc87336e26730d3fd596df05de0e7267542
2023-12-14 16:12:20 -08:00
Colin Cross
3c0a83d19f Use generics for providers API
Using generics for the providers API allows a type to be associated
with a ProviderKey, resulting in a type-safe API without that doesn't
require runtime type assertions by every caller.

Unfortunately, Go does not allow generic types in methods, only in
functions [1].  This prevents a type-safe API on ModuleContext, and
requires moving the API to be functions that take a ModuleContext as
a parameter.

This CL creates the new API, but doesn't convert all of the callers.

[1] https://go.googlesource.com/proposal/+/refs/heads/master/design/43651-type-parameters.md#no-parameterized-methods)

Bug: 316410648
Test: builds
Change-Id: I3e30d68b966b730efd968166a38a25cc144bd6de
2023-12-14 16:12:20 -08:00
Yu Liu
6dc93f9a09 Properly package aconfig files for vendor partition
Bug: 311173471
Test: Unit tests
Change-Id: Ibb857b69c3f83326a9ff5732e11dd09887e4ba6e
2023-12-14 01:19:35 +00:00
Elliott Hughes
a19d9597cb Avoid -target riscv64-linux-androidVanillaIceCream.
clang silently ignores such things rather than reporting them as errors.

With this change, verbose.log.gz says android10000 instead, as expected.

Bug: https://buganizer.corp.google.com/issues/315788463#comment24
Test: treehugger
Change-Id: I0d92b0747912f28065de0d2dc6b4d33d1c2c9857
2023-12-13 12:10:28 -08:00
Wei Li
5f5d271fc3 Build native libraries used by layoutlib.
Bug: 303904212
Test: m layoutlib dist; CIs
Change-Id: Id77cba97b2f66997431beb78ecc9d9b74b64b803
2023-12-12 05:06:20 +00:00
Colin Cross
8ff105860d Remove ConvertWithBp2build implementations
Remove the ConvertWithBp2build implementations from all the module
types, along with the related code.

Bug: 315353489
Test: m blueprint_tests
Change-Id: I212672286686a318893bc7348ddd5a5ec51e77a7
2023-12-08 13:51:05 -08:00
Colin Cross
d788b3e6cb Merge aconfig files per-module
Passing the list of all transitive aconfig files to Make causes extra
Kati analysis runs when dependencies are changed in Android.bp files.
Since Make is going to merge them anyways, merge them per-module and
pass a single aconfig file to Make for each module.

Fixes: 313698230
Test: m out/target/product/vsoc_x86_64/system/etc/aconfig_flags.pb
Change-Id: Ifde4826bc93bc06e40338f72b4cb39eed26ca08d
2023-12-07 04:17:37 +00:00
LaMont Jones
7dcbf427f9 Merge "cc: export LOCAL_ACONFIG_FILES for printflags" into main 2023-12-06 18:01:17 +00:00
Vilas Bhat
3ad4cf3a9a Merge "16k: soong: Update DevicePageSizeAgnostic to DeviceNoBionicPageSizeMacro" into main 2023-12-06 13:16:19 +00:00
Aleksei Vetrov
fb510be871 Merge "Move NDK ABI monitoring enabling flag to release flags" into main 2023-12-06 11:11:35 +00:00
Aleksei Vetrov
146e9824c5 Move NDK ABI monitoring enabling flag to release flags
Currently NDK ABI monitoring is enabled by switching boolean flag in
soong code. When this flag is switched, it will enable ABI monitoring in
all release configurations at once.

This change moves the flag from soong code to the trunk-stable flags
framework ("build/release/build_flags.scl") that allows to enable it
only in specific configurations like "trunk-staging".

Test: TH
Bug: 156513478
Change-Id: Ibb810a834c0d756b22782b1a2d8ec5a5e575a4b3
2023-12-05 23:52:46 +00:00
Vilas Bhat
b3d2d22a5d 16k: soong: Update DevicePageSizeAgnostic to DeviceNoBionicPageSizeMacro
This is part of a larger change to update the flag
PRODUCT_PAGE_SIZE_AGNOSTIC to PRODUCT_NO_BIONIC_PAGE_SIZE_MACRO.
This is to help clarify that this flag doesn't mean the device
will actually work end-to-end with any page size.

Bug: 312541564
Test:
```
source build/envsetup.sh
lunch aosp_cf_arm64_phone_pgagnostic-trunk-userdebug
m
cat out/soong/build.aosp_cf_arm64_phone_pgagnostic.ninja | grep __BIONIC_NO_PAGE_SIZE_MACRO
```

Change-Id: I33033876d0d4a276d1bb962d40315b71a3968c66
2023-12-05 23:49:50 +00:00
LaMont Jones
c71f79e3ff cc: export LOCAL_ACONFIG_FILES for printflags
Bug: 308625757
Test: manual
Change-Id: I211fe4736098bdca040c2a58b8b5e468c9d2e542
2023-12-05 20:46:06 +00:00
Aditya Choudhary
26df39fe44 Add source file provider for genrule/srcs, python libraries and rust libraries.
Change-Id: I2d7d4684a10c15aeecc27b8db800ab27a807d2e2
2023-12-05 19:56:26 +00:00
Treehugger Robot
fedbb5c3be Merge changes from topics "libz-no-stubs-for-vendor", "vendor-etc-linker-config" into main
* changes:
  Generate vendor specific STUB_LIBRARIES
  Add cc_library.target.vendor.no_stubs
2023-12-05 05:47:08 +00:00
Treehugger Robot
e0a5c5ae1d Merge "Define __ANDROID_VENDOR_API__" into main 2023-12-05 03:48:26 +00:00
Yi Kong
e2b87d7401 Merge "Do not perform AFDO or optimizing LTO for eng builds" into main 2023-12-05 03:00:17 +00:00
Colin Cross
2998c33d43 Merge "Add TestContext parameter to ContentFromFileRuleForTests" into main 2023-12-05 00:29:10 +00:00
Jooyung Han
9582159c4d Generate vendor specific STUB_LIBRARIES
When generating vendor/etc/linker.config.pb, STUB_LIBRARIES was used.
Because it lists *all* libraries with stubs regardless of its
install location (vendor or system), using it for vendor
linker.config.pb doesn't make sense. Instead, use vendor-specific
STUB_LIBRARIES, which is named SOONG_STUB_VENDOR_LIBRARIES.

Bug: 313806237
Test: m (aosp_cf_x86_64_phone)
Test: $OUT/vendor/etc/linker.config.pb not listing libz.so
Change-Id: Icd0aaf92d9630c07f58c4739a9f0ac713516db43
2023-12-05 08:24:38 +09:00