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.
Ok, nice. It's masked for this reason on Darwin, but you are on what Linux?
CentOS 5.11
Problem here is that clock_gettime() used to be in librt, but since glibc-2.17 it is in libc as well.
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.
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
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.
(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.
+ 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.
(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!