Commit graph

8659 commits

Author SHA1 Message Date
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
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
Yu Liu
aa89f2c61b Only link the profile extras lib for device variant.
Bug: 297082598
Test: CI
Change-Id: I455b39119c27b45b368a80cab2901d496a250b96
2023-12-12 23:07:33 +00: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
Yi Kong
9723e338ee Do not perform AFDO or optimizing LTO for eng builds
Afdo creates more variants to build, and optimizing LTO is costly to
perform. Turn off these two optimizations for eng builds for a faster
build speed.

This reduces total C/C++ invocation time for aosp_arm64-eng by 6.28%.

Test: presubmit
Bug: 307753064
Change-Id: Ibac4269c66a64e896dba2074b607d71a2da37546
2023-12-04 19:04:00 +09:00
Jooyung Han
85707de8c1 Add cc_library.target.vendor.no_stubs
This is to handle libz special case. libz has stubs but not an LLNDK.
So, libz.vendor should be treated as non-stub-providing libraries and
Vendor APEX should bundle it if it's used by its contents.

libz will set no_stubs for vendor/product variants.

Bug: 313806237
Test: go tests ./apex/...
Change-Id: I10759d7073838909126f8bfe87654f11aa02fd32
2023-12-04 11:06:20 +09:00
Colin Cross
f61d03d241 Add TestContext parameter to ContentFromFileRuleForTests
The next CL will need a TestContext parameter in
ContentFromFileRuleForTests in order to retrieve the file rule contents
from the Config.  Add it and update all the tests that use it in order
to simply review of the next CL.

Bug: 306029038
Test: go test ./...
Change-Id: Ia4b4c9854017ea3472fa2f8ba42cf7f72720496e
2023-12-03 17:22:56 -08:00
Elliott Hughes
bee01f7d62 riscv64: disable a weird option.
By default clang assumes that on riscv64 jumps are really expensive.
That's probably not true for the kind of SoCs we're dealing with, but
more importantly (see the bug) it causes clang to do loads from the
right hand side of a `&&` before the left hand side has been evaluated.
This found one latent bug in libcore, and it doesn't seem like the best
use of anyone's time to have to chase similar issues if they're going
to be similarly latent for riscv64 when we get clang's default fixed.

Bug: https://github.com/google/android-riscv64/issues/124
Test: treehugger
Change-Id: I640f1b43ea3d2452366ab86e97a9189fa9f5326c
2023-12-01 17:39:20 -08:00