From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 120761382C5 for ; Fri, 11 Jun 2021 17:49:20 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 56F39E0900; Fri, 11 Jun 2021 17:49:18 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 42544E0900 for ; Fri, 11 Jun 2021 17:49:18 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 18BF634067D for ; Fri, 11 Jun 2021 17:49:17 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id C90437A1 for ; Fri, 11 Jun 2021 17:49:15 +0000 (UTC) From: "Ionen Wolkens" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ionen Wolkens" Message-ID: <1623433685.9cca413557e341beaa8f9289915e175e6d51d752.ionen@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/ X-VCS-Repository: repo/gentoo X-VCS-Files: x11-drivers/nvidia-drivers/nvidia-drivers-465.31.ebuild X-VCS-Directories: x11-drivers/nvidia-drivers/ X-VCS-Committer: ionen X-VCS-Committer-Name: Ionen Wolkens X-VCS-Revision: 9cca413557e341beaa8f9289915e175e6d51d752 X-VCS-Branch: master Date: Fri, 11 Jun 2021 17:49:15 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 3e735278-fccf-4788-bfaf-19904ef353a5 X-Archives-Hash: 7af9df4c43923c6c3283a7eac7d86e29 commit: 9cca413557e341beaa8f9289915e175e6d51d752 Author: Ionen Wolkens gentoo org> AuthorDate: Fri Jun 11 16:57:43 2021 +0000 Commit: Ionen Wolkens gentoo org> CommitDate: Fri Jun 11 17:48:05 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9cca4135 x11-drivers/nvidia-drivers: add basic clang+thinlto kernel support Only adding this experimental support to >=465.31, still very little testing has been done but should be better than always failing. To use this there's no need to do anything beside having a kernel built with clang+(thin)lto (normally through LLVM=1 LLVM_IAS=1). Note to not set "LD" as it'll currently fail with USE=tools for other reasons. Signed-off-by: Ionen Wolkens gentoo.org> .../nvidia-drivers/nvidia-drivers-465.31.ebuild | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-465.31.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-465.31.ebuild index d327e03ff8f..4807a3e0f30 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-465.31.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-465.31.ebuild @@ -101,8 +101,6 @@ pkg_setup() { Cannot be directly selected in the kernel's menuconfig, so enable options such as CONFIG_DRM_FBDEV_EMULATION instead." - BUILD_PARAMS='NV_VERBOSE=1 IGNORE_CC_MISMATCH=yes SYSSRC="${KV_DIR}" SYSOUT="${KV_OUT_DIR}"' - BUILD_TARGETS="modules" # defaults' clean sometimes deletes modules MODULE_NAMES=" nvidia(video:kernel) nvidia-drm(video:kernel) @@ -112,7 +110,25 @@ pkg_setup() { linux-mod_pkg_setup - if [[ ${MERGE_TYPE} != binary ]] && kernel_is -gt ${NV_KERNEL_MAX/./ }; then + [[ ${MERGE_TYPE} == binary ]] && return + + BUILD_PARAMS='NV_VERBOSE=1 IGNORE_CC_MISMATCH=yes SYSSRC="${KV_DIR}" SYSOUT="${KV_OUT_DIR}"' + BUILD_TARGETS="modules" # defaults' clean sometimes deletes modules + + if linux_chkconfig_present CC_IS_CLANG; then + ewarn "Warning: building ${PN} with a clang-built kernel is experimental." + + 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 + + if kernel_is -gt ${NV_KERNEL_MAX/./ }; then ewarn "Kernel ${KV_MAJOR}.${KV_MINOR} is either known to break this version of nvidia-drivers" ewarn "or was not tested with it. It is recommended to use one of:" ewarn " <=sys-kernel/gentoo-kernel-${NV_KERNEL_MAX}"