Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 167934
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: TCL/TK Herd Maintainers <tcltk@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Markus Meier <markus.meier74@gmail.com>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 167934 depends on: Show dependency tree
Bug 167934 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2007-02-21 22:38 0000
Python (v. 2.4.3-r4) does not build with Tkinter support, even if USE=tk is
set.

Error from python build log (error is silently ignored):
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../../../x86_64-pc-linux-gnu/bin/ld:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../../../lib64/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/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../../../lib64/libBLT.a: could not
read symbols: Bad value

Solution: blt (2.4z-r1) must be built with the -fPIC flag.

The following patch for dev-tcltk/blt/blt-2.4z-r1.ebuild fixes the problem:
*************** Start Patch **********************
1.ebuild 
--- blt-2.4z-r1.ebuild.bu       2007-02-21 14:12:18.051161000 -0600
+++ /usr/portage/dev-tcltk/blt/blt-2.4z-r1.ebuild       2007-02-21
14:12:59.743161000 -0600
@@ -39,7 +39,7 @@
                                --with-x \
                                --with-tcl=/usr/$(get_libdir) || die
"./configure failed"

-       emake -j1 CFLAGS="${CFLAGS}" || die "emake failed"
+       emake -j1 CFLAGS="${CFLAGS} -fPIC" || die "emake failed"
 }

 src_install() {
********************End patch ********************

Reproducible: Always

Steps to Reproduce:
Make sure the tk USE flag is set.
(re)emerge tcl, tk, blt if required.
emerge python.

Actual Results:  
Importing the Tkinter module in python give the following error:

#
>>> import Tkinter
#
Traceback (most recent call last):
#
  File "<stdin>", line 1, in ?
#
  File "/usr/lib64/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


Error has been reported here, before:
http://pastebin.com/876644

Problem might be specific to gcc version 4.1.1 (?)

------- Comment #1 From Markus Meier 2007-02-21 22:47:25 0000 -------
Portage 2.1.2-r9 (default-linux/amd64/2006.1, gcc-4.1.1, glibc-2.5-r0,
2.6.18-gentoo-r6 x86_64)
=================================================================
System uname: 2.6.18-gentoo-r6 x86_64 Intel(R) Xeon(R) CPU            5150  @
2.66GHz
Gentoo Base System release 1.12.9
Timestamp of tree: Wed, 21 Feb 2007 03:20:01 +0000
dev-java/java-config: 1.3.7, 2.0.31
dev-lang/python:     2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.61
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
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.14
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r1
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=nocona -mfpmath=sse -O2 -pipe"
CHOST="x86_64-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/gconf
/etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-march=nocona -mfpmath=sse -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="ftp://gentoo.arcticnetwork.ca/pub/gentoo/ "
LANG="en_CA.UTF-8"
LC_ALL=""
LINGUAS="de_CH en_CA en fr_FR de de_DE en_GB"
MAKEOPTS="-j5"
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/local/portage"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="X Xaw3d a52 aac aalib acpi aim alsa amd64 aotuv apache2 applet asf atlas
automount avahi avi bash-completion bidi bitmap-fonts blas bluetooth bonjour
bonobo bzip2 cairo canna catalogs cddb cdio cdparanoia cdr cjk cle266 cli corba
cracklib crypt cups curl curlwrappers dbus dmi dnd doc double-precision dri dts
dv dvb dvd dvdr dvdread emacs emacs-w3 emboss emf encode exif fam fame ffmpeg
fftw firefox flac fontconfig foomaticdb fortran fpx ftp gadu gaim gb gcj gd
gdbm gif gimp gimpprint ginac glade glut gnome gnome-print gnomecanvas gnomedb
gnutls gphoto2 gpm graphviz gstreamer gtk gtk2 gtkhtml guile gzip hal hfs iconv
icq idn ieee1394 imagemagick imap imlib ipod jabber java javascript jbig jpeg
jpeg2k lapack lcms ldap ldapsam leim lesstif libcaca libgda libwww linugas_fr
linugas_fr_CA lm_sensors lzo lzw mad meanwhile midi mikmod mime mjpeg mmap mng
mozsvg mp3 mpeg mpm-worker msdfs msn mule musepack ncurses netcdf network nfs
nls nptl nptlonly nsplugin nvidia ogg openal openbabel opengl oscar pam pcre
pda pdf pdflib perl php plotutils png posix povray ppds pulseaudio pymol python
quicktime readline recode reflection reiser4 reiserfs samba scanner sdl session
sftp sftplogging sox speex spell spl ssl startup-notification svg tcl tcpd tga
theora thesaurus threads tiff tk truetype truetype-fonts type1-fonts udev
unicode usb v4l v4l2 vcd vdr vorbis wma wmf wordperfect wxwindows x264 xanim
xfs xine xinerama xml xorg xosd xpm xv xvid xvmc yahoo yv12 zip zlib"
ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci 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 mulaw multi null plug rate route share shm softvol"
ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux"
LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses
text" LINGUAS="de_CH en_CA en fr_FR de de_DE en_GB" USERLAND="GNU"
VIDEO_CARDS="apm ark ati chips cirrus cyrix dummy fbdev glint i128 i810 mga
neomagic nv rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga
trident tseng v4l vesa vga via vmware voodoo nvidia"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS,
PORTAGE_RSYNC_EXTRA_OPTS

------- Comment #2 From Jakub Moc (RETIRED) 2007-02-22 01:22:23 0000 -------
(In reply to comment #0)
Which dev-lang/tk version is this about? Try w/ 8.4.14; cannot reproduce this.

------- Comment #3 From Markus Meier 2007-02-22 16:29:47 0000 -------
(In reply to comment #2)
> (In reply to comment #0)
> Which dev-lang/tk version is this about? Try w/ 8.4.14; cannot reproduce this.
> 

Thanks for your fast reply! I was using the latest stable version (dev-lang/tk
8.4.9). I upgraded to tk 8.4.14, I still have the same problem!
Should python not link against the shared library version of libBLT rather than
the static one?
I tried upgrading python from version 2.4.3-r4 to 2.4.4. I still have the same
problem. I am not upgrading to 2.5.

python build log:
building '_tkinter' extension
x86_64-pc-linux-gnu-gcc -pthread -DNDEBUG -march=nocona -mfpmath=sse -O2 -pipe
-fPIC -fno-strict-aliasing -DWITH_APPINIT=1 -DWITH_BLT=1 -I/usr/X11/include -I.
-I/var/tmp/portage/dev-lang/python-2.4.3-r4/work/Python-2.4.3/./Include
-I/var/tmp/portage/dev-lang/python-2.4.3-r4/work/Python-2.4.3/Include
-I/var/tmp/portage/dev-lang/python-2.4.3-r4/work/Python-2.4.3 -c
/var/tmp/portage/dev-lang/python-2.4.3-r4/work/Python-2.4.3/Modules/_tkinter.c
-o build/temp.linux-x86_64-2.4/_tkinter.o
x86_64-pc-linux-gnu-gcc -pthread -DNDEBUG -march=nocona -mfpmath=sse -O2 -pipe
-fPIC -fno-strict-aliasing -DWITH_APPINIT=1 -DWITH_BLT=1 -I/usr/X11/include -I.
-I/var/tmp/portage/dev-lang/python-2.4.3-r4/work/Python-2.4.3/./Include
-I/var/tmp/portage/dev-lang/python-2.4.3-r4/work/Python-2.4.3/Include
-I/var/tmp/portage/dev-lang/python-2.4.3-r4/work/Python-2.4.3 -c
/var/tmp/portage/dev-lang/python-2.4.3-r4/work/Python-2.4.3/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
-march=nocona -mfpmath=sse -O2 -pipe build/temp.linux-x86_64-2.4/_tkinter.o
build/temp.linux-x86_64-2.4/tkappinit.o -L/usr/X11/lib -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/4.1.1/../../../../x86_64-pc-linux-gnu/bin/ld:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../../../lib64/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/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../../../lib64/libBLT.a: could not
read symbols: Bad value
collect2: ld returned 1 exit status

----

Importing Tkinter module to python:
Python 2.4.4 (#1, Feb 22 2007, 10:19:17)
[GCC 4.1.1 (Gentoo 4.1.1-r3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Tkinter
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib64/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

------- Comment #4 From Markus Meier 2007-02-23 19:17:38 0000 -------
blt (2.4z-r1) does not create a symbolic link in /usr/lib/64 from libBLT24.so
to libBLT.so. Python links with -lBLT but does not find the missing libBLT.so
and tries to link to the static libBLT.a instead.
(btw. the symbolic link from libBLTlite24.so to libBLTlite.so is also missing)

Creating the missing link manually resolves the problem and the Tkinter support
is built in python.

------- Comment #5 From Jakub Moc (RETIRED) 2007-03-20 06:59:43 0000 -------
*** Bug 171509 has been marked as a duplicate of this bug. ***

------- Comment #6 From Jakub Moc (RETIRED) 2007-03-20 14:24:26 0000 -------
Sending this to dev-tcltk/blt maintainer...

------- Comment #7 From MATSUU Takuto 2007-04-29 01:13:03 0000 -------
fixed in cvs.

------- Comment #8 From Jakub Moc (RETIRED) 2007-12-28 18:13:41 0000 -------
*** Bug 202735 has been marked as a duplicate of this bug. ***

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug