diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-08-02 03:01:10 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-08-02 03:01:10 +0000 |
commit | 1768cc87917ef1327539ce68a3043547a6cac415 (patch) | |
tree | 315f5c1ec827604da2a2329e316544c62a518643 | |
parent | bd96d6d434ee1aa3281093585c774ed8e76c4166 (diff) | |
parent | 58e1c5e48888b2aa71d48a5d4f274334f437f3f7 (diff) | |
download | build-android-gs-lynx-5.10-u-beta5.2.tar.gz |
Snap for 10566483 from 58e1c5e48888b2aa71d48a5d4f274334f437f3f7 to android13-gs-pixel-5.10-releaseandroid-u-beta-5_r0.7android-u-beta-5_r0.5android-u-beta-5_r0.4android-u-beta-5_r0.3android-u-beta-5_r0.2android-u-beta-5_r0.1android-u-beta-5.2_r0.7android-u-beta-5.2_r0.6android-u-beta-5.2_r0.5android-u-beta-5.2_r0.3android-u-beta-5.2_r0.1android-gs-tangorpro-5.10-u-beta5.2android-gs-tangorpro-5.10-u-beta5android-gs-raviole-5.10-u-beta5.2android-gs-raviole-5.10-u-beta5android-gs-pantah-5.10-u-beta5android-gs-lynx-5.10-u-beta5.2android-gs-lynx-5.10-u-beta5android-gs-felix-5.10-u-beta5.2android-gs-felix-5.10-u-beta5android-gs-bluejay-5.10-u-beta5.2android-gs-bluejay-5.10-u-beta5
Change-Id: Ibed331b49a1ea35170064017c50356cd697661a3
-rwxr-xr-x | build.sh | 25 | ||||
-rw-r--r-- | kleaf/common_kernels.bzl | 1 | ||||
-rw-r--r-- | kleaf/impl/kernel_env.bzl | 15 |
3 files changed, 40 insertions, 1 deletions
@@ -530,7 +530,7 @@ if [ -n "${GKI_BUILD_CONFIG}" ]; then fi # Inherit SKIP_MRPROPER, LTO, SKIP_DEFCONFIG unless overridden by corresponding GKI_* variables - GKI_ENVIRON=("SKIP_MRPROPER=${SKIP_MRPROPER}" "LTO=${LTO}" "SKIP_DEFCONFIG=${SKIP_DEFCONFIG}" "SKIP_IF_VERSION_MATCHES=${SKIP_IF_VERSION_MATCHES}") + GKI_ENVIRON=("SKIP_MRPROPER=${SKIP_MRPROPER}" "KASAN=${KASAN}" "LTO=${LTO}" "SKIP_DEFCONFIG=${SKIP_DEFCONFIG}" "SKIP_IF_VERSION_MATCHES=${SKIP_IF_VERSION_MATCHES}") # Explicitly unset EXT_MODULES since they should be compiled against the device kernel GKI_ENVIRON+=("EXT_MODULES=") # Explicitly unset GKI_BUILD_CONFIG in case it was set by in the old environment @@ -657,6 +657,29 @@ if [ "${SKIP_DEFCONFIG}" != "1" ] ; then fi fi +if [ "${KASAN}" = "sw_tags" ]; then + echo "=====================================================" + echo "Enabling KASAN" + + set -x + ${KERNEL_DIR}/scripts/config --file ${OUT_DIR}/.config \ + -e CONFIG_KASAN \ + -e CONFIG_KASAN_SW_TAGS \ + -e CONFIG_KASAN_OUTLINE \ + -e CONFIG_PANIC_ON_WARN_DEFAULT_ENABLE \ + -d CONFIG_KASAN_HW_TAGS \ + --set-val CONFIG_FRAME_WARN 0 \ + -d CFI \ + -d CFI_PERMISSIVE \ + -d CFI_CLANG \ + -d SHADOW_CALL_STACK \ + -d RANDOMIZE_BASE + + (cd ${OUT_DIR} && make ${TOOL_ARGS} O=${OUT_DIR} "${MAKE_ARGS[@]}" olddefconfig) + set +x + LTO="none" +fi + if [ "${LTO}" = "none" -o "${LTO}" = "thin" -o "${LTO}" = "full" ]; then echo "========================================================" echo " Modifying LTO mode to '${LTO}'" diff --git a/kleaf/common_kernels.bzl b/kleaf/common_kernels.bzl index a040f31..bfc1c09 100644 --- a/kleaf/common_kernels.bzl +++ b/kleaf/common_kernels.bzl @@ -83,6 +83,7 @@ _KERNEL_BUILD_ABI_VALID_KEYS = [ "abi_definition", "kmi_enforced", "module_implicit_outs", + "kmi_symbol_list_add_only", ] # Valid configs of the value of the target_config argument in diff --git a/kleaf/impl/kernel_env.bzl b/kleaf/impl/kernel_env.bzl index 6af722a..400510b 100644 --- a/kleaf/impl/kernel_env.bzl +++ b/kleaf/impl/kernel_env.bzl @@ -200,6 +200,21 @@ def _kernel_env_impl(ctx): if [[ "$(realpath ${{ROOT_DIR}}/${{KERNEL_DIR}})" != "${{ROOT_DIR}}/${{KERNEL_DIR}}" ]]; then export KCPPFLAGS="$KCPPFLAGS -ffile-prefix-map=$(realpath ${{ROOT_DIR}}/${{KERNEL_DIR}})/=" fi + + # HACK: For android13-5.10, the kernel image uses the realpath to stdarg.h + # under prebuilts. For sandbox builds, this means the real workspace root appears in the + # final artifact, affecting reproducibility and emitting absolute paths to ABI dump XML file. + # Determine the real workspace root by using ${{ROOT_DIR}}/${{KERNEL_DIR}}/Makefile as an + # anchor. If Makefile does not exist, we are not executing Kbuild, so it is fine that + # KCPPFLAGS are not set properly. + # See b/287304304 for details. + if [[ -L ${{ROOT_DIR}}/${{KERNEL_DIR}}/Makefile ]]; then + real_makefile=$(realpath ${{ROOT_DIR}}/${{KERNEL_DIR}}/Makefile) + real_kernel_dir=${{real_makefile%/Makefile}} + real_root_dir=${{real_kernel_dir%/${{KERNEL_DIR}}}} + export KCPPFLAGS="$KCPPFLAGS -ffile-prefix-map=${{real_kernel_dir}}/= -ffile-prefix-map=${{real_root_dir}}/=" + unset real_makefile real_kernel_dir real_root_dir + fi """.format( hermetic_tools_additional_setup = ctx.attr._hermetic_tools[HermeticToolsInfo].additional_setup, env = out_file.path, |