diff options
author | Sam James <sam@gentoo.org> | 2022-03-11 12:31:04 +0000 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2022-03-11 12:31:04 +0000 |
commit | 7b55c828e5df46717ed9eaecd18598eaaacab856 (patch) | |
tree | ac33b29d58d650af4fb0bf87a91a7599e4856acb /sys-fs | |
parent | app-forensics/aide: restore automagic ACL patch (diff) | |
download | gentoo-7b55c828e5df46717ed9eaecd18598eaaacab856.tar.gz gentoo-7b55c828e5df46717ed9eaecd18598eaaacab856.tar.bz2 gentoo-7b55c828e5df46717ed9eaecd18598eaaacab856.zip |
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 <plevine457@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sys-fs')
-rw-r--r-- | sys-fs/zfs-kmod/zfs-kmod-2.1.3.ebuild | 18 | ||||
-rw-r--r-- | sys-fs/zfs-kmod/zfs-kmod-9999.ebuild | 18 |
2 files changed, 36 insertions, 0 deletions
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 } |