Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 454912 - dev-libs/gmp: add support for USE=pgo
Summary: dev-libs/gmp: add support for USE=pgo
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Toolchain Maintainers
URL: http://gmplib.org/manual/Performance-...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-31 23:38 UTC by Richard Yao (RETIRED)
Modified: 2023-07-30 17:01 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,502.62 KB, text/plain)
2013-02-09 10:46 UTC, Nikos Chantziaras
Details
emerge --info gmp (emerge--info,5.88 KB, text/plain)
2013-02-09 10:47 UTC, Nikos Chantziaras
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Yao (RETIRED) gentoo-dev 2013-01-31 23:38:08 UTC
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.
Comment 1 Richard Yao (RETIRED) gentoo-dev 2013-02-01 14:30:24 UTC
It should be noted that this is incompatible with cross compilation. It must not be done when building stages with catalyst.
Comment 2 SpanKY gentoo-dev 2013-02-09 07:57:16 UTC
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
Comment 3 Nikos Chantziaras 2013-02-09 10:46:24 UTC
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
Comment 4 Nikos Chantziaras 2013-02-09 10:47:24 UTC
Created attachment 338378 [details]
emerge --info gmp
Comment 5 SpanKY gentoo-dev 2013-02-18 06:18:29 UTC
(In reply to comment #3)

this bug is closed
Comment 6 Nikos Chantziaras 2013-02-18 07:20:59 UTC
(In reply to comment #5)
> this bug is closed

Someone should reopen it then. 5.1.1 has the same build failure.
Comment 7 Larry the Git Cow gentoo-dev 2023-07-30 17:01:34 UTC
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(+)