This repository has been archived by the owner on Jul 17, 2024. It is now read-only.
forked from mvaisakh/oneplus9pro
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.config.common.gcc
88 lines (72 loc) · 2.13 KB
/
build.config.common.gcc
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
BRANCH=android11-5.4
KMI_GENERATION=2
DEPMOD=depmod
BUILDTOOLS_PREBUILT_BIN=build/build-tools/path/linux-x86
MKDTBO_EXT=${ROOT_DIR}/tools/libufdt/utils/src/mkdtboimg.py
KCFLAGS="${KCFLAGS} -D__ANDROID_COMMON_KERNEL__"
STOP_SHIP_TRACEPRINTK=1
if ![ ${VARIANT} == ngki ]; then
IN_KERNEL_MODULES=1
fi
DO_NOT_STRIP_MODULES=1
append_cmd POST_DEFCONFIG_CMDS "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)
}
function enable_gcc_lto() {
# Enable GCC LTO
${KERNEL_DIR}/scripts/config --file ${OUT_DIR}/.config \
-e LTO \
-e LTO_MENU \
-e LTO_GCC \
-d IKHEADERS
(cd ${OUT_DIR} && \
make O=${OUT_DIR} $archsubarch CROSS_COMPILE=${CROSS_COMPILE} olddefconfig)
}
function enable_gcc_graphite() {
# Enable GCC Graphite
${KERNEL_DIR}/scripts/config --file ${OUT_DIR}/.config \
-e GCC_GRAPHITE
(cd ${OUT_DIR} && \
make O=${OUT_DIR} $archsubarch CROSS_COMPILE=${CROSS_COMPILE} olddefconfig)
}
function enable_gcov_kernel() {
# Enable Coverage
${KERNEL_DIR}/scripts/config --file ${OUT_DIR}/.config \
-e DEBUG_KERNEL \
-e DEBUG_FS \
-e TRACING \
-e PROFILE_ALL_BRANCHES \
-e GCOV_KERNEL \
-e GCOV_PROFILE_ALL
(cd ${OUT_DIR} && \
make O=${OUT_DIR} $archsubarch CROSS_COMPILE=${CROSS_COMPILE} olddefconfig)
}
function enable_pgo_kernel() {
# Enable Coverage
${KERNEL_DIR}/scripts/config --file ${OUT_DIR}/.config \
-e PGO
(cd ${OUT_DIR} && \
make O=${OUT_DIR} $archsubarch CROSS_COMPILE=${CROSS_COMPILE} olddefconfig)
}
if [ ${GCOV_PROFILE} == "1" ]; then
append_cmd POST_DEFCONFIG_CMDS "enable_gcov_kernel"
fi
if [ ${GCC_LTO} == "1" ]; then
append_cmd POST_DEFCONFIG_CMDS "enable_gcc_lto"
fi
if [ ${GRAPHITE} == "1" ]; then
append_cmd POST_DEFCONFIG_CMDS "enable_gcc_graphite"
fi
if [ ${PGO} == "1" ]; then
append_cmd POST_DEFCONFIG_CMDS "enable_pgo_kernel"
fi