Upstream recommends running a tuneup program against the built GMP library to generate better constants and then rebuilding it. Adding the following lines to the end of src_compile() will accomplish this: cd "${S}/tune" emake -j1 tuneup || die ./tuneup | tee "./mpn/$(uname -m)/gmp-mparam.h" cd "${S}" emake clean || die emake || die I wrote an implementation of the lucas-lehmer primality test that benefited from this optimization when I was first learning C. When I started using Gentoo a few years ago, I really wanted to see this optimization implemented in the ebuild, but I did not know how to communicate with people. Having remembered this today, I am making the request that I could not make back then.
It should be noted that this is incompatible with cross compilation. It must not be done when building stages with catalyst.
should be all set now in the tree; thanks for the report! Commit message: Add support for USE=pgo http://sources.gentoo.org/dev-libs/gmp/gmp-5.1.0.ebuild?r1=1.4&r2=1.5 http://sources.gentoo.org/dev-libs/gmp/metadata.xml?r1=1.2&r2=1.3
Created attachment 338376 [details] build.log Doesn't build here: hgcd.c: In function '__gmpn_hgcd_itch': hgcd.c:56:3: error: not enough arguments to function '__builtin_constant_p' hgcd.c:56:7: error: expected expression before ')' token hgcd.c:56:7: error: not enough arguments to function '__builtin_constant_p' $ emerge -pv gmp [ebuild R ] dev-libs/gmp-5.1.0 USE="cxx pgo* -doc -static-libs" 0 kB
Created attachment 338378 [details] emerge --info gmp
(In reply to comment #3) this bug is closed
(In reply to comment #5) > this bug is closed Someone should reopen it then. 5.1.1 has the same build failure.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d89510821e84ece8bf057f57f297016fae114e06 commit d89510821e84ece8bf057f57f297016fae114e06 Author: Sam James <sam@gentoo.org> AuthorDate: 2023-07-30 17:01:19 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-07-30 17:01:19 +0000 dev-libs/gmp: add comment wrt no pgo Bug: https://bugs.gentoo.org/454912 Bug: https://bugs.gentoo.org/650558 Bug: https://bugs.gentoo.org/658688 Signed-off-by: Sam James <sam@gentoo.org> dev-libs/gmp/gmp-6.3.0.ebuild | 4 ++++ 1 file changed, 4 insertions(+)