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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 3883E158020 for ; Thu, 1 Dec 2022 03:42:23 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 80E42E03DF; Thu, 1 Dec 2022 03:42:22 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 5ECEAE03DF for ; Thu, 1 Dec 2022 03:42:22 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 3875E340ECB for ; Thu, 1 Dec 2022 03:42:21 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 2BE3D6A1 for ; Thu, 1 Dec 2022 03:42:12 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1669866114.121152c38caefd8e94fb8c90cb51102693b6d6a8.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/gmp/, profiles/arch/amd64/, profiles/arch/x86/, profiles/arch/base/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-libs/gmp/gmp-6.2.1-r3.ebuild dev-libs/gmp/gmp-6.2.1-r4.ebuild dev-libs/gmp/metadata.xml profiles/arch/amd64/package.use.mask profiles/arch/base/package.use.mask profiles/arch/x86/package.use.mask X-VCS-Directories: profiles/arch/amd64/ dev-libs/gmp/ profiles/arch/base/ profiles/arch/x86/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 121152c38caefd8e94fb8c90cb51102693b6d6a8 X-VCS-Branch: master Date: Thu, 1 Dec 2022 03:42:12 +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: f86b02b0-7276-428e-b5c5-75361d725007 X-Archives-Hash: 3423626b532b70be68647e082e256899 commit: 121152c38caefd8e94fb8c90cb51102693b6d6a8 Author: Sam James gentoo org> AuthorDate: Thu Dec 1 03:26:54 2022 +0000 Commit: Sam James gentoo org> CommitDate: Thu Dec 1 03:41:54 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=121152c3 dev-libs/gmp: allow automatic detection of host for USE=-cpudetection Bug: https://bugs.gentoo.org/883201 Closes: https://bugs.gentoo.org/235697 Closes: https://bugs.gentoo.org/545442 Signed-off-by: Sam James gentoo.org> .../{gmp-6.2.1-r3.ebuild => gmp-6.2.1-r4.ebuild} | 32 +++++++++++++++++++--- dev-libs/gmp/metadata.xml | 13 ++++++++- profiles/arch/amd64/package.use.mask | 4 --- profiles/arch/base/package.use.mask | 4 --- profiles/arch/x86/package.use.mask | 4 --- 5 files changed, 40 insertions(+), 17 deletions(-) diff --git a/dev-libs/gmp/gmp-6.2.1-r3.ebuild b/dev-libs/gmp/gmp-6.2.1-r4.ebuild similarity index 71% rename from dev-libs/gmp/gmp-6.2.1-r3.ebuild rename to dev-libs/gmp/gmp-6.2.1-r4.ebuild index 8e7bca104d30..0a58fc8ba3b4 100644 --- a/dev-libs/gmp/gmp-6.2.1-r3.ebuild +++ b/dev-libs/gmp/gmp-6.2.1-r4.ebuild @@ -25,10 +25,10 @@ S="${WORKDIR}"/${MY_P%a} LICENSE="|| ( LGPL-3+ GPL-2+ )" # The subslot reflects the C & C++ SONAMEs. SLOT="0/10.4" -# Unkeyworded temporarily for some more testing -#KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" IUSE="+asm doc +cpudetection +cxx pic static-libs" REQUIRED_USE="cpudetection? ( asm )" +RESTRICT="!cpudetection? ( bindist )" BDEPEND=" app-arch/xz-utils @@ -99,8 +99,13 @@ multilib_src_configure() { # or specific-to-used-CPU (which our config.guess refresh prevents at the moment). # Both Fedora and opensuse use this option to tackle the issue, bug #883201. # - # This only works for x86, so we're still getting non-performant - # builds on other arches until we figure something out! + # This only works for amd64/x86, so to get accelerated performance + # (i.e. not using the generic C), one needs USE=-cpudetection if + # on non-amd64/x86. + # + # (We do not mask USE=cpudetection on !amd64/x86 because we want + # the flag to be useful on other arches to allow opting out of the + # config.guess logic below.) $(use_enable cpudetection fat) $(use_enable cxx) $(use_enable static-libs static) @@ -110,6 +115,25 @@ multilib_src_configure() { $(use pic && echo --with-pic) ) + if use cpudetection && ! use amd64 && ! use x86 ; then + elog "Using generic C implementation on non-amd64/x86 with USE=cpudetection" + elog "--enable-fat is a no-op on alternative arches." + elog "To obtain an optimized build, set USE=-cpudetection, but binpkgs should not then be made." + fi + + # See bug #883201 again. + if ! use cpudetection && ! tc-is-cross-compiler ; then + local gmp_host=$("${S}"/config.guess || die "failed to run config.guess") + + if [[ -z ${gmp_host} ]] ; then + die "Empty result from GMP's custom config.guess!" + fi + + einfo "GMP guessed processor type: ${gmp_host}" + ewarn "This build will only work on this machine. Enable USE=cpudetection for binary packages!" + export ac_cv_host="${gmp_host}" + fi + ECONF_SOURCE="${S}" econf "${myeconfargs[@]}" } diff --git a/dev-libs/gmp/metadata.xml b/dev-libs/gmp/metadata.xml index 753f212d3e39..591e777c6165 100644 --- a/dev-libs/gmp/metadata.xml +++ b/dev-libs/gmp/metadata.xml @@ -7,7 +7,18 @@ Enable use of hand optimized assembly routines (faster execution) - Enables runtime CPU detection (useful for binpkgs, compatibility on other CPUs) + + Enables runtime CPU detection (useful for binpkgs, compatibility on other CPUs). + + This only works on amd64/x86 at present. + + If this flag is enabled, GMP will work on a variety of amd64/x86 CPUs and load accelerated + routines for use at runtime depending on the CPU in use. This makes it suitable + for binary packages (binpkgs). + + If this flag is disabled, GMP will be tuned for the CPU being used at build-time + and may not be usable on other machines. + Force static libraries to be built as PIC to avoid TEXTRELs. diff --git a/profiles/arch/amd64/package.use.mask b/profiles/arch/amd64/package.use.mask index 4fa0267b5a1b..27207c6da3f9 100644 --- a/profiles/arch/amd64/package.use.mask +++ b/profiles/arch/amd64/package.use.mask @@ -17,10 +17,6 @@ #--- END OF EXAMPLES --- -# Sam James (2022-11-30) -# Only effective on amd64/x86. -dev-libs/gmp -cpudetection - # Guillermo Joandet (2022-11-22) # app-text/pandoc is keyworded on this architecture net-libs/gssdp -man diff --git a/profiles/arch/base/package.use.mask b/profiles/arch/base/package.use.mask index a9a1bad325ca..5a1455d90b27 100644 --- a/profiles/arch/base/package.use.mask +++ b/profiles/arch/base/package.use.mask @@ -1,10 +1,6 @@ # Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -# Sam James (2022-11-30) -# Only effective on amd64/x86. -dev-libs/gmp cpudetection - # Mike Gilbert (2022-10-16) # Only supported on MIPS. dev-lang/gnat-gpl fixed-point diff --git a/profiles/arch/x86/package.use.mask b/profiles/arch/x86/package.use.mask index 20ce8131ba98..a68e233ecfd9 100644 --- a/profiles/arch/x86/package.use.mask +++ b/profiles/arch/x86/package.use.mask @@ -1,10 +1,6 @@ # Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -# Sam James (2022-11-30) -# Only effective on amd64/x86. -dev-libs/gmp -cpudetection - # Michał Górny (2022-11-16) # spirv-llvm-translator is not keyworded x86. dev-libs/libclc spirv