Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 552422 - dev-lang/python-2.7.10 compile error 'undefined symbol: clock_gettime'
Summary: dev-lang/python-2.7.10 compile error 'undefined symbol: clock_gettime'
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-17 22:19 UTC by Tyler Funnell
Modified: 2015-06-30 08:14 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tyler Funnell 2015-06-17 22:19:48 UTC
Emerging Python 2.7.10 results in the error 'undefined symbol: clock_gettime' while attempting to compile the _multiprocessing module. Appending -lrt to CFLAGS fixes.
Comment 1 Fabian Groffen gentoo-dev 2015-06-18 06:19:00 UTC
Ok, nice.  It's masked for this reason on Darwin, but you are on what Linux?
Comment 2 Tyler Funnell 2015-06-18 06:32:26 UTC
CentOS 5.11
Comment 3 Michael Haubenwallner (RETIRED) gentoo-dev 2015-06-18 16:17:01 UTC
Problem here is that clock_gettime() used to be in librt, but since glibc-2.17 it is in libc as well.
Comment 4 Guilherme Amadio gentoo-dev 2015-06-23 12:50:57 UTC
I have hit this bug too on Scientific Linux Fermi release 6.4 (Ramsey). The version of glibc is 2.12-1.149.el6_6.7. Workaround is CFLAGS='-lrt' emerge -av1 python:2.7, as mentioned by Tyler.
Comment 5 Michael Schubert 2015-06-26 15:45:01 UTC
I can confirm this on RHEL 6 host (glibc-2.14). If anyone is looking for a modified ebuild, this works:

--- python-2.7.10.ebuild.orig   2015-06-26 16:42:25.689374902 +0100
+++ python-2.7.10.ebuild        2015-06-26 16:30:48.062902360 +0100
@@ -218,6 +218,8 @@ src_configure() {
                append-cppflags -I"${EPREFIX}"/usr/include
                append-ldflags -L"${EPREFIX}"/$(get_libdir)
                append-ldflags -L"${EPREFIX}"/usr/$(get_libdir)
+               # fix multiprocessing: get_clocktime
+               append-ldflags -lrt
                # fix compilation on some 64-bits Linux hosts, #381163, #473520
                for hostlibdir in /usr/lib32 /usr/lib64 /usr/lib /lib32 /lib64; do
                        [[ -d ${hostlibdir} ]] || continue
Comment 6 Michael Haubenwallner (RETIRED) gentoo-dev 2015-06-29 16:10:46 UTC
Using clock_gettime() is added by python-2.7.10-semaphore-pid.patch originating in http://bugs.python.org/issue24303

However, that one has been updated recently to use _PyOS_URandom() instead.
Comment 7 Michael Haubenwallner (RETIRED) gentoo-dev 2015-06-29 16:33:42 UTC
(In reply to Michael Haubenwallner from comment #6)
> Using clock_gettime() is added by python-2.7.10-semaphore-pid.patch
> originating in http://bugs.python.org/issue24303
> 
> However, that one has been updated recently to use _PyOS_URandom() instead.

Unfortunately, python-2.7.10 in gx86 still uses the patch with clock_gettime().

Python team, please consider using the patch with _PyOS_URandom().

Fixed for Prefix: http://sourceforge.net/p/gentooprefixtree/code/ci/0aca4f1e94fd3a89adcdddba57f69cbe6f917f45/

(In reply to Fabian Groffen from comment #1)
> Ok, nice.  It's masked for this reason on Darwin, but you are on what Linux?

Could probably be unmasked now.
Comment 8 Mike Gilbert gentoo-dev 2015-06-29 17:26:40 UTC
+  29 Jun 2015; Mike Gilbert <floppym@gentoo.org> python-2.7.10.ebuild:
+  Drop semaphore-pid patch until upstream actually commits a fix, bug 552422.
Comment 9 Fabian Groffen gentoo-dev 2015-06-30 08:14:32 UTC
(In reply to Michael Haubenwallner from comment #7)
> Fixed for Prefix:
> http://sourceforge.net/p/gentooprefixtree/code/ci/
> 0aca4f1e94fd3a89adcdddba57f69cbe6f917f45/
> 
> (In reply to Fabian Groffen from comment #1)
> > Ok, nice.  It's masked for this reason on Darwin, but you are on what Linux?
> 
> Could probably be unmasked now.

Thank you sir!