Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 145242 - dev-lang/python-2.4.3-r2 fails to build with --as-needed
Summary: dev-lang/python-2.4.3-r2 fails to build with --as-needed
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Python Gentoo Team
: 145380 (view as bug list)
Depends on:
Blocks: as-needed
  Show dependency tree
Reported: 2006-08-27 03:26 UTC by Matthias Schwarzott
Modified: 2006-09-19 17:21 UTC (History)
10 users (show)

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

Zzam's emerge --info (zzam-emerge-info.txt,3.10 KB, text/plain)
2006-08-27 03:27 UTC, Matthias Schwarzott
patch to make python work with --as-needed (python-2.4.3-as-needed.patch,630 bytes, patch)
2006-08-27 03:51 UTC, Matthias Schwarzott
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Schwarzott gentoo-dev 2006-08-27 03:26:00 UTC
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
./ undefined reference to `deflate'
./ undefined reference to `inflate'
./ undefined reference to `deflateInit_'
./ undefined reference to `adler32'
./ undefined reference to `crc32'
./ undefined reference to `deflateInit2_'
./ undefined reference to `inflateEnd'
./ undefined reference to `inflateInit2_'
./ 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:, line 1543:   Called dyn_compile, 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 needs to be linked with "-lz".
Comment 1 Matthias Schwarzott gentoo-dev 2006-08-27 03:27:10 UTC
Created attachment 95186 [details]
Zzam's emerge --info
Comment 2 Matthias Schwarzott gentoo-dev 2006-08-27 03:51:33 UTC
Created attachment 95190 [details, diff]
patch to make python work with --as-needed

The attached patch makes the linker happy.
Comment 3 Kyle McFarland 2006-08-27 04:40:06 UTC
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 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

Comment 4 Kyle McFarland 2006-08-27 04:52:30 UTC
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-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
CFLAGS="-g -O2 -march=prescott -pipe -frerun-loop-opt -floop-optimize2"
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"
FEATURES="autoconfig distlocks fixpackages metadata-transfer sandbox sfperms splitdebug strict"
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'"
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"
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"
Comment 5 Marien Zwart (RETIRED) gentoo-dev 2006-08-27 10:35:09 UTC
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).
Comment 6 Richard Fish 2006-08-28 01:56:41 UTC
FYI, according to a post on -user, this has resurrected bug #90545, only with OOo 2.0.3.
Comment 7 Francois Chenier 2006-08-28 03:24:59 UTC
(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

The compilation of OpenOffice works with -r1 but not -r2.
Comment 8 Alastair Tse (RETIRED) gentoo-dev 2006-08-28 09:29:39 UTC
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.
Comment 9 Jakub Moc (RETIRED) gentoo-dev 2006-08-28 11:02:08 UTC
*** Bug 145380 has been marked as a duplicate of this bug. ***
Comment 10 Alastair Tse (RETIRED) gentoo-dev 2006-08-28 11:38:16 UTC
commited 2.4.3-r3 that fixes the typo. can people please confirm whether it fixed the problem? thanks
Comment 11 Matthias Schwarzott gentoo-dev 2006-08-28 11:57:39 UTC
Works for me with --as-needed and does not link against
Comment 12 Daniel Drake (RETIRED) gentoo-dev 2006-08-28 14:48:32 UTC
-r3 works for  me
Comment 13 Kyle McFarland 2006-08-28 21:04:05 UTC
Works for me as well, thanks
Comment 14 Alastair Tse (RETIRED) gentoo-dev 2006-08-29 05:50:38 UTC
phew, closing this bug now. thanks all.
Comment 15 Markus Giese 2006-08-31 09:11:16 UTC
thx is working...
Comment 16 Kyle McFarland 2006-09-19 15:25:11 UTC
This problem seems to be back with the new python 2.5 ebuild
Comment 17 Alastair Tse (RETIRED) gentoo-dev 2006-09-19 17:21:59 UTC
the old patch slipped into the 2.5 patch set. fixed in 2.5-r1