Original aosp/2374663 was reverted, so this change cnotains the implementation but disabled by default and SBOM will not be built by default with "m dist".
The feature will be enabled later in small CLs after running tests successfully in forrest.
Test: m sbom
Test: m dist
Test: on aosp, lunch aosp_bluejay-userdebug && m dist
Bug: 266726655
Change-Id: I926d0f97f3a0330ef61d059f12ea660005d370e6
When an Android.mk specifies a local path that is outside the current
directory, it uses '..', since we prepend $(LOCAL_PATH)/ to the given
path.
This path ('a/b/../c') gets inserted into command lines and
dependencies. For dependencies, when it gets to Ninja, Ninja calls
CanonicalizePath and removes those references ('a/c'), but the command
line is preserved.
So we've got a command line that references 'a/b', but no dependency on
it. Usually that's not a big problem, but it's an issue if we're trying
to only expose dependencies to the rule, like with RBE only sending the
dependencies to the remote workers. So use our 'clean-path' macro to
collapse the '..' references in Kati so that they don't show up in the
command line either.
Test: treehugger
Test: build a system image with RBE
Change-Id: I0706faa2ac15e9c12c720f43c7bb8171c5efd97c
There are prebuilt modules which are meant to be just copied.
e.g. ETC,SCRIPT,DATA files
The problem for current prebuilt_internal.mk is that those modules are
handled by cc_prebuilt_internal.mk, which adds libc++ as dependency,
which is simply wrong with copy-only prebuilt modules.
As a fix, misc_prebuilt_internal.mk is introduced to handle
ETC,SCRIPT,DATA prebuilt modules and doesn't do additional processing.
Bug: 132925121
Test: m nothing && check build-<TARGET>.ninja if there is no dependency
to libc++ from ETC modules such as /system/etc/sepolicy_test
Change-Id: I846f8e1f3741ca71c86f5420cfaafa7419ebf3f6
Add cc_prebuilt_internal.mk and java_prebuilt_internal.mk. Now all
buisiness logic lives in individual per-class prebuilt mk files.
Fixes: 128609813
Test: Built and flashed a Pixel device image + TreeHugger
Change-Id: I3827f990642bb7587dc682d1a382b3a1ce22fe66
This is part of prebuilt_internal.mk refactoring work and also a
preliminary task to design and implement its Soong counterpart.
Test: built and flashed an image for a Pixel device + TreeHugger
Change-Id: I89b13b1e0a2780b02fda7ee888e73052ac1abd9c
This commit fixes prebuilt ELF checker for modules with
LOCAL_SDK_VERSIONS and depend on NDK shared libraries. This fix is
required because dynamic_binary.mk filters out NDK libraries thus those
libraries do not show up in DEPENDENCIES_ON_SHARED_LIBRARIES.
Bug: 119084334
Test: Create a prebuilt module with LOCAL_SDK_VERSION and check whether
the NDK libs in LOCAL_SHARED_LIBRARIES are passed to
check_elf_file.py.
Change-Id: I0f72ae1b0edc3e8d7e43eb70829e74d606564966
Dexpreopting of boot jars is now implemented in
build/soong/java/dexpreopt_bootjars.go.
Test: m checkbuild
Change-Id: I036510e7674b876976ce191c5b18bf0b7a15c6ee
This commit moves prebuilt ELF file checks out of the ifeq statement so
that both modules with and without LOCAL_STRIP_MODULE can be checked.
Bug: 123670683
Test: Add `LOCAL_STRIP_MODULE := keep_symbols` to some modules and check
whether `check_elf_files.timestamp` is generated.
Change-Id: I2f2a7df501910d31621da025ce34101f0d358dc2
This commit adds LOCAL_SYSTEM_SHARED_LIBRARIES to a
`prebuilt_internal.mk` path.
Before this commit, LOCAL_SYSTEM_SHARED_LIBRARIES is only supported when
LOCAL_STRIP_MODULE is specified. If LOCAL_STRIP_MODULE is not specified,
default system shared libs (libc, libdl, and libm) are not added
implicitly. This commit makes both paths have the same behavior.
See also. https://android-review.googlesource.com/814993
Bug: 119086738
Test: CHECK_ELF_FILES=true make -j check-elf-files
Change-Id: I84ff9f6157ad6e5ee26234133fb7148a3e2b9551
This commit introduces a prebuilt ELF binaries checker. The checker
will check:
1. Whether all DT_NEEDED shared libraries are specified in
`shared_libs` (Android.bp) or `LOCAL_SHARED_LIBRARIES` (Android.mk).
2. Whether all undefined symbols in the prebuilt binary can be resolved
to defined symbols exported by its dependencies.
This ensures that prebuilt binaries won't silently become ABI
incompatible.
To check the prebuilt binaries, all of the dependencies must be
specified in `shared_libs` (Android.bp) or `LOCAL_SHARED_LIBRARIES`
(Android.mk).
If your prebuilt binaries cannot be checked for some reason, you may add
the following property to Android.bp:
check_elf_files: false,
Or, add the following setting to Android.mk:
LOCAL_CHECK_ELF_FILES := false
Bug: 119084334
Test: CHECK_ELF_FILES=true make check-elf-files
Change-Id: I523d3083f22fd4053c096d26f61f8375800281c8
Define non_system_module in base_rules.mk when the module is product, vendor,
product_services or proprietary module.
Bug: 74699609
Test: m -j
Change-Id: Iebdd3ec8c643be3d9877b7a96cbdd83465fa3878
The strip rule does not need to wait for the boot image to finish,
create a separate DEXPREOPT_STRIP_DEPS list that only contains
tools used by GenerateStripRule in build/soong/dexpreopt/dexpreopt.go.
Bug: 123038675
Test: m checkbuild
Change-Id: I0814c8d99781533f5778e14547d3e9671e06317f
Dump the list of APKs that aren't located at system partition and signed
with system certificate.
And when enforcement option is enabled, it makes build error if there is
the apk that satisfies the condition above.
Bug: 74699609
Test: m -j
Test: m out/target/product/$(get_build_var TARGET_DEVICE)/certificate_violation_modules.txt
Change-Id: I23c41f2665dd97abac3e77d1c82d81ff91b894eb
strip.sh uses $2.d to write the depfile, while this had been passing in
$@.tmp in as $2. Instead, move the file first, then use strip.sh with
the real output file so that we can find the depfile.
Also don't specify a depfile (or other dependencies) when
LOCAL_CERTIFICATE==PRESIGNED, as we'll skip all of that in the rule in
that case.
Bug: 121058584
Test: NINJA_ARGS="-w missingdepfile=true" m
Change-Id: I1323e775e3a6ce5a06a19d59f3fb07495f116f34
Move the dexpreopting logic into Soong. Make modules will be
dexpreopted by executing the Soong logic in the standalone
dexpreopt_gen binary, which will generate scripts that will
perform dexpreopting for each module. Export global configuration
as JSON to $OUT/dexpreopt.config, which will be used by
dexpreopt_gen and Soong, and per-module JSON configuration that
will be used by dexpreopt_gen.
This relands I59b20c931ee3e5a8d35eb30da4148691c5095502,
I39d580999947ee54cfefe875b57a028be5333bd7,
Ie7daa94e107d53eff075ca58dbe721bd9d7fc8c2 and
Ica006a007d112c232311435aaac0c0e476232b67, with a minor
update to match the changes made to dexpreopt_gen arguments
and a fix to correctly keep dexpreopt disabled on mac builds.
Bug: 119412419
Bug: 120273280
Test: no differences to dexpreopt outputs on aosp_sailfish system/,
only expected changes to dexpreopt outputs on system_other
(.vdex files for privileged Soong modules no longer incorrectly
contain .dex contents).
Change-Id: I25163e91886cea6941afa25cdb529ed053278dcb
uncompress-prebuilt-embedded-jni-libs uses zip2zip, add a dependency
to the rule that calls it.
Test: treehugger
Change-Id: I39d580999947ee54cfefe875b57a028be5333bd7
Move the dexpreopting logic into Soong. Make modules will be
dexpreopted by executing the Soong logic in the standalone
dexpreopt_gen binary, which will generate scripts that will
perform dexpreopting for each module. Export global configuration
as JSON to $OUT/dexpreopt.config, which will be used by
dexpreopt_gen and Soong, and per-module JSON configuration that
will be used by dexpreopt_gen.
Bug: 119412419
Bug: 120273280
Test: no differences to dexpreopt outputs on aosp_sailfish system/,
only expected changes to dexpreopt outputs on system_other
(.vdex files for privileged Soong modules no longer incorrectly
contain .dex contents).
Change-Id: I59b20c931ee3e5a8d35eb30da4148691c5095502
nostripping causes confusing double negatives, allow nostripping
in LOCAL_DEX_PREOPT and DEFAULT_DEX_PREOPT, but convert to
LOCAL_STRIP_DEX outside of dex_preopt_odex_install.mk.
Test: m checkbuild
Change-Id: I996e9258ce20c394900d9fe937d638bc2ab8589d
If an APK specifies LOCAL_PREBUILT_JNI_LIBS embedded in the prebuilt
APK, remove any that aren't listed. Restores the behavior from before
I82dd3aa441712772a1d1ddd6aaf5f41179facaa7.
Bug: 69500920
Test: m checkbuild
Change-Id: I971a9c4206604c172d77144df4c0ed9a8b1c5dd0
Unzipping and rezipping files causes the umask of the host machine
to affect the permissions in the APK. Use the new zip2zip -0 feature
to rewrite the zip file with selected files uncompressed.
Bug: 69500920
Test: m checkbuild
Change-Id: I82dd3aa441712772a1d1ddd6aaf5f41179facaa7
$OUT/obj/APPS/SystemUI_intermediates/package.dex.apk was not being
written after being converted to Soong. Add a copy rule for it
to soong_app_prebuilt.mk, add it as an implicit output to the Make
rules that create it, and add it as a real dependency to the
platform.zip rules.
Test: m platform
Change-Id: I96f58d3d80b764a51a6acb87e92498589cfe5c18
$(HOST_OUT)/obj/PACKAGING is cleaned via `installclean`, so regular
built modules should not be depending on it. Explicitly call out the
dependencies instead.
Test: m; m installclean; m
Change-Id: I0f318257e4742d6b7bd099dc06958ca8aba0cfb8
Add soong_cc_prebuilt.mk for Soong modules to use so they can avoid
going through all of prebuilt_internal.mk, dynamic_binary.mk and
binary.mk. Also moves stripping support into Soong.
Relands I8b37dda2b449b6b5d48d5b983f43de452f494a1e with fixes for
builds with GENERATE_BREAKPAD_SYMBOLS=true
Bug: 113936524
Test: m checkbuild
Change-Id: Id41cd76ccb1b5bb6ac43b41ae3e8f1ce46d7ad7e
Add soong_cc_prebuilt.mk for Soong modules to use so they can avoid
going through all of prebuilt_internal.mk, dynamic_binary.mk and
binary.mk. Also moves stripping support into Soong.
Bug: 113936524
Test: m checkbuild
Change-Id: I8b37dda2b449b6b5d48d5b983f43de452f494a1e
This fixes a bug that platform module (native:platform) can link to a
recovery module due to the fact that the recovery module is also labeled
as native:platform. Fixing the bug by setting the link type correctly to
native:recovery.
Bug: 113277544
Test: m -j
Change-Id: I88fe0a9d958f2269cf9f9ebc205b2da8c6a761a5
Attempting to reduce the number of different spellings we have for
"product services" partition in the codebase.
Bug: 112431447
Test: m
Change-Id: I6debd3f5f5abc4bd1e22f2ef11c5fe131915976c
Merged-In: I6debd3f5f5abc4bd1e22f2ef11c5fe131915976c
Also add some more relevant information at the beginning of each report,
to make triaging of the reports easier.
To test this I declared ExactCalculator as
LOCAL_PRODUCT_SERVICES_MODULE, and this is the resulting log:
"""
Package name: com.android.calculator2
Module name in Android tree: ExactCalculator
Local path in Android tree: packages/apps/ExactCalculator
Install path on aosp_marlin-eng: out/target/product/marlin/system/product-services/app/ExactCalculator/ExactCalculator.apk
appcompat.sh output:
NOTE: appcompat.sh is still under development. It can report
API uses that do not execute at runtime, and reflection uses
that do not exist. It can also miss on reflection uses.
1: Reflection light greylist Landroid/os/Bundle;->getIBinder use(s):
Landroid/support/v4/app/BundleCompat$BundleCompatBaseImpl;->getBinder(Landroid/os/Bundle;Ljava/lang/String;)Landroid/os/IBinder;
2: Reflection light greylist Landroid/view/View;->mAccessibilityDelegate use(s):
Landroid/support/v4/view/ViewCompat$ViewCompatBaseImpl;->hasAccessibilityDelegate(Landroid/view/View;)Z
3: Reflection light greylist Landroid/view/View;->mMinHeight use(s):
Landroid/support/v4/view/ViewCompat$ViewCompatBaseImpl;->getMinimumHeight(Landroid/view/View;)I
4: Reflection light greylist Landroid/view/View;->mMinWidth use(s):
Landroid/support/v4/view/ViewCompat$ViewCompatBaseImpl;->getMinimumWidth(Landroid/view/View;)I
4 hidden API(s) used: 0 linked against, 4 through reflection
0 in blacklist
0 in dark greylist
4 in light greylist
To run an analysis that can give more reflection accesses,
but could include false positives, pass the --imprecise flag.
"""
Test: m (also on internal)
Bug: 110073830
Change-Id: I5114f51d1ab163e954fcffb159ef335abc289cf6
Unbundled app builds do not build the framework, only apps against
the prebuilt public API. Running veridex from the local tree does,
however, depend on the framework to generate the list of non-SDK
APIs. Disable veridex on such builds and remove appcompat.zip from
artifacts.
Test: make ANDROID_BUILDSPEC=vendor/google/build/app_build_spec.mk
Change-Id: I16289adc7fc660109d61260e8a49e992228e727c
The output of the appcompat tool is store on $(PRODUCT_OUT)/appcompat.
Bug: 110073830
Bug: 78924201
Test: m
Change-Id: Ia77cc53fc241a048958cf243ba298298f800f933
We only support relocation packing inside lld now, remove calls to
the standalone relocation packer. Any shared library built with
LOCAL_USE_CLANG_LLD := false will no longer have relocation packing.
This will also prevent relocation packing on prebuilt shared
libraries.
Also enables relocation packing on Darwin since lld will work on
Darwin.
Bug: 110715614
Test: m checkbuild
Change-Id: Ib4d4bc86f164d05dd78455c8e7605d4b4f5a2a77
Relanding with change to not run on the darwin build since host init
verifier is not possible there.
Bug: 36970783
Bug: 110477913
Test: builds pass without failures
Test: builds fail with failures in init files used via LOCAL_INIT_RC,
PRODUCT_COPY_FILES, or TARGET_PREBUILT
Change-Id: Iae93705a9320159ed97328e615eaa3bc150e6442