app-admin/ryzen_smu: handle clang built kernels OOTB

If the kernel has been built with a different version of clang
than the default one, the emerge will fail as expected.

Signed-off-by: Adel KARA SLIMANE <adel.ks@zegrapher.com>
Closes: https://github.com/gentoo/gentoo/pull/22143
Signed-off-by: Piotr Karbowski <slashbeast@gentoo.org>
This commit is contained in:
Adel KARA SLIMANE
2022-10-22 19:01:48 +02:00
committed by Piotr Karbowski
parent 12cfd69ccd
commit 9c1beee8e4

View File

@@ -26,7 +26,17 @@ pkg_setup() {
linux-mod_pkg_setup
BUILD_TARGETS="modules"
BUILD_PARAMS="CC=$(tc-getCC) KERNEL_BUILD=${KERNEL_DIR}"
BUILD_PARAMS="KERNEL_BUILD=${KERNEL_DIR}"
if linux_chkconfig_present CC_IS_CLANG; then
BUILD_PARAMS+=" CC=${CHOST}-clang"
if linux_chkconfig_present LD_IS_LLD; then
BUILD_PARAMS+=' LD=ld.lld'
if linux_chkconfig_present LTO_CLANG_THIN; then
# kernel enables cache by default leading to sandbox violations
BUILD_PARAMS+=' ldflags-y=--thinlto-cache-dir= LDFLAGS_MODULE=--thinlto-cache-dir='
fi
fi
fi
}
src_install() {