platform_build_soong/scripts
Jiakai Zhang 7d292228c1 Determine GC type based on BUILT_KERNEL_VERSION_FILE.
How it works:
1. build/make/core/Makefile generates a txt file with the kernel
   version, which is taken from an explicit BOARD_KERNEL_VERSION value,
   or extracted from the kernel image on the source tree, or extracted
   from the kernel image extracted from the prebuilt boot.img.
   The file is saved at
   $ANDROID_PRODUCT_OUT/obj/PACKAGING/check_vintf_all_intermediates/kernel_version.txt.
2. If PRODUCT_ENABLE_UFFD_GC is "default", meaning the GC type needs to
   be determined by the kernel version, build/make/core/Makefile copies
   kernel_version.txt to
   out/soong/dexpreopt/kernel_version_for_uffd_gc.txt.
3. build/soong/dexpreopt/config.go writes the the UFFD GC flag to
   out/soong/dexpreopt/uffd_gc_flag.txt. The flag is determined by an
   explicit PRODUCT_ENABLE_UFFD_GC value or by contruct_uffd_gc_flag.py,
   which reads kernel_version_for_uffd_gc.txt and determines the flag
   accordingly.
4. dex2oat takes the UFFD GC flag from uffd_gc_flag.txt.
5. post_process_props.py mangles ro.dalvik.vm.enable_uffd_gc based on
   the same logic.

Bug: 321751629
Bug: 319554951
Bug: 318763448
Bug: 319648491
Test: m --no-skip-soong-tests nothing
Test: atest uffd_gc_utils_test
Test: Build with `OVERRIDE_ENABLE_UFFD_GC=default m` for device with no
  UFFD support -
  1. Check the existence of `-Xgc:CMC` in
     out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot.invocation
     (dex2oat invocation for a boot image)
  2. Check the existence of `-Xgc:CMC` in
     out/soong/.intermediates/packages/apps/Settings/Settings/android_common/dexpreopt/Settings/oat/arm64/package.invocation
     (dex2oat invocation for an app defined in .bp)
  3. Check the existence of `-Xgc:CMC` in
     $ANDROID_PRODUCT_OUT/obj/APPS/Dialer_intermediates/oat/arm64/package.invocation
     (dex2oat invocation for an app defined in .mk)
  4. Check the value of ro.dalvik.vm.enable_uffd_gc in
     $ANDROID_PRODUCT_OUT/product/etc/build.prop
Test: Build with `OVERRIDE_ENABLE_UFFD_GC=default m` for device with
  UFFD support, and do the steps above.
Test: Build with `OVERRIDE_ENABLE_UFFD_GC=true m`, and do the steps
  above.
Test: Build with `OVERRIDE_ENABLE_UFFD_GC=false m`, and do the steps
  above.

Change-Id: I035ad32233e49e2a30ce11f6c7c318a648511ef8
2024-02-02 09:23:37 +08:00
..
check_boot_jars Add java.util.random to the allowed package list. 2023-10-31 16:05:52 +00:00
hiddenapi Allow obfuscated classes on bootclasspath 2023-01-18 12:59:23 +00:00
Android.bp Determine GC type based on BUILT_KERNEL_VERSION_FILE. 2024-02-02 09:23:37 +08:00
archive_repack.sh
build-apex-bundle.py Add a host tool to create an APEX bundle 2022-09-21 13:27:49 +09:00
build-ndk-prebuilts.sh ndk: Hard-code the TARGET_RELEASE 2023-11-09 12:43:38 -07:00
build-rustdocs.sh
build_broken_logs.go
check_do_not_merge.sh
check_prebuilt_presigned_apk.py Error out if skip_preprocessed_apk_checks is set when it's not necessary 2023-09-06 16:11:44 -07:00
construct_context.py Move CLC construction to Ninja phase. 2023-05-30 15:46:38 +01:00
construct_context_test.py Move CLC construction to Ninja phase. 2023-05-30 15:46:38 +01:00
construct_uffd_gc_flag.py Determine GC type based on BUILT_KERNEL_VERSION_FILE. 2024-02-02 09:23:37 +08:00
conv_linker_config.py Deprecate 'contributions' field from linkerconfig 2023-11-08 13:38:36 +09:00
conv_linker_config_test.py Add tests for conv_linker_config 2023-03-09 07:46:25 +00:00
diff_build_graphs.sh
freeze-sysprop-api-files.sh
gen-java-current-api-files.sh
gen-kotlin-build-file.py
gen-sysprop-api-files.sh
gen_java_usedby_apex.sh
gen_ndk_backedby_apex.sh
gen_ndk_usedby_apex.sh bazel apex: clean up gen_ndk_usedby_apex.sh to work in bazel sandbox. 2022-11-07 08:38:01 +00:00
get_clang_version.py
get_clang_version_test.py
jar-args.sh
jar-wrapper.sh
jars-to-module-info-java.sh
jsonmodify.py
jsonmodify_test.py
keep-flagged-apis.sh Introduce script and module to pass aconfig flags to metalava 2023-12-27 19:31:51 +00:00
lint_project_xml.py Simplify strict updatability linting error message 2024-01-17 17:11:51 -08:00
lint_project_xml_test.py
list_image.sh
manifest.py
manifest_check.py Fix manifest_check.py for generated manifests that have no application tag 2023-10-06 13:24:38 -07:00
manifest_check_test.py
manifest_fixer.py
manifest_fixer_test.py
microfactory.bash Add prebuilts/ to microfactory includes 2022-10-19 11:11:45 -04:00
modify_permissions_allowlist.py Add script for modifying privapp permission allowlists 2023-05-02 15:10:16 -04:00
modify_permissions_allowlist_test.py Add script for modifying privapp permission allowlists 2023-05-02 15:10:16 -04:00
ninja_rsp.py
package-check.sh
reverse-deps.sh
run-ckati.sh Run ckati step of the Android build tracing given variables 2023-01-04 10:08:43 -08:00
run-soong-tests-with-go-tools.sh Don't set CC and CXX when running go build on mac 2024-01-19 19:32:56 +00:00
rustfmt.toml
setup-android-build.sh
setup_go_workspace_for_soong.sh
strip.sh Build native libraries used by layoutlib. 2023-12-12 05:06:20 +00:00
system-clang-format
system-clang-format-2
test_config_fixer.py Allow android tests to specify a mainline package name 2023-02-08 12:38:50 -08:00
test_config_fixer_test.py Allow android tests to specify a mainline package name 2023-02-08 12:38:50 -08:00
toc.sh
transitive-deps.sh
uffd_gc_utils.py Determine GC type based on BUILT_KERNEL_VERSION_FILE. 2024-02-02 09:23:37 +08:00
uffd_gc_utils_test.py Determine GC type based on BUILT_KERNEL_VERSION_FILE. 2024-02-02 09:23:37 +08:00
unpack-prebuilt-apex.sh Fix the number of required parameters in deapexer script. 2023-07-14 17:26:13 +00:00
update_out