Python 2.3.4-r1 (haven't checked other versions) doesn't build with Tkinter support on AMD64, even with the tcltk USE flag set. I expect this is due to the following error in the build, shortly before the "Test phase (not enabled)" message: x86_64-pc-linux-gnu-gcc -pthread -shared build/temp.linux-x86_64-2.3/_tkinter.o build/temp.linux-x86_64-2.3/tkappinit.o -L/usr/X11R6/lib -L/usr/local/lib -lBLT -ltk8.4 -ltcl8.4 -lX11 -o build/lib.linux-x86_64-2.3/_tkinter.so /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/X11R6/lib/libBLT.a(bltInit.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /usr/X11R6/lib/libBLT.a: could not read symbols: Bad value collect2: ld returned 1 exit status Reproducible: Always Steps to Reproduce: 1. USE=tcltk emerge =dev-lang/python-2.3.4-r1 2. python -c 'import Tkinter' Actual Results: Traceback (most recent call last): File "<string>", line 1, in ? File "/usr/lib/python2.3/lib-tk/Tkinter.py", line 38, in ? import _tkinter # If this fails your Python may not be configured for Tk ImportError: No module named _tkinter Expected Results: I assume step 2 should return to the shell without printing anything, although I haven't tried it in a "good" build of python - I took it from the pysol ebuild :-) Portage 2.0.51-r15 (default-linux/amd64/2004.3, gcc-3.4.3, glibc-2.3.4.20041102-r0, 2.6.10-gentoo-r6 x86_64) ================================================================= System uname: 2.6.10-gentoo-r6 x86_64 AMD Athlon(tm) 64 Processor 3000+ Gentoo Base System version 1.4.16 Python: dev-lang/python-2.3.4-r1 [2.3.4 (#2, Mar 1 2005, 21:38:17)] dev-lang/python: 2.3.4-r1 sys-devel/autoconf: 2.59-r6, 2.13 sys-devel/automake: 1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.4 sys-devel/binutils: 2.15.92.0.2-r1 sys-devel/libtool: 1.5.10-r4 virtual/os-headers: 2.6.8.1-r2 ACCEPT_KEYWORDS="amd64" AUTOCLEAN="yes" CFLAGS="-march=athlon64 -pipe -fstack-protector -fomit-frame-pointer -O2" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-march=athlon64 -pipe -fstack-protector -fomit-frame-pointer -O2" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs autoconfig ccache distlocks sandbox" GENTOO_MIRRORS="ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ ftp://mirrors.sec.informatik.tu-darmstadt.de/gentoo/ http://ftp.du.se/pub/os/gentoo http://ftp.easynet.nl/mirror/gentoo/" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="amd64 X aalib acl acpi alsa arts berkdb bitmap-fonts cdr crypt cups curl esd f77 fam flac font-server fortran gdbm ggi gif gtk gtk2 imagemagick imlib ipv6 java jp2 jpeg junit kde lcms leim libcaca libwww lzw lzw-tiff mad mikmod mng motif mozilla ncurses nls nptl oggvorbis opengl pam pdflib perl png postgres python qt readline samba sdl speex ssl tcltk tcpd tetex tifftimidity truetype truetype-fonts type1-fonts usb userlocales xml2 xmms xpm xrandr xv zlib linguas_en_GB" Unset: ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS
not quite sure what the -fPIC problem where is? is that with python or tcltk?
*** Bug 61870 has been marked as a duplicate of this bug. ***
The error was while merging Python, sorry if that wasn't clear.
Seems this now works with python-2.3.5 (and probably has for a while, but I didn't notice until now). Apologies for the distraction.
This is broken again in python-2.4.1-r1 for amd64: idiotBox /home/dumbUser> python -c "import Tkinter" Traceback (most recent call last): File "<string>", line 1, in ? File "/usr/lib/python2.4/lib-tk/Tkinter.py", line 38, in ? import _tkinter # If this fails your Python may not be configured for Tk ImportError: No module named _tkinter idiotBox /home/dumbUser> find /usr/lib/python* -iname "*tkinter*" /usr/lib/python2.3/lib-tk/Tkinter.pyc /usr/lib/python2.3/lib-tk/Tkinter.pyo /usr/lib/python2.3/lib-tk/Tkinter.py /usr/lib/python2.4/lib-tk/Tkinter.pyc /usr/lib/python2.4/lib-tk/Tkinter.pyo /usr/lib/python2.4/lib-tk/Tkinter.py .so modules aren't being built again?
reopening per comment 5
Here's the error I get in 2.4.1-r1 from the build log. building '_tkinter' extension x86_64-pc-linux-gnu-gcc -pthread -DNDEBUG -O2 -pipe -march=k8 -fPIC -fno-strict-aliasing -DWITH_APPINIT=1 -DWITH_BLT=1 -I/usr/X11R6/include -I. -I/var/tmp/portage/python-2.4.1-r1/work/Python-2.4.1/./Include -I/var/tmp/portage/python-2.4.1-r1/work/Python-2.4.1/Include -I/var/tmp/portage/python-2.4.1-r1/work/Python-2.4.1 -c /var/tmp/portage/python-2.4.1-r1/work/Python-2.4.1/Modules/_tkinter.c -o build/temp.linux-x86_64-2.4/_tkinter.o x86_64-pc-linux-gnu-gcc -pthread -DNDEBUG -O2 -pipe -march=k8 -fPIC -fno-strict-aliasing -DWITH_APPINIT=1 -DWITH_BLT=1 -I/usr/X11R6/include -I. -I/var/tmp/portage/python-2.4.1-r1/work/Python-2.4.1/./Include -I/var/tmp/portage/python-2.4.1-r1/work/Python-2.4.1/Include -I/var/tmp/portage/python-2.4.1-r1/work/Python-2.4.1 -c /var/tmp/portage/python-2.4.1-r1/work/Python-2.4.1/Modules/tkappinit.c -o build/temp.linux-x86_64-2.4/tkappinit.o x86_64-pc-linux-gnu-gcc -pthread -shared -fno-strict-aliasing -DNDEBUG -O2 -pipe -march=k8 build/temp.linux-x86_64-2.4/_tkinter.o build/temp.linux-x86_64-2.4/tkappinit.o -L/usr/X11R6/lib -L/usr/X11R6/lib -L/usr/local/lib64 -L/usr/local/lib -lBLT -ltk8.4 -ltcl8.4 -lX11 -o build/lib.linux-x86_64-2.4/_tkinter.so /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/X11R6/lib/libBLT.a(bltInit.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /usr/X11R6/lib/libBLT.a: could not read symbols: Bad value
here's the fix: CFLAGS="-O2 -march=k8 -pipe -fPIC" emerge -av blt emerge -av python idiotBox /home/dumbUser> python -c "import Tkinter" idiotBox /home/dumbUser> find /usr/lib/python* -name _tkinter\* /usr/lib/python2.4/lib-dynload/_tkinter.so
t35t0r, that's not a fix. it's an ugly workaround, which should not be used.
So do we need to create a new blt ebuild with PIC use flag?
no, we just have to make the package build shared objects with -fPIC on all arches
just for the record: works fine here with same version of python and same use flags, so the error is probably in another package
t35st0r, please post your emerge --info
Portage 2.0.51.22-r2 (default-linux/amd64/2005.1, gcc-3.4.4, glibc-2.3.5-r1, 2.6.13 x86_64) ================================================================= System uname: 2.6.13 x86_64 AMD Athlon(tm) 64 Processor 4000+ Gentoo Base System version 1.6.13 distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]ccache version 2.3 [disabled] dev-lang/python: 2.4.1-r1 sys-apps/sandbox: 1.2.12 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6 sys-devel/binutils: 2.15.92.0.2-r10 sys-devel/libtool: 1.5.18-r1 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="amd64" AUTOCLEAN="yes" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -pipe -march=k8" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib64/mozilla/defaults/pref /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -pipe -march=k8" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks sandbox sfperms strict" GENTOO_MIRRORS="http://gentoo.mirrors.tds.net/gentoo http://gentoo.mirrors.pair.com/ http://gentoo.osuosl.org http://www.ibiblio.org/pub/Linux/distributions/gentoo" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://eglimp/gentoo-portage" USE="amd64 3dnowex X acpi alsa arts avi berkdb bitmap-fonts cdr crypt cups curl eds encode esd fam flac foomaticdb fortran gif gnome gpm gstreamer gtk gtk2 imagemagick imlib ipv6 java jpeg kde lzw lzw-tiff mad motif mozilla mp3 mpeg mtrr ncurses nls ogg oggvorbis opengl pam pdflib perl plotutils png python qt quicktime readline samba sdl speex spell ssl tcltk tcpd tiff truetype truetype-fonts type1-fonts usb userlocales vorbis xine xml2 xpm xv zlib userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
This is still broken for python-2.4.2
I can not reproduce this bug either. Compiled fine and works without any python tracebacks.
I think this ok with all versions >= ( tcl and tk-8.4.12 and python-2.4.2-r1 ). Perhaps the bug opener can close this bug.
(In reply to comment #17) > I think this ok with all versions >= ( tcl and tk-8.4.12 and python-2.4.2-r1 ). > Perhaps the bug opener can close this bug. > Agreed.