diff --git a/dkms.in b/dkms.in index e3a35a25..417a4082 100644 --- a/dkms.in +++ b/dkms.in @@ -1037,10 +1037,12 @@ prepare_build() done if [[ -e "${kernel_config}" ]]; then - cc=$(sed -n 's|^CONFIG_CC_VERSION_TEXT="\([^ ]*\) .*"|\1|p' "${kernel_config}") - if command -v "$cc" >/dev/null; then - export CC="$cc" - export KERNEL_CC="$cc" + if grep -q 'CONFIG_CC_IS_CLANG=y' "${kernel_config}"; then + cc=clang + if command -v "$cc" >/dev/null; then + export CC="$cc" + export KERNEL_CC="$cc" + fi fi if grep -q 'CONFIG_LD_IS_LLD=y' "${kernel_config}"; then