Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 568320 - dev-libs/gmp[pgo] fails to build on arm with error: unknown type name 'clock_gettime'
Summary: dev-libs/gmp[pgo] fails to build on arm with error: unknown type name 'clock_...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Gentoo Toolchain Maintainers
URL: https://gmplib.org/list-archives/gmp-...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-15 10:02 UTC by tt_1
Modified: 2022-05-10 19:41 UTC (History)
2 users (show)

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


Attachments
compressed build.log (gmp-6.0.0a-arm-failed-build.log.gz,34.24 KB, application/gzip)
2015-12-15 10:02 UTC, tt_1
Details
output of emerge --info (armv7l-emerge.info,4.30 KB, text/plain)
2015-12-15 10:03 UTC, tt_1
Details
tuneup-clock-gettime.patch (tuneup-clock-gettime.patch,418 bytes, patch)
2016-11-17 23:07 UTC, Conrad Kostecki
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description tt_1 2015-12-15 10:02:01 UTC
Created attachment 419264 [details]
compressed build.log

see attached build.log for further details.
Comment 1 tt_1 2015-12-15 10:03:48 UTC
Created attachment 419266 [details]
output of emerge --info
Comment 2 Conrad Kostecki gentoo-dev 2016-01-03 22:37:37 UTC
+1 same problem here
Comment 3 Conrad Kostecki gentoo-dev 2016-01-05 18:58:46 UTC
That error is caused by LDFLAGS="-Wl,--as-needed".

When "-Wl,--as-needed" is not set, this error is gone. But after that, I am still unable to compile dev-libs/gmp[pgo], because I am hitting a new error:

libtool: compile:  armv7a-hardfloat-linux-gnueabi-gcc -DHAVE_CONFIG_H -I. -I/var/tmp/portage/dev-libs/gmp-6.1.0/work/gmp-6.1.0/mpz -I.. -D__GMP_WITHIN_GMP -I/var/tmp/portage/dev-libs/gmp-6.1.0/work/gmp-6.1.0 -march=armv7ve -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mtune=cortex-a7 -O3 -mfloat-abi=hard -mthumb -pipe -fomit-frame-pointer -c /var/tmp/portage/dev-libs/gmp-6.1.0/work/gmp-6.1.0/mpz/bin_uiui.c  -fPIC -DPIC -o .libs/bin_uiui.o
In file included from /var/tmp/portage/dev-libs/gmp-6.1.0/work/gmp-6.1.0/mpz/array_init.c:32:0:
/var/tmp/portage/dev-libs/gmp-6.1.0/work/gmp-6.1.0/gmp-impl.h:1384:34: error: unknown type name ‘mp_srcptv’
 __GMP_DECLSPEC void      mpn_toom44_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
                                  ^
Comment 4 . 2016-07-09 12:16:13 UTC
fails for armv6 too
Comment 5 Conrad Kostecki gentoo-dev 2016-11-17 23:07:25 UTC
Created attachment 453690 [details, diff]
tuneup-clock-gettime.patch

Placing that patch fixed this for me.

The cause is simple.
When USE="pgo" is set, the eBuild runs:
./tune/tuneup | tee gmp.mparam.h.new

Apparently, something does wrong and the string "clock_gettime is 1.000ns accurate" is beeing written to gmp-mparam.h.new (which is later moved to gmp-mparam.h)
Comment 6 tt_1 2016-11-18 19:09:31 UTC
Problem solved, thanks a lot! 

This is a bit off the topic, but are there any speedtests to see wether the use of pgo speeds up something in the end?
Comment 7 . 2016-11-19 15:07:52 UTC
(In reply to tt_1 from comment #6)
> This is a bit off the topic, but are there any speedtests to see wether the
> use of pgo speeds up something in the end?

It definitely does not. Which is also the reason why every major compiler includes this technology.
Comment 8 SpanKY gentoo-dev 2016-11-26 21:54:22 UTC
thanks guys.  i've sent a patch upstream for the issue.  let's see what they have to say about it.

https://gmplib.org/list-archives/gmp-bugs/2016-November/004032.html
Comment 9 SpanKY gentoo-dev 2016-11-27 01:07:34 UTC
upstream has merged the fix, so pushed on our side:
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=02c897444d280edc7330204b9fb43afb0a52d0ba