summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsaac J. Manjarres <isaacmanjarres@google.com>2023-02-24 15:47:08 -0800
committerIsaac J. Manjarres <isaacmanjarres@google.com>2023-02-27 16:06:49 -0800
commitcc5f8b3717cddb1336555c6f7bbe7e4ab2e83bd0 (patch)
treeeade28704d57ca4e5efb58d196257b8f847ce321
parente33c0a8a267d7631c275347f8740d3fa1a307fe7 (diff)
downloadmsm-cc5f8b3717cddb1336555c6f7bbe7e4ab2e83bd0.tar.gz
Add support for building a GKI based debug kernel with KASAN enabled
Add build config fragment to build a GKI based debug kernel with SW tags based KASAN enabled. Since this is a debug kernel, it is okay to disable symbol trimming. Bug: 270214182 Change-Id: I7438015969a2a17416e8533a5703b84945f3c774 Signed-off-by: Isaac J. Manjarres <isaacmanjarres@google.com>
-rw-r--r--build.config.sw5100.kasan_swtags19
1 files changed, 19 insertions, 0 deletions
diff --git a/build.config.sw5100.kasan_swtags b/build.config.sw5100.kasan_swtags
new file mode 100644
index 0000000..b44571e
--- /dev/null
+++ b/build.config.sw5100.kasan_swtags
@@ -0,0 +1,19 @@
+# Disable ABI monitoring, as this config is only used for debug builds.
+TRIM_NONLISTED_KMI=0
+KMI_SYMBOL_LIST_STRICT_MODE=0
+
+append_cmd POST_DEFCONFIG_CMDS update_kasan_config
+
+function update_kasan_config() {
+ ${KERNEL_DIR}/scripts/config --file ${OUT_DIR}/.config \
+ -e CONFIG_KASAN \
+ -d CONFIG_KASAN_HW_TAGS \
+ -e CONFIG_KASAN_SW_TAGS \
+ -d CONFIG_KASAN_OUTLINE \
+ -e CONFIG_KASAN_INLINE \
+ -e CONFIG_KASAN_PANIC_ON_WARN \
+ -e CONFIG_PANIC_ON_WARN_DEFAULT_ENABLE \
+ --set-val CONFIG_FRAME_WARN 0
+ (cd ${OUT_DIR} && \
+ make O=${OUT_DIR} "${TOOL_ARGS[@]}" ${MAKE_ARGS} olddefconfig)
+}