VndkUseCoreVariant feature is deprecated along with VNDK. This change
removes related code from Soong.
Bug: 330100430
Test: AOSP CF build succeeded
Change-Id: Ie182c9e4dc9cf0a4fe9d5fddf5b36754ddb53d18
Whenever any two Rust static libraries are included
as static libraries anywhere in a CC dependency tree, we sometimes
get duplicate symbol errors. To avoid this, we no longer
directly link multiple rust static libs to CC modules.
Instead, we build rust_ffi_rlib modules and produce the actual
static library that gets linked against the CC module based on
that CC module's full list of Rust rlib dependencies.
This introduces a new static_rlibs property for cc modules to
define the rust_ffi_rlib dependencies, which are then used to
generate the module above.
This CL is intended to deprecate rust_ffi_static. It leaves
rust_ffi_static and rust_ffi static variants in place until
the remaining rust_ffi_static declarations and uses can be
removed. In the meantime, rust_ffi_static produces
rust_ffi_rlib variants as well to make the transition easier.
Bug: 254469782
Test: m # with no changes
Test: m libapexsupport # with static_rlibs
Test: m libunwindstack # with static_rlibs
Test: m netsimd # with static_rlibs, no duplicate symbols
Test: m blueprint_tests # New Soong tests
Change-Id: I47e27ac967ef0cad46d398ebf59d8275929ae28a
The ABI dumps depend on the LLNDK API level and SDK version defined
in the release configurations. The error messages shows additional
parameters for the user to select the right version and variant.
Test: make libvulkan
Bug: 323447559
Change-Id: If12f3f74be49c3036516f42fb5d91979b610fafe
NDK team requested not to generate the dumps by header ABI checker in
the finalization process.
Test: m out/target/product/generic_arm64/lsdump_paths.txt
Bug: 332959609
Change-Id: Ia04c6f266088968ff731c0fabbbfce26300109ae
This commit adds --include-symbol-tag and --symbol-tag-policy to
header-abi-linker commands. The arguments make header-abi-linker load
the symbols tagged with llndk/apex/systemapi from the version script.
It filters the function declarations by the symbols. The output dumps
will not contain unfinalized ABI.
Test: make findlsdumps
Bug: 333532038
Change-Id: I28234a3749f389b8a5a09ac84341b1fcd1ee88a6
This commit adds a rule that builds APEX ABI dumps separately from the
implementation libraries' ABI dumps. The rule takes the
export_include_dirs and the symbol_file of the stubs as parameters.
The dump paths are tagged with "APEX" in lsdump_paths.txt. The script
updating the prebuilt reference dumps can differentiate the APEX dumps
from the opt-in dumps tagged with "PLATFORM".
This commit also adds an ABI diff rule. Soong compares the APEX ABI
dumps with the reference dumps in version 35. It compares the
implementation dumps with the reference dumps in old versions.
Bug: 333532038
Test: make
Change-Id: I76902a8e3b7d0e96a5ad756f493924371cd7ad3c
This commit fixes the incomplete ABI dumps for libc. The ABI checker
counts export_system_include_dir in the exported headers. It writes the
functions and types defined in the system headers to the dump files.
Test: make
Bug: 314010764
Change-Id: Ieae48d13b4fc4381c87a017213019e940d498967
This commit changes the parameters to create LLNDK ABI dumps for 202404
and later versions. Soong invokes header-abi-linker with LLNDK headers
and version script rather than the implementation library's parameters.
The output dump contains more precise ABI information.
When soong compares the ABI with the prebuilt dumps in old versions,
it creates the source ABI dumps with the old parameters.
Test: make findlsdumps
Bug: 314010764
Change-Id: I228736188d07029ee1588b3502fd7c0061c104b9
As of VNDK deprecation, Device VNDK version should no longer be used
from build. This change removes all references on Device VNDK version
and related logic with it.
Bug: 330100430
Test: AOSP CF build succeeded
Change-Id: Ibc290f0b41e8321f80c75c69f810223989af68dc
Existing snapshot code will no longer work from VNDK deprecation, but it
can give confusion to users if we keep code for the snapshot - and it
adds complexity on existing code while it is not in use. This change
removes all snapshot definition except host snapshot and its usage.
Bug: 330100430
Bug: 332986564
Test: AOSP CF build succeeded
Change-Id: Ieb6fa43d5e38315c662ce997bc305b744b367c24
The ABI checker dumps the ABI from the source code of LLNDK
implementation libraries. It needs to filter the ABI by the LLNDK
headers.
This commit adds dependencies from LLNDK implementation libraries to
their export_llndk_headers. The LLNDK header directories are added to
PathDeps. A followup change will pass the directories to the ABI
checker.
Bug: 314010764
Test: make
Change-Id: Ibc2d5eac3d70d9e038e0fd255cd1ebc1044fabbe
- Extract duplicate code into exportedIncludeDirsForAbiCheck.
- Convert libraryDecorator.sAbiOutputFile to a local variable.
Test: make
Bug: 314010764
Change-Id: I99a0352b11347ad363df5645ba8e0faf9bc9a0aa
We want LLNDK symbols to be explicitly marked with llndk tag to
handle LLNDK freezing which happens before SDK freezing. If symbols
need to be frozen as LLNDK, those symbols must be marked explicitly with
correct vFRC version.
In the following example,
LIBFOO { # introduced=35
foo;
bar;
bar; # llndk=202404
baz; # llndk=202404
qux; # llndk=202505
};
NDK libfoo will have foo and bar while LLNDK libfoo stub will have bar
and baz for 202404.
Bug: 329012338
Test: test_ndkstubgen test_symbolfile
Change-Id: I384f589b240fa047e8871964bf9550f426024dfc
So far we created {"", "current"} stubs for LLNDK modules. But we don't
need "current" because "" itself is a stub.
This change only removes unused LLNDK stub modules with "current"
version, which aren't used at all.
Bug: 329183083
Test: m blueprint_tests
Change-Id: Ib8e880b6d88952b489657ea1ac557a48afe562a4
Header ABI checker dumps the ABI from core variants and filters it by
version scripts. Ideally it should load different version scripts for
LLNDK, NDK, APEX, etc, but the build rules have not been completed. The
current solution is to load core variants' version scripts. It works
for every existing library because a library's variants share one
version script.
Test: make
Bug: 329078703
Change-Id: I4e26275e24daf93c7d3bb7e70b542a1197ae2129
LLNDK version will be decoupled from SDK version. The ABI checker
loads the reference ABI dumps from
prebuilts/abi-dumps/vndk/<VendorApiLevel>.
Test: m libnativewindow
Bug: 314010764
Change-Id: I3e9f2cab58db0d1cc42f8c1abc13968617dacf14
- Soong generates the rules to compare prebuilts/abi-dumps/vndk and
the intermediate dumps tagged with LLNDK.
- The LLNDK ABI diff report names contain ".llndk". Because LLNDK
versioning has not been implemented, the reports are identical to
those for NDK and PLATFORM.
- optInAbiDiff does not take isLlndkOrNdk as a parameter, as it is
false for all known use cases.
Test: m libnativewindow
Bug: 314010764
Change-Id: I17097505472b9d6ab97a605f3f8dca8ea53d22c8
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>
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
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
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
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
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
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
Convert all of the callers of OtherModuleProvider/OtherModuleHasProvider
to use the type-safe android.OtherModuleProvider API.
Bug: 316410648
Test: builds
Change-Id: Id77f514d68761a262d9ea830a601dbed804bbbe5
Convert all of the callers of SetProvider to use the type-safe
android.SetProvider API.
Bug: 316410648
Test: builds
Change-Id: If58f4b5355264ddab2045bc3591a4eac19cd58fc
Remove the ConvertWithBp2build implementations from all the module
types, along with the related code.
Bug: 315353489
Test: m blueprint_tests
Change-Id: I212672286686a318893bc7348ddd5a5ec51e77a7
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
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
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
More might be added later when we have an allowlist.
Bug: 305998969
Test: b build with the change in ag/25094394
Change-Id: I92df843ac81f4e33ce7506db61c989a380015975
(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
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
This is the bulk of the "allowlist v2" feature. It will disable bp2build
generation for modules which have transitive dependencies without a
bazel build definition.
This CL includes this mutator, but doesn't register it as a bp2build
mutator (outside of a few unit tests). This allows us to easily iterate
on completion of this feature and ensure there are no launch blockers
before we finalize the change in AOSP.
Bug: 285631638
Test: Unit tests
Change-Id: Ifb0a079c409ca19b02cafa3fab2efa0d3deebc50
This should be no-op, as the underlying mutator has not changed yet.
Some other refactoring is required and done in this CL:
- Delete some old, dead ApiBp2build code
- Fix casting to TopDownMutator when it's not necessary
This change is required to prepare for allowlist v2 work, as only
BottomUp mutators can AddDependency.
Bug: 285631638
Test: m nothing
Test: presubmits
Change-Id: I5212a5f5634cc13056195783e6df37ff8eb000da