Ran into this on an older infra box today, rebuilding python. building '_multiprocessing' extension creating build/temp.linux-i686-2.6/var/tmp/portage/dev-lang/python-2.6.2-r1/work/Python-2.6.2/Modules/_multiprocessing i686-pc-linux-gnu-gcc -fPIC -fno-strict-aliasing -DNDEBUG -march=pentium4 -O2 -pipe -DHAVE_SEM_OPEN=1 -DHAVE_FD_TRANSFER=1 -DHAVE_SEM_TIMEDWAIT=1 -IModules/_multiprocessing -I. -I/var/tmp/portage/dev-lang/python-2.6.2-r1/work/Python-2.6.2/./Include -I. -IInclude -I./Include -I/var/tmp/portage/dev-lang/python-2.6.2-r1/work/Python-2.6.2/Include -I/var/tmp/portage/dev-lang/python-2.6.2-r1/work/Python-2.6.2 -c /var/tmp/portage/dev-lang/python-2.6.2-r1/work/Python-2.6.2/Modules/_multiprocessing/multiprocessing.c -o build/temp.linux-i686-2.6/var/tmp/portage/dev-lang/python-2.6.2-r1/work/Python-2.6.2/Modules/_multiprocessing/multiprocessing.o i686-pc-linux-gnu-gcc -fPIC -fno-strict-aliasing -DNDEBUG -march=pentium4 -O2 -pipe -DHAVE_SEM_OPEN=1 -DHAVE_FD_TRANSFER=1 -DHAVE_SEM_TIMEDWAIT=1 -IModules/_multiprocessing -I. -I/var/tmp/portage/dev-lang/python-2.6.2-r1/work/Python-2.6.2/./Include -I. -IInclude -I./Include -I/var/tmp/portage/dev-lang/python-2.6.2-r1/work/Python-2.6.2/Include -I/var/tmp/portage/dev-lang/python-2.6.2-r1/work/Python-2.6.2 -c /var/tmp/portage/dev-lang/python-2.6.2-r1/work/Python-2.6.2/Modules/_multiprocessing/socket_connection.c -o build/temp.linux-i686-2.6/var/tmp/portage/dev-lang/python-2.6.2-r1/work/Python-2.6.2/Modules/_multiprocessing/socket_connection.o In file included from /var/tmp/portage/dev-lang/python-2.6.2-r1/work/Python-2.6.2/Modules/_multiprocessing/socket_connection.c:202: /var/tmp/portage/dev-lang/python-2.6.2-r1/work/Python-2.6.2/Modules/_multiprocessing/connection.h: In function `connection_poll': /var/tmp/portage/dev-lang/python-2.6.2-r1/work/Python-2.6.2/Modules/_multiprocessing/connection.h:357: error: `_save' undeclared (first use in this function) /var/tmp/portage/dev-lang/python-2.6.2-r1/work/Python-2.6.2/Modules/_multiprocessing/connection.h:357: error: (Each undeclared identifier is reported only once /var/tmp/portage/dev-lang/python-2.6.2-r1/work/Python-2.6.2/Modules/_multiprocessing/connection.h:357: error: for each function it appears in.) building 'linuxaudiodev' extension .... Failed to find the necessary bits to build these modules: _si686-pc-linux-gnu-gcc -shared -Wl,-O1 -L. -fno-strict-aliasing -DNDEBUG -march=pentium4 -O2 -pipe -I. -IInclude -I./Include build/temp.linux-i686-2.6/var/tmp/portage/dev-lang/python-2.6.2-r1/work/Python-2.6.2/Modules/_ctypes/_ctypes.o build/temp.linux-i686-2.6/var/tmp/portage/dev-lang/python-2.6.2-r1/work/Python-2.6.2/Modules/_ctypes/callbacks.o build/temp.linux-i686-2.6/var/tmp/portage/dev-lang/python-2.6.2-r1/work/Python-2.6.2/Modules/_ctypes/callproc.o build/temp.linux-i686-2.6/var/tmp/portage/dev-lang/python-2.6.2-r1/work/Python-2.6.2/Modules/_ctypes/stgdict.o build/temp.linux-i686-2.6/var/tmp/portage/dev-lang/python-2.6.2-r1/work/Python-2.6.2/Modules/_ctypes/cfield.o build/temp.linux-i686-2.6/var/tmp/portage/dev-lang/python-2.6.2-r1/work/Python-2.6.2/Modules/_ctypes/malloc_closure.o build/temp.linux-i686-2.6/var/tmp/portage/dev-lang/python-2.6.2-r1/work/Python-2.6.2/Modules/_ctypes/libffi/src/prep_cif.o build/temp.linux-i686-2.6/var/tmp/portage/dev-lang/python-2.6.2-r1/work/Python-2.6.2/Modules/_ctypes/libffi/src/x86/ffi.o build/temp.linux-i686-2.6/var/tmp/portage/dev-lang/python-2.6.2-r1/work/Python-2.6.2/Modules/_ctypes/libffi/src/x86/sysv.o -L/usr/local/lib -L. -lpython2.6 -o build/lib.linux-i686-2.6/_ctypes.so qlite3 _tkinter bsddb185 gdbm sunaudiodev To find the necessary bits, look in setup.py in detect_modules() for the module's name. Failed to build these modules: _multiprocessing running build_scripts creating build/scripts-2.6 copying and adjusting /var/tmp/portage/dev-lang/python-2.6.2-r1/work/Python-2.6.2/Tools/scripts/pydoc -> build/scripts-2.6 copying and adjusting /var/tmp/portage/dev-lang/python-2.6.2-r1/work/Python-2.6.2/Tools/scripts/idle -> build/scripts-2.6 copying and adjusting /var/tmp/portage/dev-lang/python-2.6.2-r1/work/Python-2.6.2/Tools/scripts/2to3 -> build/scripts-2.6 copying and adjusting /var/tmp/portage/dev-lang/python-2.6.2-r1/work/Python-2.6.2/Lib/smtpd.py -> build/scripts-2.6 changing mode of build/scripts-2.6/pydoc from 644 to 755 changing mode of build/scripts-2.6/idle from 644 to 755 changing mode of build/scripts-2.6/2to3 from 644 to 755 changing mode of build/scripts-2.6/smtpd.py from 644 to 755 make: *** [sharedmods] Error 1 * * ERROR: dev-lang/python-2.6.2-r1 failed. * Call stack: * ebuild.sh, line 49: Called src_compile * environment, line 3881: Called _eapi2_src_compile * ebuild.sh, line 634: Called die * The specific snippet of code: * emake || die "emake failed" * The die message: * emake failed * * If you need support, post the topmost build error, and the call stack if relevant. * A complete build log is located at '/var/tmp/portage/dev-lang/python-2.6.2-r1/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/dev-lang/python-2.6.2-r1/temp/environment'. * Portage 2.1.6.13 (hardened/x86/2.6, gcc-3.4.6, glibc-2.5-r4, 2.6.20-hardened-r6 i686) ================================================================= System uname: Linux-2.6.20-hardened-r6-i686-Intel-R-_Xeon-TM-_CPU_2.80GHz-with-glibc2.3.2 Timestamp of tree: Mon, 24 Aug 2009 05:30:01 +0000 app-shells/bash: 3.2_p39 dev-lang/python: 2.4.4-r14, 2.5.4-r2 dev-python/pycrypto: 2.0.1-r8 sys-apps/baselayout: 1.12.9-r2 sys-apps/sandbox: 1.6-r2 sys-devel/autoconf: 2.13, 2.63 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2 sys-devel/binutils: 2.18-r3 sys-devel/gcc-config: 1.4.1 sys-devel/libtool: 1.5.26 virtual/os-headers: 2.6.27-r2 ACCEPT_KEYWORDS="x86" CBUILD="i686-pc-linux-gnu" CFLAGS="-march=pentium4 -O2 -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc" CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/php/apache2-php4/ext-active/ /etc/php/cgi-php4/ext-active/ /etc/php/cli-php4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-march=pentium4 -O2 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="buildpkg distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch" GENTOO_MIRRORS="http://gentoo.osuosl.org/ http://gentoo.mirrors.pair.com/" LDFLAGS="-Wl,-O1" MAKEOPTS="-j1" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="apache2 berkdb crypt hardened ipv6 mmx ncurses pam perl pic pie python readline snmp ssl tcpd x86 xml" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="mouse keyboard evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i740 imstt intel mach64 mga neomagic nsc nv r128 radeon rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa vga via vmware voodoo" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS # emerge -pv python These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild NS ] dev-lang/python-2.6.2-r1 [2.4.4-r14, 2.5.4-r2] USE="berkdb ipv6 ncurses readline ssl xml -build -doc -examples -gdbm -sqlite -threads -tk -ucs2 -wininst" 0 kB
Created attachment 202116 [details] USE=-threads fix
Created attachment 202118 [details, diff] USE=-threads fix
I also got the same error during a fresh stage3 install. By activating the threads useflag it builds successfully. This seems to be related to an upstream bug, though: http://bugs.python.org/issue3807 Python-2.6.2-r1 builds without the threads useflag by applying the patch listed on the python bug site: "issue3807.patch".
The fix was already included in 3.1.
I forgot that multiprocessing module is new in 2.6 :) .
Fixed.