Gentoo Archives: gentoo-commits

From: William Hubbs <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/go/
Date: Mon, 09 Mar 2020 17:11:43
Message-Id: 1583773845.7e804a5ea4822b370bc0eb2fc33296ba4ec4cb7e.williamh@gentoo
1 commit: 7e804a5ea4822b370bc0eb2fc33296ba4ec4cb7e
2 Author: William Hubbs <william.hubbs <AT> sony <DOT> com>
3 AuthorDate: Sun Mar 8 18:43:15 2020 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Mon Mar 9 17:10:45 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7e804a5e
7
8 dev-lang/go: 1.14: check running kernel version before compiling
9
10 Compilation will fail if the host is running certain versions of the
11 Linux kernel with the message: runtime: mlock of signal stack failed: 12
12
13 Note from williamh:
14 The original pr checked for kernel versions not listed in the upstream
15 issue, so I reworked it. Also, it used pkg_setup instead of pkg_pretend
16 for the checks.
17
18 Closes: https://bugs.gentoo.org/711884
19 Closes: https://github.com/gentoo/gentoo/pull/14868
20 Signed-off-by: William Hubbs <williamh <AT> gentoo.org>
21
22 dev-lang/go/go-1.14.ebuild | 22 +++++++++++++++++++++-
23 1 file changed, 21 insertions(+), 1 deletion(-)
24
25 diff --git a/dev-lang/go/go-1.14.ebuild b/dev-lang/go/go-1.14.ebuild
26 index f7c4c78376b..f32caeeb399 100644
27 --- a/dev-lang/go/go-1.14.ebuild
28 +++ b/dev-lang/go/go-1.14.ebuild
29 @@ -8,7 +8,7 @@ export CTARGET=${CTARGET:-${CHOST}}
30
31 MY_PV=${PV/_/}
32
33 -inherit toolchain-funcs
34 +inherit toolchain-funcs linux-info
35
36 case ${PV} in
37 *9999*)
38 @@ -122,6 +122,26 @@ go_cross_compile()
39 [[ $(go_tuple ${CBUILD}) != $(go_tuple) ]]
40 }
41
42 +pkg_pretend()
43 +{
44 + local msg
45 + get_running_version
46 +
47 + use kernel_linux || return 0
48 + if kernel_is -eq 5 2; then
49 + msg="${P} does not work with kernel version 5.2.x"
50 + elif kernel_is -eq 5 3 && kernel_is -le 5 3 14; then
51 + msg="${P} does not work with kernel versions 5.3 before 5.3.15"
52 + elif kernel_is -eq 5 4 && kernel_is -le 5 4 1; then
53 + msg="${P} does not work with kernel versions 5.4 before 5.4.2"
54 + fi
55 + if [[ -n ${msg} ]]; then
56 + eerror $msg
57 + eerror "See https://github.com/golang/go/issues/37436"
58 + die "Attempted to build ${P} with unsupported kernel"
59 + fi
60 +}
61 +
62 src_compile()
63 {
64 if has_version -b dev-lang/go; then