Commit graph

8526 commits

Author SHA1 Message Date
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
Elliott Hughes
198583ed20 Merge "riscv64: stop explicitly disabling emutls." into main 2023-12-01 20:28:09 +00:00
Colin Cross
0d5dd390c6 Merge "Move test data installation to Soong" into main 2023-12-01 18:56:01 +00:00
Tomasz Wasilczyk
a1d45b8ec1 Merge "Bump default experimental from gnu++2a to gnu++2b." into main 2023-12-01 17:21:01 +00:00
Elliott Hughes
74780e61dc riscv64: stop explicitly disabling emutls.
riscv64 has always had ELF TLS (and the emutls bugs have been fixed now
too).

Test: treehugger
Change-Id: I8dd1d28d4f28a442130e4cf536166ea733f16a96
2023-12-01 02:08:05 +00:00
Colin Cross
5c1d5fb21b Move test data installation to Soong
To generate module-info.json in Soong for b/309006256 Soong needs to
know the test data paths. Moving test data installation into Soong will
also help later for test suite packaging.

Add ModuleContext.InstallTestData that installs the files listed in a
[]DataPath alongside the test.  The files will also be passed to Make
to allow it to continue packaging them into the test suites for now.

Update the module types that are producing LOCAL_TEST_DATA entries
in their Android.mk files to go through InstallTestData instead.

Bug: 311428265
Test: atest --host toybox-gtests --test-timeout=120000
Change-Id: Ia8b964f86e584ea464667fd86a48d754d118bead
2023-11-30 13:38:49 -08:00
Yu Liu
9dc6b1025d Merge "Add container property to aconfig_declarations." into main 2023-11-30 21:33:34 +00:00
Tomasz Wasilczyk
37d6943f37 Merge "Bump the default from gnu++17 to gnu++20." into main 2023-11-30 15:15:12 +00:00
Justin Yun
41cbb5e9b5 Define __ANDROID_VENDOR_API__
cc modules can use __ANDROID_VENDOR_API__ to read BOARD_API_LEVEL
that is the API level of the vendor surface.

Bug: 313822931
Test: check ninja commands to have -D__ANDROID_VENDOR_API__=<version>
Change-Id: Iceb5918cbfce0f24929d02d7e3caf1e9942b88e8
2023-11-30 05:26:12 +00:00
Yi Kong
33914a613f Merge "Remove PGO build support" into main 2023-11-29 07:35:14 +00:00
Yu Liu
eae7b36699 Add container property to aconfig_declarations.
Bug: 311155208
Test: Unit test
Change-Id: I7b187138856d0144203961e82b6dad5e2f8eed9d
2023-11-28 12:37:02 -08:00
Jooyung Han
9ffbe83028 Add non_apex.exclude_shared_libs to cc
This can be used to add apex-specific shared_libs to a CC module. It
would be nice if we could have apex.shared_libs. But it would make code
much harder to follow because we need to record the shared_libs list as
"exclude list" for non-apex anyway.

Bug: 312510312
Test: m libhardware libhardware.vendor libhardware.vendor.com.google.cf.ir
  # check DTNEEDED for libapexsupport
  # only apex-variant should have the dependency
Change-Id: I56a3dc280127d8ba44337707444ea226a49ccf0f
2023-11-28 22:42:23 +09:00
Yi Kong
9c3f433426 Remove PGO build support
We have removed our final PGO enabled project, time to remove PGO build
support.

Test: presubmit
Change-Id: I14ccd0fc8e3fbb8b3015072245fafd0eebe3ec08
2023-11-24 17:14:27 +09:00
Yi Kong
78a456e771 Merge "Remove unneeded MLGO cflag" into main 2023-11-22 06:06:47 +00:00
Yi Kong
8fb0b498db Remove unneeded MLGO cflag
For LTO compilation, we do not need MLGO flags in cflags, since codegen
happens during link only.

Fixes compiler warnings for unused command line argument.

Test: presubmit
Change-Id: I361e4292b10a3582fd5c69fa7b5678c654b44a0f
2023-11-22 06:06:36 +00:00
Pirama Arumuga Nainar
d03958d457 Merge "Revert "Remove flags rejected by RBE input processor"" into main 2023-11-21 23:45:12 +00:00
Pirama Arumuga Nainar
6c771e7d29 Revert "Remove flags rejected by RBE input processor"
This reverts commit a4724a0c4e.

Reason for revert: reclient has an updated deps scanner now.
Bug: http://b/248371171
Test: enable RBE; RBE_CLANG_TIDY_EXEC_STRATEGY=remote; make tidy-soong_subset


(cherry picked from https://android-review.googlesource.com/q/commit:2c36e5efceae94424b513878cf6dc4e9640651ab)
Merged-In: Id876bd7eee1e5606f8dc05903f77f135b47da360
Change-Id: Id876bd7eee1e5606f8dc05903f77f135b47da360
2023-11-21 19:54:27 +00:00
Aditya Choudhary
4b6eaf4bd1 Set testModule to true in cc.NewTest().
This Cl sets testModule field to True in cc.NewTest(). This will cover "cc_test", "cc_test_host" and "art_cc_test".

Change-Id: I4a8db86835b195db34fd9f86560e7bf9321fbd7d
2023-11-21 15:49:19 +00:00
Aditya Choudhary
87b2ab28a8 Add test spec provider to test modules.
Provider added for the following test modules in this change: art_cc_test, cc_benchmark, cc_fuzz, cc_test, cc_test_host, rust_test,and rust_test_host.

Bug: 296873595
Test: Manual test
Change-Id: I815680529bcbecacb3a2bdb8f3746053afdee48c
2023-11-20 21:52:56 +00:00
Colin Cross
4b9d9350bd Merge "Fix soong for go test ./..." into main 2023-11-18 02:30:13 +00:00
Yi Kong
ef2e76edb4 Merge "Revert "afdo: Remove -fprofile-sample-accurate flag"" into main 2023-11-17 22:08:14 +00:00
Colin Cross
7e2e794333 Fix soong for go test ./...
Fix various issues that prevent building or running tests with the
Go tools:

Remove testing/test_spec_proto/go.mod.  There's already a go.mod at
the top level, and adding testing/test_spec_proto/go.mod breaks
compiling with the Go tools in IntelliJ or from the command line.

Fix go vet issues when trying to print []DataPath.

Fix aconfig_conversion_test.go and add it to Android.bp so it runs
in presubmit.

Test: go test ./...
Change-Id: I18af2f05631446fe507744a2951e4b02c7ab59be
2023-11-17 21:28:39 +00:00
Tomasz Wasilczyk
e14961626c Bump default experimental from gnu++2a to gnu++2b.
Bug: 311052584
Test: treehugger
Test: m checkbuild
Change-Id: I5e9d479dd4c14e21fe7d29ea6894f1149fd15e50
2023-11-15 11:46:26 -08:00
Elliott Hughes
c79d9e3053 Bump the default from gnu++17 to gnu++20.
We should update gnu++2a to gnu++2b too, but not in this CL.

Bug: 311052584
Test: treehugger
Test: m checkbuild
Change-Id: I3637444d74868b3a29b425fd749ecbbe1a45fbf7
2023-11-15 11:46:03 -08:00
Yi Kong
0880a82de5 Revert "afdo: Remove -fprofile-sample-accurate flag"
This reverts commit febf8b9bdf.

We are still seeing flaky performance alerts from microbenchmarks even
with this change, and this has caused binary size / memory usage
increase. Let's add this flag back and observe whether performance
regression reports become more frequent.

Change-Id: I0fec1296b1f49b21b59d81add677f6a926ee88dc
2023-11-15 08:51:08 +09:00
AdityaK
76c7385f22 Provide an environment variable to disable mlgo
Helps iterate on compiler that was build without mlgo. Building with mlgo requires a docker image

Change-Id: Ie2988ecaf15031cdb14411abf7b99530e3860cce
2023-11-14 10:24:59 -08:00
Juan Yescas
a74b22e8e6 16k: soong: Add the C flag -D__BIONIC_NO_PAGE_SIZE_MACRO flag to x86-64
To simulate 16k page size in x86-64 cuttefish, it is necessary
to compile the shared libraries and binaries with max-page-size greater
than 4096.

Bug: 309816695
Test: source build/envsetup.sh
      lunch aosp_cf_x86_64_phone_pgagnostic-trunk-userdebug
      m
Change-Id: I32670ef2c25fdcefec11bd07ba41cd0ea96c92bd
2023-11-09 16:58:29 -08:00
Juan Yescas
3db51d2500 16k: soong: Add linker flag -Wl,-z,max-page-size for x86-84 to align binaries and .so
To simulate 16k page size in x86-64 cuttefish, it is necessary
to compile the shared libraries and binaries with max-page-size greater
than 4096.

Bug: 309816695
Test: source build/envsetup.sh
      lunch aosp_cf_x86_64_phone_pgagnostic-trunk-userdebug
      m
      readelf -l out/target/product/vsoc_x86_64_only/system/bin/toybox
Change-Id: I38e4449a7826a2eca0c1a1cccc916af21f0b3a93
2023-11-09 13:29:22 -08:00
Dan Willemsen
f051ec6de2 Merge "Update the minimum macos deployment version to 10.14" into main 2023-11-08 18:46:51 +00:00
Dan Willemsen
876b12ffdd Update the minimum macos deployment version to 10.14
Bug: 191879468
Test: Build aosp-build-tools on Mac
Change-Id: I21c3d0482ba9a23b2b54849eccb18c7958559d93
2023-11-08 02:11:27 +00:00
Yi Kong
0fa503da2e Only enable MLGO for ARM64 ThinLTO targets
The MLGO model we embed in the Android Clang is trained on ARM64
ThinLTO artefacts. Applying the model across architectures does not
necessarily translate to performance improvement. Therefore only enable
the optimisation on ARM64 ThinLTO for now.

Test: presubmit
Bug: 293827654
Change-Id: Ie64a65c11191cf700a463637a0746c8470d3aa3c
2023-11-07 14:12:51 +09:00
Colin Cross
f96b001064 Don't call android.PathForModuleSrc(ctx).String() to get ModuleDir
ctx.ModuleDir is much cheaper than android.PathForModuleSrc(ctx).String().

Test: builds
Change-Id: I81819088d9564b06a0336a59a45f2b110b0bd9d6
2023-11-02 19:07:49 +00:00
Yi Kong
bc9d35168c Merge "Add option to emit ThinLTO indexes and imports for MLGO training" into main 2023-11-01 05:12:25 +00:00
Yi Kong
b8eaee68b6 Add option to emit ThinLTO indexes and imports for MLGO training
Test: presubmit
Bug: 293827654
Change-Id: I8de1287543194d8e47ff5b57d4cabc7416048bbf
2023-10-31 21:59:45 +09:00