Gentoo Archives: gentoo-commits

From: Piotr Karbowski <slashbeast@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-admin/ryzen_smu/
Date: Sat, 29 Oct 2022 16:06:53
Message-Id: 1667059607.9c1beee8e43ecd644bc1f7f473ea4e4a7098ceeb.slashbeast@gentoo
1 commit: 9c1beee8e43ecd644bc1f7f473ea4e4a7098ceeb
2 Author: Adel KARA SLIMANE <adel.ks <AT> zegrapher <DOT> com>
3 AuthorDate: Sat Oct 22 17:01:48 2022 +0000
4 Commit: Piotr Karbowski <slashbeast <AT> gentoo <DOT> org>
5 CommitDate: Sat Oct 29 16:06:47 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9c1beee8
7
8 app-admin/ryzen_smu: handle clang built kernels OOTB
9
10 If the kernel has been built with a different version of clang
11 than the default one, the emerge will fail as expected.
12
13 Signed-off-by: Adel KARA SLIMANE <adel.ks <AT> zegrapher.com>
14 Closes: https://github.com/gentoo/gentoo/pull/22143
15 Signed-off-by: Piotr Karbowski <slashbeast <AT> gentoo.org>
16
17 app-admin/ryzen_smu/ryzen_smu-0.1.2_p20211205.ebuild | 12 +++++++++++-
18 1 file changed, 11 insertions(+), 1 deletion(-)
19
20 diff --git a/app-admin/ryzen_smu/ryzen_smu-0.1.2_p20211205.ebuild b/app-admin/ryzen_smu/ryzen_smu-0.1.2_p20211205.ebuild
21 index aa763072c39c..96e15892d055 100644
22 --- a/app-admin/ryzen_smu/ryzen_smu-0.1.2_p20211205.ebuild
23 +++ b/app-admin/ryzen_smu/ryzen_smu-0.1.2_p20211205.ebuild
24 @@ -26,7 +26,17 @@ pkg_setup() {
25 linux-mod_pkg_setup
26
27 BUILD_TARGETS="modules"
28 - BUILD_PARAMS="CC=$(tc-getCC) KERNEL_BUILD=${KERNEL_DIR}"
29 + BUILD_PARAMS="KERNEL_BUILD=${KERNEL_DIR}"
30 + if linux_chkconfig_present CC_IS_CLANG; then
31 + BUILD_PARAMS+=" CC=${CHOST}-clang"
32 + if linux_chkconfig_present LD_IS_LLD; then
33 + BUILD_PARAMS+=' LD=ld.lld'
34 + if linux_chkconfig_present LTO_CLANG_THIN; then
35 + # kernel enables cache by default leading to sandbox violations
36 + BUILD_PARAMS+=' ldflags-y=--thinlto-cache-dir= LDFLAGS_MODULE=--thinlto-cache-dir='
37 + fi
38 + fi
39 + fi
40 }
41
42 src_install() {