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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 52AD015808B for ; Fri, 11 Mar 2022 12:33:42 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5BE8AE097C; Fri, 11 Mar 2022 12:33:41 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id BEF81E097C for ; Fri, 11 Mar 2022 12:33:40 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9B3E5342F2A for ; Fri, 11 Mar 2022 12:33:39 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id F2C072B0 for ; Fri, 11 Mar 2022 12:33:37 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1647001864.7b55c828e5df46717ed9eaecd18598eaaacab856.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs-kmod/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-fs/zfs-kmod/zfs-kmod-2.1.3.ebuild sys-fs/zfs-kmod/zfs-kmod-9999.ebuild X-VCS-Directories: sys-fs/zfs-kmod/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 7b55c828e5df46717ed9eaecd18598eaaacab856 X-VCS-Branch: master Date: Fri, 11 Mar 2022 12:33:37 +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: 0b293ef4-0a4d-4e18-80e0-b6dcafb9d602 X-Archives-Hash: 4dfa77d89267b2b6f7d7369d4ff19117 commit: 7b55c828e5df46717ed9eaecd18598eaaacab856 Author: Sam James gentoo org> AuthorDate: Fri Mar 11 12:31:04 2022 +0000 Commit: Sam James gentoo org> CommitDate: Fri Mar 11 12:31:04 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7b55c828 sys-fs/zfs-kmod: add Clang logic The needed patch made its way upstream but we need a small amount of logic in the ebuild to accommodate it fully. Bug: https://github.com/openzfs/zfs/pull/13046 Closes: https://bugs.gentoo.org/814194 Thanks-to: Peter Levine gmail.com> Signed-off-by: Sam James gentoo.org> sys-fs/zfs-kmod/zfs-kmod-2.1.3.ebuild | 18 ++++++++++++++++++ sys-fs/zfs-kmod/zfs-kmod-9999.ebuild | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/sys-fs/zfs-kmod/zfs-kmod-2.1.3.ebuild b/sys-fs/zfs-kmod/zfs-kmod-2.1.3.ebuild index 2c6ab28bcfde..cb47cb1d7d8b 100644 --- a/sys-fs/zfs-kmod/zfs-kmod-2.1.3.ebuild +++ b/sys-fs/zfs-kmod/zfs-kmod-2.1.3.ebuild @@ -111,6 +111,24 @@ pkg_setup() { kernel_is -ge 3 10 || die "Linux 3.10 or newer required" + if tc-is-clang ; then + # See bug #814194 + ewarn "Warning: building ${PN} with LLVM/Clang is experimental!" + export KERNEL_CC="$(tc-getBUILD_CC)" + + if tc-ld-is-lld ; then + export KERNEL_LD="$(tc-getBUILD_LD)" + + KERNEL_LLVM=1 + + local tool + for tool in AR NM STRIP OBJCOPY READELF; do + [[ $(tc-getBUILD_${tool}) != *llvm-${tool,,} ]] && KERNEL_LLVM=0 + done + export KERNEL_LLVM + fi + fi + linux-mod_pkg_setup } diff --git a/sys-fs/zfs-kmod/zfs-kmod-9999.ebuild b/sys-fs/zfs-kmod/zfs-kmod-9999.ebuild index 2c6ab28bcfde..cb47cb1d7d8b 100644 --- a/sys-fs/zfs-kmod/zfs-kmod-9999.ebuild +++ b/sys-fs/zfs-kmod/zfs-kmod-9999.ebuild @@ -111,6 +111,24 @@ pkg_setup() { kernel_is -ge 3 10 || die "Linux 3.10 or newer required" + if tc-is-clang ; then + # See bug #814194 + ewarn "Warning: building ${PN} with LLVM/Clang is experimental!" + export KERNEL_CC="$(tc-getBUILD_CC)" + + if tc-ld-is-lld ; then + export KERNEL_LD="$(tc-getBUILD_LD)" + + KERNEL_LLVM=1 + + local tool + for tool in AR NM STRIP OBJCOPY READELF; do + [[ $(tc-getBUILD_${tool}) != *llvm-${tool,,} ]] && KERNEL_LLVM=0 + done + export KERNEL_LLVM + fi + fi + linux-mod_pkg_setup }