Commit graph

58951 commits

Author SHA1 Message Date
Elliott Hughes
9f0c951862 Remove a flag from riscv64 that was copied from arm64.
This causes us to align the text section to 4KiB, not just the data
section. From the bug that added this for arm64, there was an admission
that it costs 17MiB across the tree, and a not entirely convincing claim
of a performance improvement (undermined by the fact that "some stuff
was faster, some stuff was slower"). See http://b/150506341 for that.

Anyway, let's assume we don't want this for riscv64 for now.

Test: `mm -j` in bionic and readelf on the resulting libtest_empty.so
Change-Id: I0ed592a97ef705175191d9c66271a599af4eb18f
2022-11-15 00:56:04 +00:00
Paul Duffin
280765acc4 Merge "Improve error reporting when depending on prebuilt implementation jar" 2022-11-14 16:38:11 +00:00
Treehugger Robot
4d87828d15 Merge "Export ndk/aml arches to Bazel" 2022-11-14 16:17:41 +00:00
Paul Duffin
73d394dec2 Merge "Allow namespace config to be tested properly" 2022-11-14 14:08:40 +00:00
Paul Duffin
c61783b20d Improve error reporting when depending on prebuilt implementation jar
The sdk snapshot must not be including implementation code for boot
libraries, the implementation is provided by dex jars within the
corresponding APEX. However, the snapshot does need a module for each
boot library so that the build can seamlessly access the dex files from
the APEX.

A java_library boot library (like core-oj) is represented in the
snapshot by a java_import module which requires a jar file to be
provided, otherwise it is disabled. However, that is provided purely
to keep Soong happy and should never be used.

Previously, the snapshot would contain an empty file for the jar. As
an empty file is an invalid jar any tool (like compiler) that tried
to consume it would fail which was the correct behavior. Unfortunately,
the error message that was produced was not very helpful, it was just
some variant on `invalid file` which lead to a lot of bugs being
raised.

This change replaces that empty file with a reference to the output
from a genrule which runs a script which produces a more useful error
message, with information on how to fix the issue, and fails the build.

It also adds a Name() method to the SdkMemberProperties type as that is
needed in AddInternalModule() to construct the name of the additional
module.

Tested as follows:

In AOSP/master make the following changes:
1. Temporarily set visibility on core-oj and core-libart to
   //visibility:public.
2. Run packages/modules/common/build/mainline_modules_sdks.py to create
   the snapshots.

For each of the S, T and latest snapshots I did the following in the
s-aml-prebuilt-test, t-aml-prebuilt-test and aosp/master branches:

1. Created an Android.bp file containing the following:
  java_library {
    name: "broken",
    static_libs: [
      "prebuilt_core-libart",
      "prebuilt_core-oj",
    ],
  }

2. Fix the visibility issues and run `m broken` where it fails with an
   invalid file.

3. Delete the contents of the prebuilts/module_sdk/art/current/sdk
   directory.

4. Unpack the relevant version of the art-module-sdk snapshot into the
   directory.

5. Run `m broken` where it fails with the helpful message.

6. Test the instructions on how to use the ninja -t path tool to
   identify the cause of the problem and fix it.

Bug: 257969510
Test: See above.
Change-Id: I125bde2d7202afff84c97daebcef37e21c548a3a
2022-11-14 10:14:10 +00:00
Kiyoung Kim
7cc632d3d6 Merge "Make variant headers as arch variant" 2022-11-14 01:01:59 +00:00
Kevin Dagostino
92f33d91f3 Add tools/asuite/atest/ to keep existing BUILD file list
Test:  b build tools/asuite/... && b cquery tools/asuite/...
--output=files

Change-Id: I2696327a60e770d0929ccc1baa3b4af703a2269d
2022-11-12 04:43:17 +00:00
Wei Li
78c07de1dc Add support of <APEX>-installed-files.txt in mixed build.
Bug: 239084750
Test: CIs
Change-Id: Ie3823d1a620c3924111e71aa97df727565261c98
2022-11-11 22:46:33 +00:00
Elliott Hughes
35b83adeae Merge "Revert "Disable stripping for riscv64"" 2022-11-11 20:59:45 +00:00
Liz Kammer
992918d21f Export ndk/aml arches to Bazel
Test: lunch ndk-eng; b build //bionic/libc --config=android
Change-Id: I1ec6f7d0f084aafe948f27111275537b6d9e9637
2022-11-11 15:27:56 -05:00
Vinh Tran
59834cc56d Merge "Remove AfdoAdditionalProfileDirs product variable" 2022-11-11 13:26:49 +00:00
Maciej Żenczykowski
442532a714 Merge "bpf: use PwdPrefix() helper" 2022-11-11 08:11:32 +00:00
Hsin-Yi Chen
06223aed5e Merge "Fix the condition for LLNDK ABI diff" 2022-11-11 06:02:09 +00:00
Kiyoung Kim
3d776f4e66 Make variant headers as arch variant
Make cc_api_variant's header property as arch variant, so headers can be
differed by arch variant

Bug: 244244438
Test: Panther vendorimage build succeeded
Change-Id: I400301793209c9e0214fc118cd4981194d507fbd
2022-11-11 12:59:21 +09:00
Vinh Tran
7a8362c252 Remove AfdoAdditionalProfileDirs product variable
AfdoAdditionalProfileDirs is unconnected to build/make/core/soong_config.mk and is currently unused. Removing AfdoAdditionalProfileDirs will cut down on complexity when we migrate the support of auto-fdo profiles to Bazel cc rules.

b/258684450 proposes an alternative to support the use cases that were meant to be supported by AfdoAdditionalProfileDirs.

Test: existing go tests
Bug: 253540178
Change-Id: I024e48598a560717a1d6c19b16bde3fe65ff1961
2022-11-11 03:29:31 +00:00
Elliott Hughes
8cf3236519 Revert "Disable stripping for riscv64"
This reverts commit 1deeade634.

Reason for revert: create_minidebuginfo is fixed now.

Change-Id: I0cd6136b74d4af0e8a6b9718f6b7172b14522743
2022-11-11 00:59:14 +00:00
Connor O'Brien
6a288bc799 bpf: use PwdPrefix() helper
relPwd is only set if runtime.GOOS != "darwin" but is used
unconditionally. Instead, unconditionally set relPwd using the
cc.PwdPrefix() helper.

Bug: 238165437
Test: m timeInState.o
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I5294bb6ea95dad60fbf64e9d958e1f1b32a02a48
2022-11-10 16:35:12 -08:00
Wei Li
877336cc3a Merge "Fix the git_master_bazel mixed build breakage." 2022-11-10 21:22:56 +00:00
Connor O'Brien
b573f5ffd2 Merge "bpf: use relative source file path in debug info" 2022-11-10 20:23:28 +00:00
Connor O'Brien
3e739cf426 bpf: use relative source file path in debug info
Enabling BTF leads clang to generate debug line info that includes the
absolute path to the source file. For C++ modules the
-fdebug-prefix-map flag is used to convert these to relative paths. Do
the same for BPF programs when BTF is enabled.

Test: build timeInState.c; strings shows only relative path to source
file
Bug: 238165437
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: Ie4ebc8f9a7d115baeddde5c7ac3ae710335ddf13
2022-11-10 20:22:48 +00:00
Sam Delmerico
1bde1cb668 Merge changes from topics "bp2build-tidy-disabled-srcs", "bp2build-tidy-timeout-srcs"
* changes:
  bp2build for tidy_timeout_srcs
  bp2build for tidy_disabled_srcs
2022-11-10 16:27:24 +00:00
Liz Kammer
dbb9fe8e92 Merge "Increase testing of request_type" 2022-11-10 13:30:58 +00:00
Hsin-Yi Chen
7584bda227 Fix the condition for LLNDK ABI diff
IsLlndk() returns whether the library is an LLNDK stub. The ABI check
should identify LLNDK implementation by isImplementationForLLNDKPublic().

Test: development/vndk/tools/header-checker/utils/create_reference_dumps.py \
      && make
Bug: 227282691
Change-Id: I570871e24d9029992a722b3052f8bb6e7f3c0f52
2022-11-10 16:29:44 +08:00
Wei Li
0643c4ebb5 Fix the git_master_bazel mixed build breakage.
There is no cflags defined for cortex-a9 CPU variant, set it to ArmGenericCflags to fix the mixed build breakage for now.

Bug: 258397103
Test: m com.android.build --bazel-mode-staging
Change-Id: I79a9877846ced6334c09a4f5caf115c436f600e6
2022-11-09 22:43:53 -08:00
Treehugger Robot
d5fd30d94a Merge "Add reference to bundle_file in request_type_test" 2022-11-10 01:04:12 +00:00
Treehugger Robot
01dd619766 Merge changes from topic "clang-tidy-mixed-builds"
* changes:
  add tidy files to mixed builds
  add --norun_validations to bazel build action
2022-11-10 01:00:15 +00:00
Prerana Patil
62253d193b Merge "Revert "Don't add flattened files apex as dependencies of an image apex"" 2022-11-09 20:29:03 +00:00
Treehugger Robot
b7c01a261d Merge "Add com.android.tzdata to AOSP staging allowlist." 2022-11-09 19:53:14 +00:00
Spandan Das
a8fff19350 Merge "Do not glob headers in out/" 2022-11-09 19:27:58 +00:00
Prerana Patil
b1896c88d5 Revert "Don't add flattened files apex as dependencies of an image apex"
This reverts commit b81814a7b4.

Reason for revert: breaking build 9271471

Change-Id: I1876f45b79779d7e8ec46a78bf71bf7fec09e62b
2022-11-09 18:14:34 +00:00
Liz Kammer
1b7ed9bcbc Increase testing of request_type
Test: go test soong tests
Change-Id: Iacb773a91a4cc097320f06ea1d1669c5923f8076
2022-11-09 11:22:11 -05:00
Sam Delmerico
9a9f652bdd add tidy files to mixed builds
Bug: 195029134
Test: m --bazel-mode-dev
Change-Id: I6fa370334c6ff2b6ae4313a7fcbaa34b16b0fa92
2022-11-09 10:12:00 -05:00
Liz Kammer
08626ec9d7 Add reference to bundle_file in request_type_test
Test: go test soong tests
Change-Id: I60e8930e4565a9b076e1f487300e1e2e1d3e66d0
2022-11-09 09:03:52 -05:00
Liz Kammer
303978dcd2 Connect base.zip to mixed builds
Test: go test soong tests
Test: mixed_droid
Change-Id: Iaf1fbd1e7cde63892b01a9c9f4cd29ae69e2d6e3
2022-11-09 08:16:54 -05:00
Jingwen Chen
dece457443 Add com.android.tzdata to AOSP staging allowlist.
Test: presubmits
Change-Id: I7d9edb56273375579edf3b8a5466570df6073668
2022-11-09 09:30:03 +00:00
Jingwen Chen
1ec7785ec5 bazel apex: Add mixed builds support for <module>_using.xml file.
This file contains the java APIs parsed by the 'dexdeps' tool within the gen_java_usedby_apex.sh.

Bug: 239084755
Fixes: 239084755
Test: presubmits
Change-Id: Ia271783a6be3ea3a343481306cde1aaba2166e88
2022-11-09 06:30:03 +00:00
Treehugger Robot
926d00c2ad Merge "Don't add flattened files apex as dependencies of an image apex" 2022-11-09 05:00:29 +00:00
Treehugger Robot
492a8b1dee Merge "CcApiLibrary Variants for LLNDK" 2022-11-09 02:36:26 +00:00
Treehugger Robot
6a93fa422e Merge "Add test for static lib that specifies san" 2022-11-09 01:09:08 +00:00
Wei Li
9b9fe02960 Merge "Add support of <APEX>_backing.txt in mixed build." 2022-11-08 22:55:08 +00:00
Liz Kammer
ecc659cc14 Add test for static lib that specifies san
Test: golang tests
Change-Id: Ifd54f3e36f7091e16efbc2fc147b6a3a116ab01c
2022-11-08 17:25:39 -05:00
Sam Delmerico
4c902d696a bp2build for tidy_timeout_srcs
Bug: 195029134
Test: m bp2build
Change-Id: I59fdc16d8c224f42167e3b5a3857f4ff2f546825
2022-11-08 17:18:52 -05:00
Sam Delmerico
c9b8fbdda0 bp2build for tidy_disabled_srcs
Bug: 195029134
Test: m bp2build
Change-Id: I9591439213dbf0ef68cd33151b3e32f6f6c68551
2022-11-08 17:17:52 -05:00
Romain Jobredeaux
64340c0539 Merge "Sort allowlist ascii-betically" 2022-11-08 21:57:45 +00:00
Wei Li
cc73a05670 Add support of <APEX>_backing.txt in mixed build.
Bug: 239081456
Test: CIs
Change-Id: I8a8a5e606d5b1bc19294fc92cd469e7aa01cdb43
2022-11-08 12:00:42 -08:00
Paul Duffin
3f7bf9fa0d Allow namespace config to be tested properly
Previously, the NewTextContext created a context that always called
NewNameResolver with a export filter that always returned true.

This change fixes that by:
1. Changing NewNameResolver to take a Config parameter instead of a
   filter parameter and pushing the code to create the filter from the
   Config from newNameResolver() in cmd/soong_build/main.go into the
   NewNameResolver function.

2. Extracting a newTestContextForFixture that does not create a
   NameResolver or set it on the context. That avoids creating a
   NameResolver before the test has prepared the config.

3. Modify the fixture to create and set the NameResolver in the Context
   after the config has been prepared by the test.

4. Added test to verify that it all works.

Bug: 234825639
Test: m nothing
Change-Id: Ie4b13f18093dc01a0ab65a9ecfd143585d843b55
2022-11-08 17:38:56 +00:00
Chris Parsons
66fc74509f Refactor "staging dep on prod" allowlist dep
This allows branch-specific plugins to more easily add modules to
staging or prod mode allowlists (they need not separately ensure that
staging mode is a superset of prod mode)

Bug: 254447469
Test: TH
Test: Verified that adding tzdata modules via plugin (not part of
this CL) causes many outputs under bazel-out directories

Change-Id: I5d543e262a42cce324c59e3f9880b57ca209c13c
2022-11-08 05:54:19 +00:00
Kiyoung Kim
ee58c93075 CcApiLibrary Variants for LLNDK
Define CcApiLibrary Variants for LLNDK. Each variant will be defined as
below.

cc_api_variant {
  name: "libc",
  variant: "llndk",
  arch: {
    x86_64: {
      src: "libs/x86_64/libc.so",
    },
    ...
  },
}

And CcApiLibrary will be marked to use this variant as below.

cc_api_library {
  name: "libc",
  ...
  variants: [
    "llndk",
    ...
  ]
}

Soong will replace source of libc cc_api_library as src from
cc_api_variant during build time.

Bug: 244244438
Test: cf vendor build succeeded with LLNDK variants
Change-Id: I317ed1f558beb1f82f9f2d70811fa8f765bcad2b
2022-11-08 12:57:08 +09:00
Jingwen Chen
0c9a276ded bazel apex: Add mixed builds support for <module>_using.txt file.
Test: presubmits
Change-Id: I7203fcccb09f6c93e702550ffa47a4029c3351dd
2022-11-07 23:16:12 +00:00
Jingwen Chen
1214001184 Merge "Call rm -rf in mixed build build statement preamble." 2022-11-07 23:03:43 +00:00