From 8a8eb5890e84734a4d152d270750406950f278c7 Mon Sep 17 00:00:00 2001 From: Matthew Smith Date: Tue, 22 Feb 2022 20:35:50 +0000 Subject: sys-devel/mold: check compiler version Acked-by: Sam James Closes: https://bugs.gentoo.org/831473 Closes: https://github.com/gentoo/gentoo/pull/24321 Signed-off-by: Matthew Smith --- sys-devel/mold/mold-1.0.3.ebuild | 11 +++++++++++ sys-devel/mold/mold-1.1.ebuild | 11 +++++++++++ sys-devel/mold/mold-9999.ebuild | 11 +++++++++++ 3 files changed, 33 insertions(+) (limited to 'sys-devel') diff --git a/sys-devel/mold/mold-1.0.3.ebuild b/sys-devel/mold/mold-1.0.3.ebuild index 7948bbc23805..5536efda5951 100644 --- a/sys-devel/mold/mold-1.0.3.ebuild +++ b/sys-devel/mold/mold-1.0.3.ebuild @@ -31,6 +31,17 @@ RDEPEND=">=dev-cpp/tbb-2021.4.0:= )" DEPEND="${RDEPEND}" +pkg_pretend() { + # Requires a c++20 compiler, see #831437 + if [[ ${MERGE_TYPE} != binary ]]; then + if tc-is-gcc && [[ $(gcc-major-version) -lt 10 ]]; then + die "${PN} needs at least gcc 10" + elif tc-is-clang && [[ $(clang-major-version) -lt 12 ]]; then + die "${PN} needs at least clang 12" + fi + fi +} + src_prepare() { default diff --git a/sys-devel/mold/mold-1.1.ebuild b/sys-devel/mold/mold-1.1.ebuild index caa630e22c18..351ef38c6b51 100644 --- a/sys-devel/mold/mold-1.1.ebuild +++ b/sys-devel/mold/mold-1.1.ebuild @@ -32,6 +32,17 @@ RDEPEND=">=dev-cpp/tbb-2021.4.0:= # TODO: restore SYSTEM_XXHASH upstream? DEPEND="${RDEPEND}" +pkg_pretend() { + # Requires a c++20 compiler, see #831473 + if [[ ${MERGE_TYPE} != binary ]]; then + if tc-is-gcc && [[ $(gcc-major-version) -lt 10 ]]; then + die "${PN} needs at least gcc 10" + elif tc-is-clang && [[ $(clang-major-version) -lt 12 ]]; then + die "${PN} needs at least clang 12" + fi + fi +} + src_prepare() { default diff --git a/sys-devel/mold/mold-9999.ebuild b/sys-devel/mold/mold-9999.ebuild index caa630e22c18..351ef38c6b51 100644 --- a/sys-devel/mold/mold-9999.ebuild +++ b/sys-devel/mold/mold-9999.ebuild @@ -32,6 +32,17 @@ RDEPEND=">=dev-cpp/tbb-2021.4.0:= # TODO: restore SYSTEM_XXHASH upstream? DEPEND="${RDEPEND}" +pkg_pretend() { + # Requires a c++20 compiler, see #831473 + if [[ ${MERGE_TYPE} != binary ]]; then + if tc-is-gcc && [[ $(gcc-major-version) -lt 10 ]]; then + die "${PN} needs at least gcc 10" + elif tc-is-clang && [[ $(clang-major-version) -lt 12 ]]; then + die "${PN} needs at least clang 12" + fi + fi +} + src_prepare() { default -- cgit v1.2.3-65-gdbad