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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id BCEFF138350 for ; Mon, 9 Mar 2020 17:11:43 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F0085E091B; Mon, 9 Mar 2020 17:11:42 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D7D22E091B for ; Mon, 9 Mar 2020 17:11:42 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7D14D34F31A for ; Mon, 9 Mar 2020 17:11:41 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id E536E15A for ; Mon, 9 Mar 2020 17:11:39 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <1583773845.7e804a5ea4822b370bc0eb2fc33296ba4ec4cb7e.williamh@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/go/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-lang/go/go-1.14.ebuild X-VCS-Directories: dev-lang/go/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 7e804a5ea4822b370bc0eb2fc33296ba4ec4cb7e X-VCS-Branch: master Date: Mon, 9 Mar 2020 17:11:39 +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: e0d1093b-75bd-4407-b41c-5914143dc22a X-Archives-Hash: 08ad8da787365eae79c3a57332bf97f1 commit: 7e804a5ea4822b370bc0eb2fc33296ba4ec4cb7e Author: William Hubbs sony com> AuthorDate: Sun Mar 8 18:43:15 2020 +0000 Commit: William Hubbs gentoo org> CommitDate: Mon Mar 9 17:10:45 2020 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7e804a5e 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 gentoo.org> dev-lang/go/go-1.14.ebuild | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/dev-lang/go/go-1.14.ebuild b/dev-lang/go/go-1.14.ebuild index f7c4c78376b..f32caeeb399 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