dev-lang/python-2.4.3-r2 fails to build with LDFLAGS="-Wl,--as-needed" i686-pc-linux-gnu-gcc -pthread -Wl,--as-needed -Xlinker -export-dynamic -o python \ Modules/python.o \ -L. -lpython2.4 -lpthread -ldl -lutil -L/usr/lib -lz -lm ./libpython2.4.so: undefined reference to `deflate' ./libpython2.4.so: undefined reference to `inflate' ./libpython2.4.so: undefined reference to `deflateInit_' ./libpython2.4.so: undefined reference to `adler32' ./libpython2.4.so: undefined reference to `crc32' ./libpython2.4.so: undefined reference to `deflateInit2_' ./libpython2.4.so: undefined reference to `inflateEnd' ./libpython2.4.so: undefined reference to `inflateInit2_' ./libpython2.4.so: undefined reference to `deflateEnd' collect2: ld returned 1 exit status make: *** [python] Error 1 !!! ERROR: dev-lang/python-2.4.3-r2 failed. Call stack: ebuild.sh, line 1543: Called dyn_compile ebuild.sh, line 938: Called src_compile python-2.4.3-r2.ebuild, line 181: Called die !!! Parallel make failed !!! If you need support, post the topmost build error, and the call stack if relevant. From the error I suspect that libpython2.4.so needs to be linked with "-lz".
Created attachment 95186 [details] Zzam's emerge --info
Created attachment 95190 [details, diff] patch to make python work with --as-needed The attached patch makes the linker happy.
I'm getting the same problem here, looking at the build system this was caused by the new 2.4.3-libdir patch enabling building the zlib module as a builtin and for some reason python not libpython links against the module libs. As far as I can see theres 3 obvious solutions to this: 1. fix the python Makefile.pre.in to link the module libs in libpython (I'd use $(MODLIBS) instead of -lz if it went this way) 2. enable the zlib module in Modules/Setup.dist[1], but build it as *shared*. this will build the module as a seperate shared library after python is built 3. go back to the -r1 behaviour and leave zlibmodule commented out in Modules/Setup.dist, on systems that support it pythons build system will still build the zlib module after its done building the modules listed in Modules/Setup.dist (I'm not sure why this was changed, there could be a good reason) 2 and 3 are pretty close to each other, the only differences I can think of are 1) with 3 the module will be created later, and 2) with 3 the setup will silently not build the module if the target doesn't support it [1]: http://svn.python.org/view/python/tags/r243/Modules/Setup.dist?rev=43414&view=auto
emerge --info: Portage 2.1.1_pre5-r3 (default-linux/x86/2006.0, gcc-4.1.1/vanilla, glibc-2.4-r3, 2.6.17-gentoo-r3 i686) ================================================================= System uname: 2.6.17-gentoo-r3 i686 Intel(R) Pentium(R) 4 CPU 3.20GHz Gentoo Base System version 1.12.4 Last Sync: Sun, 27 Aug 2006 09:00:01 +0000 distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] app-admin/eselect-compiler: 2.0.0_rc2-r1 dev-lang/python: 2.4.3-r1 dev-python/pycrypto: 2.0.1-r5 dev-util/ccache: [Not Present] dev-util/confcache: [Not Present] sys-apps/sandbox: 1.2.18.1 sys-devel/autoconf: 2.13, 2.60 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2 sys-devel/binutils: 2.17 sys-devel/gcc-config: 2.0.0_rc1 sys-devel/libtool: 1.3.5, 1.5.22 virtual/os-headers: 2.6.17 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-g -O2 -march=prescott -pipe -frerun-loop-opt -floop-optimize2" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config" CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/eselect/compiler /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/texmf/web2c" CXXFLAGS="-g -O2 -march=prescott -pipe -frerun-loop-opt -floop-optimize2" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks fixpackages metadata-transfer sandbox sfperms splitdebug strict" GENTOO_MIRRORS="ftp://gentoo.mirrors.pair.com/ http://gentoo.osuosl.org/" LANG="en_CA.utf8" LC_ALL="en_CA.utf8" LDFLAGS="-Wl,--as-needed" LINGUAS="" MAKEOPTS="-j3" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/portage/local/layman/fluidportage /usr/portage/local/layman/liferea_overlay /usr/portage/local/layman/java-migration-packages /usr/portage/local/layman/java-experimental /usr/portage/local/layman/gnome-experimental /usr/local/portage /usr/local/lila-portage /home/kyle/Projects/ebuilds" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="x86 X a52 aac aalib acl acpi alsa apache2 apm arts audiofile avahi avi bash-completion berkdb bitmap-fonts bzip2 cairo cdda cddb cdparanoia cdr cjk cli crypt cups curl curlwrappers dba dbm dbus dbx dedicated directfb dlloader dmi doc dri dts dv dvd dvdr eds elibc_glibc emboss encode esd exif fbcon ffmpeg firefox flac foomaticdb fortran ftp gd gdbm ggi gif glx gnome gphoto2 gpm gstreamer gtk gtk2 gtkhtml hal iconv idn imagemagick imlib input_devices_evdev input_devices_keyboard input_devices_mouse ipv6 isdnlog ithreads jabber java joystick jpeg kde kernel_linux lcms ldap libg++ libnotify libwww mad matroska mhash mikmod mmap mmx mng mono motif mp3 mpeg msn ncurses nls nntp nptl nptlonly nvidia ogg opengl oss pam pango pcre pdf pdflib perl png pppd python qt qt3 qt4 quicktime readline real reflection ruby samba sdl session simplexml sndfile sockets speex spell spl sqlite sse sse2 ssl startup-notification svg tcpd tetex theora tiff tk truetype truetype-fonts type1-fonts udev unicode usb userland_GNU vcd video_cards_apm video_cards_ark video_cards_ati video_cards_chips video_cards_cirrus video_cards_cyrix video_cards_dummy video_cards_fbdev video_cards_glint video_cards_i128 video_cards_i740 video_cards_i810 video_cards_imstt video_cards_mga video_cards_neomagic video_cards_nsc video_cards_nv video_cards_rendition video_cards_s3 video_cards_s3virge video_cards_savage video_cards_siliconmotion video_cards_sis video_cards_sisusb video_cards_tdfx video_cards_tga video_cards_trident video_cards_tseng video_cards_v4l video_cards_vesa video_cards_vga video_cards_via video_cards_vmware video_cards_voodoo videos vorbis win32codecs wmf wxwindows xine xinerama xml xml2 xmlrpc xorg xpm xprint xsl xv xvid yahoo zlib" Unset: CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_RSYNC_EXTRA_OPTS
The previous version of the libdir patch contained: -#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz +#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/@@GENTOO_LIBDIR@@ -lz New version has: -#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz +zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/@@GENTOO_LIBDIR@@ -lz I'm pretty sure that "#" wasn't supposed to go, but I'll wait for liquidx to confirm that since I'm not 100% sure (and don't have a working multilib system available atm to test the multilib changes in).
FYI, according to a post on -user, this has resurrected bug #90545, only with OOo 2.0.3.
(In reply to comment #6) > FYI, according to a post on -user, this has resurrected bug #90545, only with > OOo 2.0.3. > Effectively, with -r2 the ebuild app-office/openoffice-2.0.3 fails after 2-3 hrs of compilation complaining deflate symbol is missing in libpython-2.4.so The compilation of OpenOffice works with -r1 but not -r2.
marienz is correct, I accidentally uncommented zlib while I was updating the patch to properly support multilib. i'm just rolling out a new patch tarball to fix it for -r3.
*** Bug 145380 has been marked as a duplicate of this bug. ***
commited 2.4.3-r3 that fixes the typo. can people please confirm whether it fixed the problem? thanks
Works for me with --as-needed and does not link against libz.so.
-r3 works for me
Works for me as well, thanks
phew, closing this bug now. thanks all.
thx is working...
This problem seems to be back with the new python 2.5 ebuild
the old patch slipped into the 2.5 patch set. fixed in 2.5-r1