summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hubbs <william.hubbs@sony.com>2020-03-08 19:43:15 +0100
committerWilliam Hubbs <williamh@gentoo.org>2020-03-09 12:10:45 -0500
commit7e804a5ea4822b370bc0eb2fc33296ba4ec4cb7e (patch)
tree6585a51a99082726f4d156f75b60edd3a98ea0f9 /dev-lang
parentdev-libs/pthreads4w: add UnpackerDep (unzip) (diff)
downloadgentoo-7e804a5ea4822b370bc0eb2fc33296ba4ec4cb7e.tar.gz
gentoo-7e804a5ea4822b370bc0eb2fc33296ba4ec4cb7e.tar.bz2
gentoo-7e804a5ea4822b370bc0eb2fc33296ba4ec4cb7e.zip
dev-lang/go: 1.14: check running kernel version before compiling
Compilation will fail if the host is running certain versions of the Linux kernel with the message: runtime: mlock of signal stack failed: 12 Note from williamh: The original pr checked for kernel versions not listed in the upstream issue, so I reworked it. Also, it used pkg_setup instead of pkg_pretend for the checks. Closes: https://bugs.gentoo.org/711884 Closes: https://github.com/gentoo/gentoo/pull/14868 Signed-off-by: William Hubbs <williamh@gentoo.org>
Diffstat (limited to 'dev-lang')
-rw-r--r--dev-lang/go/go-1.14.ebuild22
1 files changed, 21 insertions, 1 deletions
diff --git a/dev-lang/go/go-1.14.ebuild b/dev-lang/go/go-1.14.ebuild
index f7c4c78376b8..f32caeeb3990 100644
--- a/dev-lang/go/go-1.14.ebuild
+++ b/dev-lang/go/go-1.14.ebuild
@@ -8,7 +8,7 @@ export CTARGET=${CTARGET:-${CHOST}}
MY_PV=${PV/_/}
-inherit toolchain-funcs
+inherit toolchain-funcs linux-info
case ${PV} in
*9999*)
@@ -122,6 +122,26 @@ go_cross_compile()
[[ $(go_tuple ${CBUILD}) != $(go_tuple) ]]
}
+pkg_pretend()
+{
+ local msg
+ get_running_version
+
+ use kernel_linux || return 0
+ if kernel_is -eq 5 2; then
+ msg="${P} does not work with kernel version 5.2.x"
+ elif kernel_is -eq 5 3 && kernel_is -le 5 3 14; then
+ msg="${P} does not work with kernel versions 5.3 before 5.3.15"
+ elif kernel_is -eq 5 4 && kernel_is -le 5 4 1; then
+ msg="${P} does not work with kernel versions 5.4 before 5.4.2"
+ fi
+ if [[ -n ${msg} ]]; then
+ eerror $msg
+ eerror "See https://github.com/golang/go/issues/37436"
+ die "Attempted to build ${P} with unsupported kernel"
+ fi
+}
+
src_compile()
{
if has_version -b dev-lang/go; then