Commit graph

35932 commits

Author SHA1 Message Date
Colin Cross
cef792e467 Support genrules as CrtBegin and CrtEnd
Host bionic will use a genrule output as a linker script in CrtBegin,
support genrules as Crt* dependencies.

Test: go test ./build/soong/cc/...
Change-Id: Ie384089d26459797d0b4b5fef84846507fc508ad
2021-06-11 18:01:26 -07:00
Colin Cross
c465efd5d4 Support multiple CrtBegin and CrtEnd files
Host bionic will use multiple files for CrtBegin, make CrtBegin and
CrtEnd Paths instead of OptionalPath.

Test: go test ./build/soong/cc/...
Change-Id: Ie2e954cd87808a903617696da443009f6173e312
2021-06-11 18:00:04 -07:00
Colin Cross
009f3df380 Give extracted linker sections pretty names
Replace .linker.sect0, etc. with .linker, .linker.text, .linker.data
and .linker.data.rel.ro by extracting the name of the first section
in each program header.

Test: build and run host bionic binary
Change-Id: I25107547536a3a3963fdeb311c45a7ee53c0bc45
2021-06-11 17:57:09 -07:00
Colin Cross
f04eb99acc Stop injecting symbols into host bionic binaries
The host bionic bootstrapping no longer needs an injected symbol.
Replace host_bionic_inject with host_bionic_verify that validates
the resulting binary, and add it as a validation dependency of the
binary.

Test: build and run host bionic binary
Change-Id: I3e303d2a164b6eef851bdc8075e6ee456c05b0a8
2021-06-11 15:22:41 -07:00
Liz Kammer
5f16b3d03e Merge "Append _alwayslink to prebuilt whole static deps" 2021-06-11 19:47:12 +00:00
Liz Kammer
2d7bbe3883 Append _alwayslink to prebuilt whole static deps
This allows us to support prebuilt archives that are part of whole
static deps.

Test: build/bazel/ci/bp2build.sh
Bug: 190716727

Change-Id: I913dbd8f85a1974fbd53c0cbaa49211db18ea45f
2021-06-11 08:10:50 -04:00
Paul Duffin
4ebad6aa89 Merge "Make bootclasspath_fragment_sdk_test.go tests more realistic" 2021-06-11 04:41:28 +00:00
Paul Duffin
baa8e55dec Merge "Make TestPlatformBootclasspath_Fragments more realistic" 2021-06-11 04:40:46 +00:00
Paul Duffin
2eddb50fd5 Merge "Move TestPlatformBootclasspath_Fragments to apex package" 2021-06-11 04:40:04 +00:00
Paul Duffin
5e1073b7cd Merge "Export hidden api related types and fields" 2021-06-11 04:39:05 +00:00
Dan Albert
56f52de8bd Add systemapi as an APEX synonym for stub maps.
The apex tag is currently used for platform-to-APEX, APEX-to-APEX, and
APEX-to-platform, and it's difficult to tell when reviewing the map
files. Add a synonym so authors can be explicit about platform-to-APEX
since those have different stability rules.

Test: pytest
Test: mypy
Test: pylint
Test: treehugger
Bug: None
Change-Id: I0aee679a05b1b2d3749307434c19486bf4c7fe52
2021-06-10 16:38:19 -07:00
Dan Albert
ead21552ee Refactor tag handling code in stub generator.
Test: pytest
Test: pylint
Test: mypy
Test: treehugger
Bug: None
Change-Id: I7fb380a3d879b4abcdadfe4aafff0ca4098d2e07
2021-06-10 16:38:19 -07:00
Colin Cross
7b4bda29fc Merge "Always propagate some environment variables to RBE" 2021-06-10 15:57:22 +00:00
Yuntao Xu
7a93bffd76 Merge "Support LOCAL_CERTIFICATE_LINEAGE for androidmk" 2021-06-10 15:57:17 +00:00
Nikita Ioffe
9d9960f240 Rename test_only_no_hashtree to generate_hashtree
In order not to introduce any changes in the system image default value
of generate_hashtree is currently set to false. Once all the APEXes that
shouldn't have hashtree enable (i.e. non-updatable ones) explicitly set
`generate_hashtree: false` default value will be switched to true.

Test: checked that are no diffs between ${OUT}/system/apex without this
  change and with this change.
Test: m
Bug: 190621617
Change-Id: I5a3144f8f6ea7dee25678af43e2b07a8c85daa9e
Merged-In: I5a3144f8f6ea7dee25678af43e2b07a8c85daa9e
(cherry picked from commit da6dc31389)
2021-06-10 16:54:53 +01:00
Jingwen Chen
62d8b1ed43 Merge "bp2build: support strip properties." 2021-06-10 13:36:13 +00:00
Liz Kammer
6ae5658387 Merge "Handle simple symlinks in mixed builds" 2021-06-10 13:35:13 +00:00
Paul Duffin
5f148ca7cf Make copyBootJarsToPredefinedLocations simpler and less fragile
Previously, copyBootJarsToPredefinedLocations relied on all its
parameters having the same length and the same order. That made it
quite fragile as changes to one of the parameters without corresponding
changes to the other would cause failures. It also combined the
retrieval of the boot dex jars from the modules, handling of missing
boot dex jar files and the generation of the rules to copy the files.

This change separates the retrieval of boot dex jars and handling of
missing files from the copying of those files while at the same time
making the function less fragile by replacing the three ordered
parameters with two maps that shared common keys.

Bug: 179354495
Test: m nothing
Change-Id: Idbcd24a7e8af89f7895a20aeddc58502dcbaad03
2021-06-10 14:28:10 +01:00
Paul Duffin
bff50e2b80 Ensure primary boot image files are created before they are used
Previously, when building a framework boot image variant it added an
implicit dependency onto the first file in the primary boot image
variant to ensure that the primary boot image variant files that the
dex2oat command needs have been created. That works when generating
from source as in that case all the files for a boot image variant are
created by a single command. However, it does not work for prebuilts as
each prebuilt file will be copied into the required location by
separate copy commands.

This change adds all the files that the dex2oat command uses implicitly
when building an extension boot image as implicit dependencies.

Bug: 177892522
Test: m SOONG_CONFIG_art_module_source_build=false droid
      - the previous command only works in combination with a number of
        other build changes.
Change-Id: I183748fd17f8f3003890675b8c6bb9fcab331443
2021-06-10 13:40:33 +01:00
Paul Duffin
7c47515c7f Make bootclasspath_fragment_sdk_test.go tests more realistic
In the input test fixture this makes sure that every
bootclasspath_fragment is part of an apex and every content module for
the fragment is listed in the appropriate boot jars config property. It
also adds a platform_bootclasspath fragment that references the
fragment.

In the snapshot test fixtures this adds a prebuilt_apex that exports
the fragment so that the platform_bootclasspath has access to the dex
implementation files.

Bug: 177892522
Test: m nothing
Change-Id: I6c73651a359052858232b06229b4433799dd94db
2021-06-10 12:36:44 +01:00
Paul Duffin
dc3f9566a2 Make TestPlatformBootclasspath_Fragments more realistic
Move the bootclasspath_fragment to be part of an apex to match how they
are expected to be used. Also adds the bar library to the boot jars
config as every module in a bootclasspath_fragment that is referenced
from a platform_bootclasspath module is expected to be in the config.

Bug: 179354495
Test: m nothing
Change-Id: I6f826dce9c006d630ee31d4171fe6fb458cc9442
2021-06-10 12:36:43 +01:00
Paul Duffin
ffa8375f07 Move TestPlatformBootclasspath_Fragments to apex package
This test checks that fragments which are referenced from a
platform_bootclasspath module contribute their hidden API flags to those
used by platform_bootclasspath module. Previously, it was unrealistic
because the bootclasspath_fragment does not belong in an APEX.

This change moves the test from the java package to the apex package to
allow it to be modified to make the bootclasspath_fragment part of an
apex.

Bug: 179354495
Test: m nothing
Change-Id: Icb57f2e1eaea4b14aab5f47f3af7d05ea0555816
2021-06-10 12:36:43 +01:00
Paul Duffin
524c82c01a Export hidden api related types and fields
This will export some hidden api related types and fields so they can
be used from outside the java package. This is needed to allow a follow
up change to move the TestPlatformBootclasspath_Fragments from the java
to the apex package.

Bug: 179354495
Test: m nothing
Change-Id: Ib69eea9d79cc83b8e3fc29919a29f071e1ec17b5
2021-06-10 12:36:43 +01:00
Jingwen Chen
3d383bbeb9 bp2build: support strip properties.
This CL adds support to bp2build for generating all strip-related
properties into a strip dictionary as a parameter in the cc_library
macro.

With the dictionary, it's easy to organize related attributes and
directly expand into a stripped_shared_library's attributes.

Test: //build/bazel/tests/bionic:compare_libc_stripping
Test: TH
Fixes: b/187928597
Change-Id: Ifea68d48fe295e71a43b12876cb168c475a62187
2021-06-10 05:22:50 +00:00
Colin Cross
95fad7a56e Always propagate some environment variables to RBE
Always propagate LANG, LC_MESSAGES and PYTHONDONTWRITEBYTECODE
to RBE to get more consistent behavior between local actions and
RBE.

Bug: 182415460
Bug: 190593001
Test: treehugger
Change-Id: I726e6f02fd3ef77e158baf6fde77ffb7247a1375
2021-06-09 15:05:40 -07:00
Liz Kammer
c49e682f37 Handle simple symlinks in mixed builds
Bug: 180945121
Test: build/bazel/ci/mixed_libc.sh
Change-Id: I49fba569a41dcb8cd4c2e58560817443697f58f1
2021-06-09 10:40:32 -04:00
Paul Duffin
84c1cdf31f Maintain header order in merge_csv
Previously, if the --header property was not specified then merge_csv
would use a header constructed by sorting all the fields in the input
files. That required that any use of merge_csv which did not already
have headers in the required order would have to explicitly specify the
headers. That made it harder to use merge_csv as a generic tool as each
invocation needed to be aware of what headers were exported in the
output.

This change causes merge_csv to simply use the headers in the order in
which they are encountered in the input files. That removes the need to
specify the --header option when generating the index files.

Bug: 179354495
Test: m out/soong/hiddenapi/hiddenapi-index.csv out/soong/hiddenapi/hiddenapi-unsupported.csv
      - make sure that they are not changed by this change.
Change-Id: I420b7d07aea85af6372cd7580a8be5e2cc82a513
2021-06-09 14:02:03 +01:00
Jingwen Chen
a4d9b86c8b Merge "bp2build: build libc.so." 2021-06-09 08:05:20 +00:00
Treehugger Robot
75851d2fb6 Merge "Only store what's used in SharedLibraryInfo" 2021-06-09 05:49:15 +00:00
Jingwen Chen
e8489563ff bp2build: build libc.so.
Test: TH

Bug: 183064430
Change-Id: Idfcf80b2415c23840d4b4ae9b826cf6f061dbef3
2021-06-09 05:33:40 +00:00
Yuntao Xu
8d87cb0bee Support LOCAL_CERTIFICATE_LINEAGE for androidmk
Added the support of `LOCAL_CERTIFICATE_LINEAGE` for the mk2bp
conversion tool `androidmk`.

Bug: 185169879
Test: rum 'm androidmk'
Test: TreeHugger
Change-Id: I7e89e60be4be26833cac13c911a9b38284a47301
2021-06-08 20:00:47 -07:00
Treehugger Robot
f218e3d0c2 Merge "Handle no_libcrt in bp2build." 2021-06-09 00:48:06 +00:00
Jooyung Han
7f6e057f23 Merge "Interpret CRT object's min_sdk_version with ApiLevel" 2021-06-09 00:07:29 +00:00
Liz Kammer
d366c909ca Handle no_libcrt in bp2build.
Test: ci/bp2build.sh
Bug: 187928307
Change-Id: Ib80c4318169652b322e5d878c8784679e42f87dd
2021-06-08 17:18:22 -04:00
Liz Kammer
ef6dfea679 Only store what's used in SharedLibraryInfo
There was a reference to the static library provider, but only the
transitive static deps were used, so only store that part. Other members
were stored but unused anywhere.

Test: go test soong tests
Test: m nothing
Change-Id: I12a6b94806c052c3f0df3cab0a10f17042af1c38
2021-06-08 16:44:23 -04:00
Spandan Das
05f1a0a795 Merge "Port module_partition logic for RRO from Make to Soong" 2021-06-08 20:41:45 +00:00
Spandan Das
5d1b929f21 Port module_partition logic for RRO from Make to Soong
The default partition for RRO is "product/" in Make, but it was
"system/" in Soong. This CL ports the logic from Make to Soong

To implement this, a new function PathForModuleInPartitionInstall is
created that enables callers to provide the relevant partition

Bug: 158407753
Test: from build/soong, ran go test ./java
Change-Id: I05b02eae7fe57189aaad5109c26cccc5823518ef
2021-06-08 17:53:31 +00:00
Colin Cross
9eb611a3cc Merge changes I162b0f68,I1689b670,Id6d997ee,I9aae2a16
* changes:
  Don't use unsafe_ignore_missing_latest_api in TestJavaSdkLibraryDist
  Remove core_lib property from java_sdk_library
  Ignore owner property when computing java_sdk_library dist subdirectory
  Make the default java_sdk_library dist_group "unknown"
2021-06-08 17:02:59 +00:00
Martin Stjernholm
81b90d98db Merge "Remove use of fake soong.variables." 2021-06-08 13:55:35 +00:00
satayev
5831f70dab Merge "Add exemption for framework-sdkextensions-classpaths boot jar." 2021-06-08 13:45:56 +00:00
Martin Stjernholm
040e0443c3 Remove use of fake soong.variables.
Use the --soong-only flag instead to create it the proper way with the
config make step. This fixes build problems arising from the incomplete
soong.variables settings.

This partially relands https://r.android.com/1535202 so that we'll use
TARGET_PRODUCT=mainline_sdk in module SDK builds everywhere.
build-aml-prebuilts.sh isn't removed completely because we still need
the special case to create build_number.txt.

Test: art/build/build-art-module.sh --skip-apex && \
      packages/modules/ArtPrebuilt/update-art-module-prebuilts.py \
        --local-dist out/dist
  then check that the created prebuilt dex2oatd64 runs with the repro
  in b/190194345
Test: build/soong/scripts/build-mainline-modules.sh
  then
      prebuilts/runtime/mainline/update.py --local-dist .../out/dist
  in a master-art tree and check that art/build/build-art-module.sh
  works there
Bug: 190194345
Bug: 174315599
Change-Id: I86327b082b61c292f18c0a6b315d9add08002832
2021-06-08 11:36:53 +01:00
Anton Hansson
4aa0003362 Merge "Remove sourcepath argument from metalava invocations" 2021-06-08 09:40:22 +00:00
Anton Hansson
075da1904f Merge "Stop filtering html files from droidstubs input" 2021-06-08 09:31:58 +00:00
Anton Hansson
2be5d88b35 Merge changes I91abbd28,I111a69e6
* changes:
  Add a soong-only mode to soong-ui
  Various cleanup in soong_ui to aid new feature
2021-06-08 08:45:48 +00:00
Yo Chiang
c33cceb408 Merge "cc/sabi.go: Propagate ShouldCreateSourceAbiDump to reuseObjTag deps" 2021-06-08 06:02:07 +00:00
Jooyung Han
94a76ee868 Interpret CRT object's min_sdk_version with ApiLevel
min_sdk_version values should be interpreted before use.

Bug: n/a
Test: m (in REL)
Change-Id: Ia45f5c7aeb4efcd8daef1deaf54f333dcdd1379d
2021-06-08 09:49:48 +09:00
Dan Albert
ad66593085 Disable ABI dumps on Darwin.
I'm not sure why these targets are getting built as part of the sdk
build anyway, but we don't need them.

Test: treehugger
Bug: http://b/156513478
Bug: http://b/190394921
Change-Id: I1ea0e75f459ad7cad648f96b67a4f2424d36fda7
2021-06-07 13:22:30 -07:00
Liz Kammer
2f26595072 Merge changes I4a5ea40c,I40ab16e3
* changes:
  Handle excludes_{shared,static}_libs
  Extract function to handle configurable excludes
2021-06-07 16:42:38 +00:00
Anton Hansson
556e8149cb Remove sourcepath argument from metalava invocations
This is no longer required to find package.html files, so remove it.

Bug: 153703940
Test: m checkapi
Change-Id: I80ec219cb9ef8922094336a5d45652c8e59aa113
2021-06-07 16:04:46 +01:00
Anton Hansson
edd61643be Stop filtering html files from droidstubs input
Metalava now expects html files to be specified explicitly. This
filtering was originally added because jdiff could not cope with html
inputs, but jdiff support has been removed in r.android.com/1455335.

Bug: 153703940
Test: m checkapi
Change-Id: I34164b633bab2892e3a1c0fd0257fcf98d537655
2021-06-07 16:02:53 +01:00