summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRepository mirror & CI <repomirrorci@gentoo.org>2022-03-11 12:49:41 +0000
committerRepository mirror & CI <repomirrorci@gentoo.org>2022-03-11 12:49:41 +0000
commit1f497a4334dab5f4832b40d470c4c62f51d43169 (patch)
treec2fd7596998093281d1c7b0f809636e027820518
parent2022-03-11 12:20:09 UTC (diff)
parentsys-fs/zfs-kmod: add Clang logic (diff)
downloadgentoo-1f497a4334dab5f4832b40d470c4c62f51d43169.tar.gz
gentoo-1f497a4334dab5f4832b40d470c4c62f51d43169.tar.bz2
gentoo-1f497a4334dab5f4832b40d470c4c62f51d43169.zip
Merge updates from master
-rw-r--r--sys-fs/zfs-kmod/zfs-kmod-2.1.3.ebuild18
-rw-r--r--sys-fs/zfs-kmod/zfs-kmod-9999.ebuild18
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
}