12345678910111213141516171819202122232425262728293031323334353637383940 |
- --- dkms.in 2022-07-15 03:42:14.000000000 -0300
- +++ dkms.in 2022-09-10 22:26:16.103277917 -0300
- @@ -926,6 +926,17 @@
- esac
- }
-
- +check_clang()
- +{
- + set_kernel_source_dir "$kernelver"
- + if [[ ! -z $(strings ${kernel_source_dir}/vmlinux | grep clang) ]] ; then
- + _clangopts="CC=clang LD=ld.lld AR=llvm-ar NM=llvm-nm RANLIB=llvm-ranlib STRIP=llvm-strip OBJCOPY=llvm-objcopy"
- + echo "Using llvm tools..."
- + else
- + _clangopts=""
- + fi
- +}
- +
- # Get ready to build a module that has been registered with DKMS.
- prepare_build()
- {
- @@ -937,6 +948,9 @@
- local -r base_dir="$dkms_tree/$module/$module_version/$kernelver/$arch"
- local -r build_dir="$dkms_tree/$module/$module_version/build"
- local -r source_dir="$dkms_tree/$module/$module_version/source"
- +
- + # check if the kernel was compiled with clang
- + check_clang
-
- # Check that the module has not already been built for this kernel
- [[ -d $base_dir ]] && die 3 \
- @@ -994,7 +1008,7 @@
- invoke_command "$clean" "Cleaning build area" background
- echo $"DKMS make.log for $module-$module_version for kernel $kernelver ($arch)" >> "$build_log"
- date >> "$build_log"
- - local the_make_command="${make_command/#make/make -j$parallel_jobs KERNELRELEASE=$kernelver}"
- + local the_make_command="${make_command/#make/make -j$parallel_jobs KERNELRELEASE=$kernelver $_clangopts}"
-
- invoke_command "{ $the_make_command; } >> $build_log 2>&1" "$the_make_command" background || \
- report_build_problem 10 $"Bad return status for module build on kernel: $kernelver ($arch)" \
|