summaryrefslogtreecommitdiff
path: root/build.config.virtual_device_kasan.aarch64
blob: 3794b22484361e9d418f657bf9d9fd3d58d5f75c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
. ${ROOT_DIR}/common-modules/virtual-device/build.config.virtual_device

. ${ROOT_DIR}/${KERNEL_DIR}/build.config.aarch64
. ${ROOT_DIR}/${KERNEL_DIR}/build.config.gki_kasan

DEFCONFIG=vd_aarch_64_gki_defconfig

# HACK: bug in bash 5.2 that if the last command of the eval in a subshell is not a built-in
#   command, the subshell exits prematurely. This is fixed in 5.2.15 but we leave
#   this hack in until bash becomes hermetic (unlikely).
#   See b/275468906#comment8
PRE_DEFCONFIG_CMDS="mkdir -p \${OUT_DIR}/arch/arm64/configs && \
     KCONFIG_CONFIG=\${OUT_DIR}/arch/arm64/configs/${DEFCONFIG} \
          ${ROOT_DIR}/${KERNEL_DIR}/scripts/kconfig/merge_config.sh -m -r \
          ${ROOT_DIR}/${KERNEL_DIR}/arch/arm64/configs/gki_defconfig \
          ${ROOT_DIR}/common-modules/virtual-device/virtual_device_core.fragment \
          ${ROOT_DIR}/common-modules/virtual-device/virtual_device.fragment \
          ${ROOT_DIR}/common-modules/virtual-device/aarch64.fragment && \
     true"
POST_DEFCONFIG_CMDS="update_kasan_config"
EXT_MODULES="common-modules/virtual-device"

function update_kasan_config() {
    ${KERNEL_DIR}/scripts/config --file ${OUT_DIR}/.config \
         -e CONFIG_KASAN \
         -e CONFIG_KASAN_INLINE \
         -e CONFIG_KASAN_PANIC_ON_WARN \
         -e CONFIG_KCOV \
         -e CONFIG_PANIC_ON_WARN_DEFAULT_ENABLE \
         -d CONFIG_RANDOMIZE_BASE \
         -d CONFIG_KASAN_OUTLINE \
         --set-val CONFIG_FRAME_WARN 0 \
         -d LTO \
         -d LTO_CLANG \
         -d CFI \
         -d CFI_PERMISSIVE \
         -d CFI_CLANG \
         -d SHADOW_CALL_STACK
    (cd ${OUT_DIR} && \
     make ${TOOL_ARGS} O=${OUT_DIR} olddefconfig)
}

# Not saving any kernel images. This build step is meant purely to generate the .kos.
FILES=""