Use exact compiler for dkms as used to build the kernel

Ubuntu kernel builds do not export .kernelvariables file, thus extend
CC detection to read compiler binary from the .config file

Gbp-Pq: Name exact-cc.patch
This commit is contained in:
Openkylin Developers 2022-10-09 17:17:08 +08:00 committed by luoyaoming
parent 16e620274f
commit ffec765dc5
1 changed files with 7 additions and 0 deletions

View File

@ -1006,6 +1006,13 @@ actual_build()
unset CC
fi
if [[ -e $kernel_source_dir/.config ]]; then
cc=$(sed -n 's|^CONFIG_CC_VERSION_TEXT="\([^ ]*\) .*"|\1|p' $kernel_source_dir/.config)
if command -v "$cc" >/dev/null; then
export CC="$cc"
fi
fi
invoke_command "$clean" "Cleaning build area" background
echo $"DKMS make.log for $module-$module_version for kernel $kernelver ($arch)" >> "$build_log"
date >> "$build_log"