games-util/xone: Set KERNEL_CC to clang uncondtionally, fix ld.lld

* Final fix for Ref #43

Signed-off-by: Alfred Wingate <parona@protonmail.com>
This commit is contained in:
Alfred Wingate 2022-12-23 14:24:18 +02:00
parent a42d120419
commit 0f558c188d
No known key found for this signature in database
GPG Key ID: A12750536B5E7010

View File

@ -3,7 +3,7 @@
EAPI=8
inherit toolchain-funcs linux-mod
inherit linux-mod
DESCRIPTION="Linux kernel driver for Xbox One and Xbox Series X|S accessories"
@ -45,18 +45,17 @@ pkg_setup() {
BUILD_PARAMS="KERNEL_DIR=${KERNEL_DIR} V=1"
# TODO: more robust solution in linux-mod would be ideal
KERNEL_CC="$(tc-getCC)"
if linux_chkconfig_present CC_IS_CLANG; then
tc-is-clang || : "${KERNEL_CC:=${CHOST}-clang}"
"${KERNEL_CC:=${CHOST}-clang}"
if linux_chkconfig_present LD_IS_LLD; then
: "${KERNEL_LD:=ld.ldd}"
: "${KERNEL_LD:=ld.lld}"
if linux_chkconfig_present LTO_CLANG_THIN; then
BUILD_PARAMS+=" ldflags-y=--thinlto-cache-dir= LDFLAGS_MODULE=--thinlto-cache-dir="
fi
fi
fi
BUILD_PARAMS+=" CC=${KERNEL_CC} ${KERNEL_LD:+LD=${KERNEL_LD}}"
BUILD_PARAMS+=" ${KERNEL_CC:+CC=${KERNEL_CC}} ${KERNEL_LD:+LD=${KERNEL_LD}}"
}
src_unpack() {