diff options
author | Ionen Wolkens <ionen@gentoo.org> | 2022-09-25 18:26:54 -0400 |
---|---|---|
committer | Ionen Wolkens <ionen@gentoo.org> | 2022-09-25 18:34:51 -0400 |
commit | b936a2e117ce7f7be01fefa5cfda2de31bd5789d (patch) | |
tree | 69af66ebadc9c27d6c417cad8230102577ca6743 /x11-drivers | |
parent | www-apps/radarr: add 4.2.4.6635 (diff) | |
download | gentoo-b936a2e117ce7f7be01fefa5cfda2de31bd5789d.tar.gz gentoo-b936a2e117ce7f7be01fefa5cfda2de31bd5789d.tar.bz2 gentoo-b936a2e117ce7f7be01fefa5cfda2de31bd5789d.zip |
x11-drivers/nvidia-drivers: adjust clang, recognize KERNEL_CC/LD
Still feels a bit crude (ideally this should be handled by the
linux-mod eclass), but recognizing some env var will let users
adjust themselves to some extend for now (e.g. to select different
clang version).
Also keep current CC value if it's clang, albeit not checking
tc-ld-is-lld given -fuse-ld=lld means nothing here.
Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
Diffstat (limited to 'x11-drivers')
6 files changed, 30 insertions, 18 deletions
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-390.154.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-390.154.ebuild index 7a9cab0fed5d..2ad4e5070ba9 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-390.154.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-390.154.ebuild @@ -118,17 +118,19 @@ pkg_setup() { BUILD_TARGETS="modules" if linux_chkconfig_present CC_IS_CLANG; then - ewarn "Warning: building ${PN} with a clang-built kernel is experimental" + ewarn "Warning: clang-built kernel detected, using clang for modules (experimental)" + ewarn "Can use KERNEL_CC and KERNEL_LD environment variables to override if needed." - BUILD_PARAMS+=' CC=${CHOST}-clang' + tc-is-clang || : "${KERNEL_CC:=${CHOST}-clang}" if linux_chkconfig_present LD_IS_LLD; then - BUILD_PARAMS+=' LD=ld.lld' + : "${KERNEL_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 + BUILD_PARAMS+=' ${KERNEL_CC:+CC="${KERNEL_CC}"} ${KERNEL_LD:+LD="${KERNEL_LD}"}' if kernel_is -gt ${NV_KERNEL_MAX/./ }; then ewarn "Kernel ${KV_MAJOR}.${KV_MINOR} is either known to break this version of ${PN}" diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-470.141.03.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-470.141.03.ebuild index dbd9393ea0bf..1a33c461bb33 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-470.141.03.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-470.141.03.ebuild @@ -120,17 +120,19 @@ pkg_setup() { BUILD_TARGETS="modules" if linux_chkconfig_present CC_IS_CLANG; then - ewarn "Warning: building ${PN} with a clang-built kernel is experimental" + ewarn "Warning: clang-built kernel detected, using clang for modules (experimental)" + ewarn "Can use KERNEL_CC and KERNEL_LD environment variables to override if needed." - BUILD_PARAMS+=' CC=${CHOST}-clang' + tc-is-clang || : "${KERNEL_CC:=${CHOST}-clang}" if linux_chkconfig_present LD_IS_LLD; then - BUILD_PARAMS+=' LD=ld.lld' + : "${KERNEL_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 + BUILD_PARAMS+=' ${KERNEL_CC:+CC="${KERNEL_CC}"} ${KERNEL_LD:+LD="${KERNEL_LD}"}' if kernel_is -gt ${NV_KERNEL_MAX/./ }; then ewarn "Kernel ${KV_MAJOR}.${KV_MINOR} is either known to break this version of ${PN}" diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-510.85.02.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-510.85.02.ebuild index 50cb0bbc6344..f90467ba3060 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-510.85.02.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-510.85.02.ebuild @@ -123,17 +123,19 @@ pkg_setup() { BUILD_TARGETS="modules" if linux_chkconfig_present CC_IS_CLANG; then - ewarn "Warning: building ${PN} with a clang-built kernel is experimental" + ewarn "Warning: clang-built kernel detected, using clang for modules (experimental)" + ewarn "Can use KERNEL_CC and KERNEL_LD environment variables to override if needed." - BUILD_PARAMS+=' CC=${CHOST}-clang' + tc-is-clang || : "${KERNEL_CC:=${CHOST}-clang}" if linux_chkconfig_present LD_IS_LLD; then - BUILD_PARAMS+=' LD=ld.lld' + : "${KERNEL_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 + BUILD_PARAMS+=' ${KERNEL_CC:+CC="${KERNEL_CC}"} ${KERNEL_LD:+LD="${KERNEL_LD}"}' if kernel_is -gt ${NV_KERNEL_MAX/./ }; then ewarn "Kernel ${KV_MAJOR}.${KV_MINOR} is either known to break this version of ${PN}" diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-515.49.15.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-515.49.15.ebuild index 353d32365a63..92a3dc232374 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-515.49.15.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-515.49.15.ebuild @@ -132,17 +132,19 @@ pkg_setup() { BUILD_TARGETS="modules" if linux_chkconfig_present CC_IS_CLANG; then - ewarn "Warning: building ${PN} with a clang-built kernel is experimental" + ewarn "Warning: clang-built kernel detected, using clang for modules (experimental)" + ewarn "Can use KERNEL_CC and KERNEL_LD environment variables to override if needed." - BUILD_PARAMS+=' CC=${CHOST}-clang' + tc-is-clang || : "${KERNEL_CC:=${CHOST}-clang}" if linux_chkconfig_present LD_IS_LLD; then - BUILD_PARAMS+=' LD=ld.lld' + : "${KERNEL_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 + BUILD_PARAMS+=' ${KERNEL_CC:+CC="${KERNEL_CC}"} ${KERNEL_LD:+LD="${KERNEL_LD}"}' if kernel_is -gt ${NV_KERNEL_MAX/./ }; then ewarn "Kernel ${KV_MAJOR}.${KV_MINOR} is either known to break this version of ${PN}" diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-515.65.01.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-515.65.01.ebuild index b90995aadf68..7e9da0275ad5 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-515.65.01.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-515.65.01.ebuild @@ -132,17 +132,19 @@ pkg_setup() { BUILD_TARGETS="modules" if linux_chkconfig_present CC_IS_CLANG; then - ewarn "Warning: building ${PN} with a clang-built kernel is experimental" + ewarn "Warning: clang-built kernel detected, using clang for modules (experimental)" + ewarn "Can use KERNEL_CC and KERNEL_LD environment variables to override if needed." - BUILD_PARAMS+=' CC=${CHOST}-clang' + tc-is-clang || : "${KERNEL_CC:=${CHOST}-clang}" if linux_chkconfig_present LD_IS_LLD; then - BUILD_PARAMS+=' LD=ld.lld' + : "${KERNEL_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 + BUILD_PARAMS+=' ${KERNEL_CC:+CC="${KERNEL_CC}"} ${KERNEL_LD:+LD="${KERNEL_LD}"}' if kernel_is -gt ${NV_KERNEL_MAX/./ }; then ewarn "Kernel ${KV_MAJOR}.${KV_MINOR} is either known to break this version of ${PN}" diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-515.76.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-515.76.ebuild index 66022f11b591..b8881ceb9cd5 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-515.76.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-515.76.ebuild @@ -132,17 +132,19 @@ pkg_setup() { BUILD_TARGETS="modules" if linux_chkconfig_present CC_IS_CLANG; then - ewarn "Warning: building ${PN} with a clang-built kernel is experimental" + ewarn "Warning: clang-built kernel detected, using clang for modules (experimental)" + ewarn "Can use KERNEL_CC and KERNEL_LD environment variables to override if needed." - BUILD_PARAMS+=' CC=${CHOST}-clang' + tc-is-clang || : "${KERNEL_CC:=${CHOST}-clang}" if linux_chkconfig_present LD_IS_LLD; then - BUILD_PARAMS+=' LD=ld.lld' + : "${KERNEL_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 + BUILD_PARAMS+=' ${KERNEL_CC:+CC="${KERNEL_CC}"} ${KERNEL_LD:+LD="${KERNEL_LD}"}' if kernel_is -gt ${NV_KERNEL_MAX/./ }; then ewarn "Kernel ${KV_MAJOR}.${KV_MINOR} is either known to break this version of ${PN}" |