You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/functions/compilation/kernel-make.sh
+20-4Lines changed: 20 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,14 @@ function run_kernel_make_internal() {
37
37
# Add the distcc envs, if any.
38
38
common_make_envs+=("${DISTCC_EXTRA_ENVS[@]}")
39
39
40
+
if [[ "${KERNEL_COMPILER}"=="clang" ]];then
41
+
llvm_flag="LLVM=1"
42
+
cc_name="CC"
43
+
extra_warnings="-Wno-error=unused-command-line-argument -Wno-error=unknown-warning-option"# downgrade errors to warnings
44
+
else
45
+
cc_name="CROSS_COMPILE"
46
+
extra_warnings=""
47
+
fi
40
48
common_make_params_quoted=(
41
49
# @TODO: introduce O=path/to/binaries, so sources and bins are not in the same dir; this has high impact in headers packaging though.
42
50
@@ -45,8 +53,8 @@ function run_kernel_make_internal() {
45
53
"ARCH=${ARCHITECTURE}"# Key param. Everything depends on this.
46
54
"LOCALVERSION=-${BRANCH}-${LINUXFAMILY}"# Change the internal kernel version to include the family. Changing this causes recompiles # @TODO change hack at .config; that might handles mtime better
47
55
48
-
"CROSS_COMPILE=${CCACHE}${DISTCC_CROSS_COMPILE_PREFIX[@]}${KERNEL_COMPILER}"# added as prefix to every compiler invocation by make
49
-
"KCFLAGS=-fdiagnostics-color=always -Wno-error=misleading-indentation ${KERNEL_EXTRA_CFLAGS:-""}"# Force GCC colored messages, downgrade misleading indentation to warning
56
+
"${cc_name}=${CCACHE}${DISTCC_CROSS_COMPILE_PREFIX[@]}${KERNEL_COMPILER}"# added as prefix to every compiler invocation by make
57
+
"KCFLAGS=-fdiagnostics-color=always -Wno-error=misleading-indentation ${extra_warnings}${KERNEL_EXTRA_CFLAGS:-""}"# Force GCC colored messages, downgrade misleading indentation to warning
50
58
51
59
"SOURCE_DATE_EPOCH=${kernel_base_revision_ts}"# https://reproducible-builds.org/docs/source-date-epoch/ and https://www.kernel.org/doc/html/latest/kbuild/reproducible-builds.html
@@ -55,6 +63,9 @@ function run_kernel_make_internal() {
55
63
56
64
"KGZIP=pigz""KBZIP2=pbzip2"# Parallel compression, use explicit parallel compressors https://lore.kernel.org/lkml/[email protected]/ # @TODO: what about XZ?
57
65
)
66
+
if [[ -n"${llvm_flag}" ]];then
67
+
common_make_params_quoted+=("${llvm_flag}")
68
+
fi
58
69
59
70
# last statement, so it passes the result to calling function. "env -i" is used for empty env
0 commit comments