diff --git a/build.config b/build.config.bluecross similarity index 85% rename from build.config rename to build.config.bluecross index a234d469b395..3906f05b100d 100644 --- a/build.config +++ b/build.config.bluecross @@ -1,3 +1,4 @@ +DEFCONFIG=b1c1_defconfig KERNEL_DIR=private/msm-google . ${ROOT_DIR}/${KERNEL_DIR}/build.config.common.clang POST_DEFCONFIG_CMDS="check_defconfig" diff --git a/build.config.debug_api b/build.config.bluecross_debug_api similarity index 97% rename from build.config.debug_api rename to build.config.bluecross_debug_api index b9f0339c4936..1867c6114f56 100644 --- a/build.config.debug_api +++ b/build.config.bluecross_debug_api @@ -1,3 +1,4 @@ +DEFCONFIG=b1c1_defconfig KERNEL_DIR=private/msm-google . ${ROOT_DIR}/${KERNEL_DIR}/build.config.common.clang POST_DEFCONFIG_CMDS="check_defconfig && update_debug_config" diff --git a/build.config.debug_hang b/build.config.bluecross_debug_hang similarity index 97% rename from build.config.debug_hang rename to build.config.bluecross_debug_hang index 257f19b71196..e6ff4caf06e0 100644 --- a/build.config.debug_hang +++ b/build.config.bluecross_debug_hang @@ -1,3 +1,4 @@ +DEFCONFIG=b1c1_defconfig KERNEL_DIR=private/msm-google . ${ROOT_DIR}/${KERNEL_DIR}/build.config.common.clang POST_DEFCONFIG_CMDS="check_defconfig && update_debug_config" diff --git a/build.config.debug_kmemleak b/build.config.bluecross_debug_kmemleak similarity index 95% rename from build.config.debug_kmemleak rename to build.config.bluecross_debug_kmemleak index 69a94e443b89..859fc7f83899 100644 --- a/build.config.debug_kmemleak +++ b/build.config.bluecross_debug_kmemleak @@ -1,3 +1,4 @@ +DEFCONFIG=b1c1_defconfig KERNEL_DIR=private/msm-google . ${ROOT_DIR}/${KERNEL_DIR}/build.config.common.clang POST_DEFCONFIG_CMDS="check_defconfig && update_debug_config" diff --git a/build.config.debug_locking b/build.config.bluecross_debug_locking similarity index 96% rename from build.config.debug_locking rename to build.config.bluecross_debug_locking index f7d41a4f8528..fdbe96845265 100644 --- a/build.config.debug_locking +++ b/build.config.bluecross_debug_locking @@ -1,3 +1,4 @@ +DEFCONFIG=b1c1_defconfig KERNEL_DIR=private/msm-google . ${ROOT_DIR}/${KERNEL_DIR}/build.config.common.clang POST_DEFCONFIG_CMDS="check_defconfig && update_debug_config" diff --git a/build.config.debug_memory b/build.config.bluecross_debug_memory similarity index 98% rename from build.config.debug_memory rename to build.config.bluecross_debug_memory index c24a53aacf1c..99d5bc72f2d9 100644 --- a/build.config.debug_memory +++ b/build.config.bluecross_debug_memory @@ -1,3 +1,4 @@ +DEFCONFIG=b1c1_defconfig KERNEL_DIR=private/msm-google . ${ROOT_DIR}/${KERNEL_DIR}/build.config.common.clang POST_DEFCONFIG_CMDS="check_defconfig && update_debug_config" diff --git a/build.config.gcc b/build.config.bluecross_gcc similarity index 95% rename from build.config.gcc rename to build.config.bluecross_gcc index e5460e323174..de8a4442184f 100644 --- a/build.config.gcc +++ b/build.config.bluecross_gcc @@ -1,3 +1,4 @@ +DEFCONFIG=b1c1_defconfig KERNEL_DIR=private/msm-google . ${ROOT_DIR}/${KERNEL_DIR}/build.config.common KCFLAGS='-fno-tree-vrp' diff --git a/build.config.kasan b/build.config.bluecross_kasan similarity index 97% rename from build.config.kasan rename to build.config.bluecross_kasan index 6fa4e82677ea..4affb875a272 100644 --- a/build.config.kasan +++ b/build.config.bluecross_kasan @@ -1,3 +1,4 @@ +DEFCONFIG=b1c1_defconfig KERNEL_DIR=private/msm-google . ${ROOT_DIR}/${KERNEL_DIR}/build.config.common.clang POST_DEFCONFIG_CMDS="check_defconfig && update_kasan_config" diff --git a/build.config.lts b/build.config.bluecross_lts similarity index 97% rename from build.config.lts rename to build.config.bluecross_lts index 2eec061c19fa..8a0401261ef4 100644 --- a/build.config.lts +++ b/build.config.bluecross_lts @@ -1,3 +1,4 @@ +DEFCONFIG=b1c1_defconfig KERNEL_DIR=private/msm-google . ${ROOT_DIR}/${KERNEL_DIR}/build.config.common.clang PRE_DEFCONFIG_CMDS="pre_defconfig" diff --git a/build.config.no-cfi b/build.config.bluecross_no-cfi similarity index 94% rename from build.config.no-cfi rename to build.config.bluecross_no-cfi index 0bd76e8067a6..8cad289704b5 100644 --- a/build.config.no-cfi +++ b/build.config.bluecross_no-cfi @@ -1,3 +1,4 @@ +DEFCONFIG=b1c1_defconfig KERNEL_DIR=private/msm-google . ${ROOT_DIR}/${KERNEL_DIR}/build.config.common.clang POST_DEFCONFIG_CMDS="check_defconfig && update_nocfi_config" diff --git a/build.config.bonito b/build.config.bonito new file mode 100644 index 000000000000..1018888747f1 --- /dev/null +++ b/build.config.bonito @@ -0,0 +1,7 @@ +DEFCONFIG=bonito_defconfig +KERNEL_DIR=private/msm-google +. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common.clang +POST_DEFCONFIG_CMDS="check_defconfig" +UNSTRIPPED_MODULES=" +wlan.ko +" diff --git a/build.config.bonito_debug_api b/build.config.bonito_debug_api new file mode 100644 index 000000000000..ac60ca42b82b --- /dev/null +++ b/build.config.bonito_debug_api @@ -0,0 +1,25 @@ +DEFCONFIG=bonito_defconfig +KERNEL_DIR=private/msm-google +. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common.clang +POST_DEFCONFIG_CMDS="check_defconfig && update_debug_config" + +function update_debug_config() { + ${KERNEL_DIR}/scripts/config --file ${OUT_DIR}/.config \ + -e CONFIG_DMA_API_DEBUG \ + -e CONFIG_DEBUG_SHIRQ \ + -e CONFIG_DEBUG_KOBJECT \ + -e CONFIG_DEBUG_KOBJECT_RELEASE \ + -e CONFIG_DEBUG_LIST \ + -e CONFIG_DEBUG_PI_LIST \ + -e CONFIG_DEBUG_NOTIFIERS \ + -e CONFIG_DEBUG_CREDENTIALS \ + -e CONFIG_PANIC_ON_WARN_DEFAULT_ENABLE \ + -d LTO \ + -d LTO_CLANG \ + -d CFI \ + -d CFI_PERMISSIVE \ + -d CFI_CLANG \ + -d SHADOW_CALL_STACK + (cd ${OUT_DIR} && \ + make O=${OUT_DIR} $archsubarch CROSS_COMPILE=${CROSS_COMPILE} olddefconfig) +} diff --git a/build.config.bonito_debug_hang b/build.config.bonito_debug_hang new file mode 100644 index 000000000000..e9aeb13eeb3a --- /dev/null +++ b/build.config.bonito_debug_hang @@ -0,0 +1,26 @@ +DEFCONFIG=bonito_defconfig +KERNEL_DIR=private/msm-google +. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common.clang +POST_DEFCONFIG_CMDS="check_defconfig && update_debug_config" + +function update_debug_config() { + ${KERNEL_DIR}/scripts/config --file ${OUT_DIR}/.config \ + -e CONFIG_LOCKUP_DETECTOR \ + -e CONFIG_HARDLOCKUP_DETECTOR \ + -e CONFIG_HARDLOCKUP_DETECTOR_OTHER_CPU \ + -e CONFIG_BOOTPARAM_HARDLOCKUP_PANIC \ + -e CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC \ + -e CONFIG_BOOTPARAM_HUNG_TASK_PANIC \ + -e CONFIG_WQ_WATCHDOG \ + -e CONFIG_PANIC_ON_RT_THROTTLING \ + -e CONFIG_RCU_EQS_DEBUG \ + -e CONFIG_PANIC_ON_WARN_DEFAULT_ENABLE \ + -d LTO \ + -d LTO_CLANG \ + -d CFI \ + -d CFI_PERMISSIVE \ + -d CFI_CLANG \ + -d SHADOW_CALL_STACK + (cd ${OUT_DIR} && \ + make O=${OUT_DIR} $archsubarch CROSS_COMPILE=${CROSS_COMPILE} olddefconfig) +} diff --git a/build.config.bonito_debug_kmemleak b/build.config.bonito_debug_kmemleak new file mode 100644 index 000000000000..7c07f23d2ded --- /dev/null +++ b/build.config.bonito_debug_kmemleak @@ -0,0 +1,17 @@ +DEFCONFIG=bonito_defconfig +KERNEL_DIR=private/msm-google +. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common.clang +POST_DEFCONFIG_CMDS="check_defconfig && update_debug_config" + +function update_debug_config() { + ${KERNEL_DIR}/scripts/config --file ${OUT_DIR}/.config \ + --set-val DEBUG_KMEMLEAK_EARLY_LOG_SIZE 4500 \ + -e CONFIG_DEBUG_KMEMLEAK \ + -d LTO \ + -d LTO_CLANG \ + -d CFI \ + -d CFI_PERMISSIVE \ + -d CFI_CLANG + (cd ${OUT_DIR} && \ + make O=${OUT_DIR} $archsubarch CROSS_COMPILE=${CROSS_COMPILE} olddefconfig) +} diff --git a/build.config.bonito_debug_locking b/build.config.bonito_debug_locking new file mode 100644 index 000000000000..e1350b93cf26 --- /dev/null +++ b/build.config.bonito_debug_locking @@ -0,0 +1,23 @@ +DEFCONFIG=bonito_defconfig +KERNEL_DIR=private/msm-google +. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common.clang +POST_DEFCONFIG_CMDS="check_defconfig && update_debug_config" + +function update_debug_config() { + ${KERNEL_DIR}/scripts/config --file ${OUT_DIR}/.config \ + -e CONFIG_DEBUG_RT_MUTEXES \ + -e CONFIG_DEBUG_SPINLOCK \ + -e CONFIG_DEBUG_SPINLOCK_PANIC_ON_BUG \ + -e CONFIG_DEBUG_MUTEXES \ + -e CONFIG_DEBUG_PREEMPT \ + -e CONFIG_DEBUG_ATOMIC_SLEEP \ + -e CONFIG_PANIC_ON_WARN_DEFAULT_ENABLE \ + -d LTO \ + -d LTO_CLANG \ + -d CFI \ + -d CFI_PERMISSIVE \ + -d CFI_CLANG \ + -d SHADOW_CALL_STACK + (cd ${OUT_DIR} && \ + make O=${OUT_DIR} $archsubarch CROSS_COMPILE=${CROSS_COMPILE} olddefconfig) +} diff --git a/build.config.bonito_debug_memory b/build.config.bonito_debug_memory new file mode 100644 index 000000000000..523755cac172 --- /dev/null +++ b/build.config.bonito_debug_memory @@ -0,0 +1,48 @@ +DEFCONFIG=bonito_defconfig +KERNEL_DIR=private/msm-google +. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common.clang +POST_DEFCONFIG_CMDS="check_defconfig && update_debug_config" + +function update_debug_config() { + ${KERNEL_DIR}/scripts/config --file ${OUT_DIR}/.config \ + -e CONFIG_DEVMEM \ + -e CONFIG_DEBUG_OBJECTS \ + -e CONFIG_DEBUG_OBJECTS_FREE \ + -e CONFIG_DEBUG_OBJECTS_TIMERS \ + -e CONFIG_DEBUG_OBJECTS_WORK \ + -e CONFIG_DEBUG_OBJECTS_RCU_HEAD \ + -e CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER \ + -e CONFIG_DEBUG_VM \ + -e CONFIG_DEBUG_VM_VMACACHE \ + -e CONFIG_DEBUG_VM_RB \ + -e CONFIG_DEBUG_MEMORY_INIT \ + -e CONFIG_DEBUG_STACK_USAGE \ + -e CONFIG_DEBUG_PAGEALLOC \ + -e CONFIG_DEBUG_PAGEALLOC_ENABLE_DEFAULT \ + -e CONFIG_SCHED_STACK_END_CHECK \ + -e CONFIG_SLUB_DEBUG \ + -e CONFIG_SLUB_DEBUG_PANIC_ON \ + -e CONFIG_PAGE_OWNER \ + -e CONFIG_PAGE_OWNER_ENABLE_DEFAULT \ + -e CONFIG_PAGE_POISONING \ + -e CONFIG_PAGE_POISONING_ENABLE_DEFAULT \ + -e CONFIG_DEBUG_SPINLOCK \ + -e CONFIG_DEBUG_SPINLOCK_PANIC_ON_BUG \ + -e CONFIG_DEBUG_MUTEXES \ + -e CONFIG_DEBUG_ATOMIC_SLEEP \ + -e CONFIG_DEBUG_LIST \ + -e CONFIG_QCOM_RTB \ + -e CONFIG_QCOM_RTB_SEPARATE_CPUS \ + -e CONFIG_PANIC_ON_DATA_CORRUPTION \ + -e CONFIG_QCOM_RTB \ + -e CONFIG_QCOM_RTB_SEPARATE_CPUS \ + -e CONFIG_REGMAP_ALLOW_WRITE_DEBUGFS \ + -e CONFIG_PANIC_ON_WARN_DEFAULT_ENABLE \ + -d LTO \ + -d LTO_CLANG \ + -d CFI \ + -d CFI_PERMISSIVE \ + -d CFI_CLANG + (cd ${OUT_DIR} && \ + make O=${OUT_DIR} $archsubarch CROSS_COMPILE=${CROSS_COMPILE} olddefconfig) +} diff --git a/build.config.bonito_gcc b/build.config.bonito_gcc new file mode 100644 index 000000000000..615dbbfac0da --- /dev/null +++ b/build.config.bonito_gcc @@ -0,0 +1,18 @@ +DEFCONFIG=bonito_defconfig +KERNEL_DIR=private/msm-google +. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common +KCFLAGS='-fno-tree-vrp' +POST_DEFCONFIG_CMDS="check_defconfig && update_gcc_config" + +function update_gcc_config() { + # Disable clang-specific options + ${KERNEL_DIR}/scripts/config --file ${OUT_DIR}/.config \ + -d LTO \ + -d LTO_CLANG \ + -d CFI \ + -d CFI_PERMISSIVE \ + -d CFI_CLANG \ + -d SHADOW_CALL_STACK + (cd ${OUT_DIR} && \ + make O=${OUT_DIR} $archsubarch CROSS_COMPILE=${CROSS_COMPILE} olddefconfig) +} diff --git a/build.config.bonito_kasan b/build.config.bonito_kasan new file mode 100644 index 000000000000..ddf1ba2cbe08 --- /dev/null +++ b/build.config.bonito_kasan @@ -0,0 +1,26 @@ +DEFCONFIG=bonito_defconfig +KERNEL_DIR=private/msm-google +. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common.clang +POST_DEFCONFIG_CMDS="check_defconfig && update_kasan_config" + +function update_kasan_config() { + ${KERNEL_DIR}/scripts/config --file ${OUT_DIR}/.config \ + -e CONFIG_KASAN \ + -e CONFIG_KASAN_INLINE \ + -e CONFIG_TEST_KASAN \ + -e CONFIG_KCOV \ + -e CONFIG_SLUB \ + -e CONFIG_PANIC_ON_WARN_DEFAULT_ENABLE \ + -d CONFIG_KASAN_OUTLINE \ + -d CONFIG_RANDOMIZE_BASE \ + -d CONFIG_CC_WERROR \ + --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 O=${OUT_DIR} $archsubarch CROSS_COMPILE=${CROSS_COMPILE} olddefconfig) +} diff --git a/build.config.bonito_lts b/build.config.bonito_lts new file mode 100644 index 000000000000..4d5e87e5a3ec --- /dev/null +++ b/build.config.bonito_lts @@ -0,0 +1,23 @@ +DEFCONFIG=bonito_defconfig +KERNEL_DIR=private/msm-google +. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common.clang +PRE_DEFCONFIG_CMDS="pre_defconfig" +POST_DEFCONFIG_CMDS="check_defconfig" +POST_KERNEL_BUILD_CMDS="post_kernel_build" + +function pre_defconfig() { + # Watch KERNEL_DIR recursively, record all files opened during the build + rm -f ${OUT_DIR}/kernel-files.tmp1 + inotifywait -m -r -e open --format '%w%f' ${KERNEL_DIR} -o ${OUT_DIR}/kernel-files.tmp1 & + PID_INOTIFYWAIT=$! + sleep 5 +} + +function post_kernel_build() { + # Stop watching KERNEL_DIR + kill ${PID_INOTIFYWAIT} + # Generate list of touched files and merge commit message + cat ${OUT_DIR}/kernel-files.tmp1 | sed "s,${KERNEL_DIR}/,,g" | sort -u > ${OUT_DIR}/kernel-files.tmp2 + (set +x; for f in $(cat ${OUT_DIR}/kernel-files.tmp2); do [ -f "${KERNEL_DIR}/${f}" ] && echo "${f}"; done > ${OUT_DIR}/kernel-files.txt) + (cd ${KERNEL_DIR} && ${ROOT_DIR}/build/buildinfo/generate-merge-commit-msg.py HEAD~1..HEAD ${OUT_DIR}/kernel-files.txt > ${OUT_DIR}/merge-commit-msg.txt) +} diff --git a/build.config.bonito_no-cfi b/build.config.bonito_no-cfi new file mode 100644 index 000000000000..9cee4322be27 --- /dev/null +++ b/build.config.bonito_no-cfi @@ -0,0 +1,16 @@ +DEFCONFIG=bonito_defconfig +KERNEL_DIR=private/msm-google +. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common.clang +POST_DEFCONFIG_CMDS="check_defconfig && update_nocfi_config" + +function update_nocfi_config() { + # Disable clang-specific options + ${KERNEL_DIR}/scripts/config --file ${OUT_DIR}/.config \ + -d LTO \ + -d LTO_CLANG \ + -d CFI \ + -d CFI_PERMISSIVE \ + -d CFI_CLANG + (cd ${OUT_DIR} && \ + make O=${OUT_DIR} $archsubarch CROSS_COMPILE=${CROSS_COMPILE} olddefconfig) +} diff --git a/build_bluecross.sh b/build_bluecross.sh new file mode 100755 index 000000000000..2997bd1bb254 --- /dev/null +++ b/build_bluecross.sh @@ -0,0 +1 @@ +BUILD_CONFIG=private/msm-google/build.config.bluecross_no-cfi build/build.sh diff --git a/build_bonito.sh b/build_bonito.sh new file mode 100755 index 000000000000..91f9e93c91b9 --- /dev/null +++ b/build_bonito.sh @@ -0,0 +1 @@ +BUILD_CONFIG=private/msm-google/build.config.bonito_no-cfi build/build.sh