Commit graph

8479 commits

Author SHA1 Message Date
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
Hsin-Yi Chen
d8f510b687 Merge "Let header-abi-linker filter symbols by API level" into main 2023-10-31 03:55:05 +00:00
Hsin-Yi Chen
843c0638d6 Let header-abi-linker filter symbols by API level
In a trunk stable branch, the ABI-monitored libraries under different
release configurations share the source code. The exported symbols are
filtered by version scripts and API level. header-abi-linker needs to
take the API level as a parameter.

Test: make
Bug: 308192597
Change-Id: I4b55b7ec023451b3a4cd1da308a1de10842d51d2
2023-10-30 13:03:53 +08:00
Justin Yun
87e4128270 Merge "Stop using VNDK from product partition" into main 2023-10-30 05:01:44 +00:00
Aditya Kumar
e19a173a48 Merge "Discard IllegalFlags when testing a new compiler" into main 2023-10-29 00:50:33 +00:00
AdityaK
e7b606717a Discard IllegalFlags when testing a new compiler
Also add -Wno-everything as suggested by Pirama

Bug: b/308179696

Follow up: https://b.corp.google.com/issues/308179380

Change-Id: Iaa73f2b52363562b2391346d8b2e5dc73bab4f2d
2023-10-27 18:54:58 +00:00
Krzysztof Kosiński
14e25a504c Merge "Revert "Revert "Enable -Werror=incompatible-function-pointer-types""" into main 2023-10-26 21:46:35 +00:00
Krzysztof Kosiński
83199b5e4d Revert "Revert "Enable -Werror=incompatible-function-pointer-types""
This reverts commit 5e75975e04.

Reason for revert: breakages fixed

Change-Id: Id54499eabaca649bee5ea6452a3a4134d8773e2d
2023-10-26 07:16:29 +00:00
Justin Yun
d578412cf1 Stop using VNDK from product partition
Product modules install required vndk modules in /product/lib[64].
But still the product modules can link to the llndk from system
partition using the list in /system/etc/llndk.libraries.txt.
To install /system/etc/llndk.libraries.txt file, use
llndk_libraries_txt singleton without versioned name.

Until VNDK is fully removed, the vndk apex must install the versioned
llndk.libraries.<ver>.txt file to the vndk apex.
Use llndk_libraries_txt_for_apex singleton for this purpose.

Test: lunch cf_x86_64_phone-next-userdebug; m
Test: atest GtsVndkDependencyTestCases
Bug: 299867815
Bug: 302255959
Change-Id: I058616081fe31597a9b76b772b69927807436896
2023-10-25 14:36:04 +09:00
Yu Liu
7ec40649bb Merge "Support a few more attrs in cc_aconfig_library." into main 2023-10-23 22:47:37 +00:00
Treehugger Robot
c70be4b986 Merge "Globally disable -Wreorder-init-list." into main 2023-10-22 09:49:55 +00:00
Krzysztof Kosiński
8f8cc1668e Globally disable -Wreorder-init-list.
This warning is triggered even when initializers don't have any
side effects, so it very rarely surfaces actual bugs/mistakes.
99% of the time it complains about a purely cosmetic issue.
Disable it by default in commonGlobalCFlags, which still allows
individual modules to opt into it.

Bug: 145210666
Test: presubmit
Change-Id: I671b5c457ee3d92b9cc37f020ba54e01e1a04f59
2023-10-22 05:09:40 +00:00
Yu Liu
f11b7c3093 Support a few more attrs in cc_aconfig_library.
More might be added later when we have an allowlist.

Bug: 305998969
Test: b build with the change in ag/25094394
Change-Id: I92df843ac81f4e33ce7506db61c989a380015975
2023-10-20 19:17:53 +00:00
Eric Rahm
1952471c56 Reapply "Use zstd to compress debug info in cc libraries"
This reverts commit d0500f10ef.

Test: m
Bug: 305277519
Change-Id: I126395d32cfc0048b6403c831613d9b4a178af4d
2023-10-20 16:01:14 +00:00
Eric Rahm
5571ab8599 Reapply "Compress debug info in clang builds with zstd"
This reverts commit 6d089b7de0.

Test: m
Bug: 305277519
Change-Id: Iaa27fa0aae8ef624b403e905bfb04df15e380baf
2023-10-20 16:01:14 +00:00
Matías Hernández
a76ea9ac49 Merge changes from topic "revert-2788316-JFVDBRFDKA" into main
* changes:
  Revert "Decompress debug sections when creating debug info"
  Revert "Compress debug info in clang builds with zstd"
  Revert "Use zstd to compress debug info in cc libraries"
  Revert "Use zstd to compress debug info in rust libraries"
2023-10-20 15:48:28 +00:00
Matías Hernández
6d089b7de0 Revert "Compress debug info in clang builds with zstd"
Revert submission 2788316

Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.corp.google.com/builds/quarterdeck?branch=git_main&target=panther-next-userdebug&lkgb=10981485&lkbb=10981536&fkbb=10981536, bug b/306625613

Reverted changes: /q/submissionid:2788316

Change-Id: I7a49b82d26454fe34f8200622a38cdabc0f446cf
BUG: 306625613
2023-10-20 13:07:14 +00:00
Matías Hernández
d0500f10ef Revert "Use zstd to compress debug info in cc libraries"
Revert submission 2788316

Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.corp.google.com/builds/quarterdeck?branch=git_main&target=panther-next-userdebug&lkgb=10981485&lkbb=10981536&fkbb=10981536, bug b/306625613

Reverted changes: /q/submissionid:2788316

Change-Id: Ice939d57214879416da06d7134c6a8b56eaf00e6
BUG: 306625613
2023-10-20 13:07:14 +00:00
Eric Rahm
b60cd11bc7 Merge changes Ia85d8dc0,I4ab3d47f,Ieeaa6554,I0b3c1f08 into main
* changes:
  Use zstd to compress debug info in rust libraries
  Use zstd to compress debug info in cc libraries
  Compress debug info in clang builds with zstd
  Decompress debug sections when creating debug info
2023-10-20 10:32:13 +00:00
Eric Rahm
f52906f194 Use zstd to compress debug info in cc libraries
We can save a significant amount of disk space by compressing
debug info in `lld` cc builds. This change configures a build
flag to instruct lld to compress debug info when building cc
libraries. Rather than adding a global config we add this to
each target individually to avoid linker failures on windows
cross build targets.

Test: m
Bug: 305277519

Change-Id: I4ab3d47fb0de7e31a39fb671cccde1acee3a2018
2023-10-19 22:47:44 +00:00
Eric Rahm
fa0dff576b Compress debug info in clang builds with zstd
We can save a significant amount of disk space by compressing
debug info in `clang` builds. This change configures a build
flag to instruct clang to compress debug info.

Test: m
Bug: 305277519
Change-Id: Ieeaa655452d847e83ebc6bec0864e47c46f4c6fb
2023-10-19 22:24:58 +00:00
Cole Faust
14c1ed8d7d Merge "gofmt soong" into main 2023-10-19 03:48:45 +00:00
Cole Faust
06ea531ab3 gofmt soong
Test: Presubmits
Change-Id: Ia76c35ba51685eca29df51738000eacd3f43ce20
2023-10-18 17:42:59 -07:00
Aditya Kumar
f583bafc6e Merge "Revert "Enable hot cold split"" into main 2023-10-18 17:54:32 +00:00
Yi Kong
c1545e8dbf Merge "Add additional flag required for Flow Sensitive AFDO" into main 2023-10-18 07:04:06 +00:00
Aditya Kumar
b36eaa663b Revert "Enable hot cold split"
This reverts commit 4e28d0eda2.

Reason for revert: Reverting now that we should have sufficient data from Crystalball https://b.corp.google.com/issues/306023954

Change-Id: I9f92c203eda309956ec192432ba0063eb11f59e2
2023-10-17 21:31:45 +00:00
Liz Kammer
fa774656a1 Merge "Restrict bp2build of hdr library props" into main 2023-10-17 13:54:16 +00:00
Yi Kong
bc2d02aa6a Add additional flag required for Flow Sensitive AFDO
It can be removed in the future once it becomes default.

Test: presubmit
Bug: 304282732
Change-Id: Ia7729593eff13ba5cc69fdb54519305295313b4d
2023-10-16 16:59:21 +09:00
Liz Kammer
96da2babed Restrict bp2build of hdr library props
Only migrate relevant attrs

Test: bp2build.sh
Change-Id: Ie6635789a64a542ecd5815dc29313b505cc1f19a
2023-10-13 16:22:24 -04:00
AdityaK
4e28d0eda2 Enable hot cold split
Change-Id: I6752ee000bc72c488ab197f6671514c9e5faa2bd
2023-10-13 15:35:26 +00:00
Ramya Subramanian
5e75975e04 Revert "Enable -Werror=incompatible-function-pointer-types"
This reverts commit 07c362bf7f.

Reason for revert: DroidMonitor: Potential culprit for Bug 304839693 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.”.

Change-Id: Iafb894510c48af2dd8b015d7264a031ff9348884
2023-10-11 23:00:33 +00:00
Jingwen Chen
9c2e3ee54a Move platform constraints to bazel_common_rules.
This enables sharing of platform constraints between platform and kernel builds.

Bug: 304594734

Test: treehugger
Change-Id: I48091eeaf2e529c3f180ba056da3935911868b14
2023-10-11 12:07:44 +00:00
Yi Kong
b33ced051a Enable Flow Sensitive AutoFDO
FSAFDO (Flow Sensitive AutoFDO) is an improvement over AutoFDO. It
attempts to capture and represent the flow-sensitive profile in LLVM
optimization passes with the mechanism to expose and iteratively
reload/match the profile with better precision.

Enable this for all AFDO projects so that we can capture data from the
field, and then evaluate the performance gain.

Test: presubmit
Bug: 304282732
Change-Id: I0de6b4071e4f0a75500f3ffd5171a7be5117ec86
2023-10-10 14:16:29 +09:00
Treehugger Robot
6525ee82d7 Merge "Revert "Do not convert non-unit tests."" into main 2023-10-10 02:22:14 +00:00
Spandan Das
0f81762d3f Merge "Replace ndk_libs.bzl with an attr in cc_stub_suite" into main 2023-10-10 02:18:09 +00:00
Yi Kong
cdd6a47bbf Merge "Remove GLOBAL_THINLTO build option" into main 2023-10-10 01:41:56 +00:00
Jingwen Chen
6e119745b8 Revert "Do not convert non-unit tests."
This reverts commit 80b54d2502.

Reason for revert: caused hello_world_test to not be converted, but it's a test that builds/passes

Bug: 300117121

Change-Id: I805cfb336b7f58a5a1e295cade16be4c471e2ed5
2023-10-09 23:21:54 +00:00
Spandan Das
17a27f0c14 Replace ndk_libs.bzl with an attr in cc_stub_suite
(This CL is a cleanup, and should be a no-op)

Currently we support three variations of cc api stubs.
1. publicapi stubs, i.e. ndk stubs (empty additional args to ndkstubgen)
2. module-libapi stubs that are also an ndk library (--systemapi --apex)
3. module-libapi stubs that are not an ndk library (--systemapi --apex
   --no-ndk)

ndk_libs.bzl was used to differentiate between (2) and (3). This creates
an additional layer of indirection - users will need to modify this
external .bzl file if they would like to add a library to an ndk.

Replace this with an explicit atttibute in cc_stub_suite macro for better UX.

Test: go test ./bp2build
Test: b test //build/bazel/rules/cc:cc_stub_library_tests (added in
sibling CL)
Bug: 299501496

Change-Id: Idd3579e8013bae7a1740534f90d2767df5bac1a5
2023-10-09 18:07:39 +00:00
Elliott Hughes
69cf8a3221 Merge "Have the sanitizers trap rather than abort." into main 2023-10-09 16:08:05 +00:00
Yi Kong
950c17435d Remove GLOBAL_THINLTO build option
GLOBAL_THINLTO is now default, since it improves build speed, produces
more performant code and smaller binary. Remove the option to turn it
off since we no longer maintain that variation, and that simplifies the
logic (esp. for moving CFI builds to ThinLTO).

Also fixed a bug where ThinLTO is not propagated to its static deps on
non-default targets (32-bit or host).

Test: presubmit
Bug: 169004486
Change-Id: I31f41ba27c2b94a384d2ba5027049c307d6f4334
2023-10-09 10:56:14 +00:00
Yi Kong
0b6c4b7c08 Merge "Change lto_test to use GlobalThinLTO configuration" into main 2023-10-09 10:41:28 +00:00
Kiyoung Kim
f161d653cf Merge "Disable TARGET_VNDK_USE_CORE_VARIANT if VNDK is deprecated" into main 2023-10-09 05:31:12 +00:00
Krzysztof Kosiński
07c362bf7f Enable -Werror=incompatible-function-pointer-types
Bug: 296321145
Test: presubmit
Change-Id: I9c056285263061e17e53c4924dcd32bf5310ed91
2023-10-06 20:06:47 +00:00
Dan Albert
dbd4a25cf7 Merge "Fix error message to still be an error." into main 2023-10-06 18:55:32 +00:00
Christopher Parsons
f7fe400fbc Merge "Dont write data attrs for cc lib rules" into main 2023-10-06 14:09:07 +00:00
Kiyoung Kim
03b6cba1f2 Disable TARGET_VNDK_USE_CORE_VARIANT if VNDK is deprecated
TARGET_VNDK_USE_CORE_VARIANT enables vendor to use some of the VNDK
libraries with core variant installed in /system/lib. However, this does
not make sense when VNDK is deprecated. This change is to ignore
TARGET_VNDK_USE_CORE_VARIANT when the VNDK is deprecated.

Bug: 303754049
Test: aosp_cf_x86_go_phone boot succeeded
Change-Id: Ie9fa75e0fa452e48924d51d64201690ffb271f33
2023-10-06 14:12:43 +09:00
Chris Parsons
7123cc5370 Dont write data attrs for cc lib rules
The data attributes for cc library rules is dropped by their starlark
macros, so serves no real purpose. Furthermore, this unused dependency
proves problematic for allowlist v2, as there are many cases at HEAD
where the corner-case "requires" dependency would otherwise mark a module
as unconvertible.

Fixes: 303307456
Test: New unit test
Test: Manual verification to unblock allowlist v2 `bp2build.sh` runs in
AOSP

Change-Id: I6ca6104b958d2b428fc2ca5b3fa794106571acca
2023-10-05 22:07:28 +00:00
Elliott Hughes
3bba0e4bfe Have the sanitizers trap rather than abort.
abort() seems friendlier, but in practice it puts a couple of irrelevant
libc.so frames on the top of the stack trace and clobbers all the
registers that might have helped remotely debug a sanitizer failure.
Let's switch to trapping directly in the sanitized code instead.

Bug: http://b/298741930
Test: treehugger
Change-Id: I6c971920c8506f97133749aaddd73b8cea6a12bc
2023-10-05 14:51:28 -07:00