FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.

» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Alt

LinkBack Thread Tools
Old 09-13-2010, 10:47 AM
Default Gentoo/Cygwin: Vicious Python


to save me hours of debuggins, I hope to find some hints for the bunch
of Python related issus. I add the full build log as attachment and at
the bottom of the mail some extracts of it.

To get this far I needed to comment out a line the ebuild:

src_prepare() {
# Ensure that internal copies of expat, libffi and zlib are not used.
rm -fr Modules/expat
# rm -fr Modules/_ctypes/libffi*
rm -fr Modules/zlib

Else it ends with this ( and there are no more libffi messages):

error: /home/prefix/gentoo/var/tmp/portage/dev-lang/python-2.6.4-r1/work/Python-2.6.4/Modules/_ctypes/libffi:
No such file or directory

So it seems it can only work with the internal copy of libffi. Why?

In Cygwin there is a runtime:


In Prefix there is:


The other issus is a missing _PyFPE_counter. Is this likely

[ ] a bug in python
[ ] a bug in a patch
[ ] a library not found

Finally a also tested the old python-2.4.6. It is compiled but ends with:

* emake altinstall maninstall failed

Thank you for help


./configure --prefix=/home/prefix/gentoo/usr --build=i686-pc-cygwin1.7
--host=i686-pc-cygwin1.7 --mandir=/home/prefix/gentoo/usr/share/man
--localstatedir=/home/prefix/gentoo/var/lib --with-fpectl
--disable-ipv6 --with-threads --enable-unicode=ucs4
--infodir=${prefix}/share/info --mandir=${prefix}/share/man
--with-libc= --with-system-ffi --enable-shared
Creating library file: libpython2.6.dll.a
gcc -L/home/prefix/gentoo/usr/lib -L/home/prefix/gentoo/lib -L. -o
libpython2.6.dll.a -ldl -lm
INFO: Can't locate Tcl/Tk libs and/or headers
building 'math' extension
gcc -fno-strict-aliasing -DNDEBUG -I.
-I. -IInclude -I./Include -I/home/prefix/gentoo/usr/include
-c /home/prefix/gentoo/var/tmp/portage/dev-lang/python-2.6.5-r2/work/Python-2.6.5/Modules/mathmodule.c
-o build/temp.cygwin-1.7.7-i686-2.6/home/prefix/gentoo/var/tmp/portage/dev-lang/python-2.6.5-r2/work/Python-2.6.5/Modules/mathmodule.o
In function `math_fsum':
warning: passing arg 1 of `PyFPE_dummy' discards qualifiers from
pointer target type
gcc -shared -Wl,--enable-auto-image-base -L/home/prefix/gentoo/usr/lib
-L/home/prefix/gentoo/lib -L. -fno-strict-aliasing -DNDEBUG -I.
-IInclude -I./Include -I/home/prefix/gentoo/usr/include
-L/home/prefix/gentoo/usr/lib -L/home/prefix/gentoo/lib -L. -lm
-lpython2.6 -o build/lib.cygwin-1.7.7-i686-2.6/math.dll
undefined reference to `_PyFPE_counter'
undefined reference to `_PyFPE_counter'
collect2: ld returned 1 exit status

building 'strop' extension
gcc -fno-strict-aliasing -DNDEBUG -I.
-I. -IInclude -I./Include -I/home/prefix/gentoo/usr/include
-c /home/prefix/gentoo/var/tmp/portage/dev-lang/python-2.6.5-r2/work/Python-2.6.5/Modules/stropmodule.c
-o build/temp.cygwin-1.7.7-i686-2.6/home/prefix/gentoo/var/tmp/portage/dev-lang/python-2.6.5-r2/work/Python-2.6.5/Modules/stropmodule.o
gcc -shared -Wl,--enable-auto-image-base -L/home/prefix/gentoo/usr/lib
-L/home/prefix/gentoo/lib -L. -fno-strict-aliasing -DNDEBUG -I.
-IInclude -I./Include -I/home/prefix/gentoo/usr/include
-L/home/prefix/gentoo/usr/lib -L/home/prefix/gentoo/lib -L.
-lpython2.6 -o build/lib.cygwin-1.7.7-i686-2.6/strop.dll
undefined reference to `_PyFPE_counter'
collect2: ld returned 1 exit status
Failed to find the necessary bits to build these modules:
_bsddb _hashlib _sqlite3
_ssl _tkinter bsddb185
gdbm linuxaudiodev nis
ossaudiodev spwd sunaudiodev
To find the necessary bits, look in setup.py in detect_modules() for
the module's name.

Failed to build these modules:
cmath math strop


make: *** [sharedmods] Error 1
* ERROR: dev-lang/python-2.6.5-r2 failed:
* emake failed
Old 09-16-2010, 08:31 PM
Default Gentoo/Cygwin: Vicious Python


> ./configure --prefix=/home/prefix/gentoo/usr --build=i686-pc-cygwin1.7
> --host=i686-pc-cygwin1.7 --mandir=/home/prefix/gentoo/usr/share/man
> --infodir=/home/prefix/gentoo/usr/share/info
> --datadir=/home/prefix/gentoo/usr/share
> --sysconfdir=/home/prefix/gentoo/etc
> --localstatedir=/home/prefix/gentoo/var/lib --with-fpectl
> --disable-ipv6 --with-threads --enable-unicode=ucs4
> --infodir=${prefix}/share/info --mandir=${prefix}/share/man
> --with-libc= --with-system-ffi --enable-shared

I managed to emerge portage finally, but it was missing the broken
math module of python. So back to python.

I found out by extended experiments that it is the --with-fpectl
option which causes the errors of the math module: undefined reference
to `_PyFPE_counter'. Now this counter is something completly

Didn't figure out how all this is related, ... but ... IT WORKS so far
... I can run emerge -- sometimes.

This python stuff took me four days so far. Still it's very dirty.
Some patches applied, others disabled, expat module still broken.

It's "sometimes", because I am in the DLL hell again. DLLs changing
addresses each run and Cygwins rebaseall script doesn't fix it this

Again I know there is a solution, as the Cygwin binaris of python work.

Old 09-18-2010, 03:24 PM
Default Gentoo/Cygwin: Vicious Python

> It's "sometimes", because I am in the DLL hell again. DLLs changing
> addresses each run and Cygwins rebaseall script doesn't fix it this
> time.

Again something for the archives and those who are interested:

The reason why rebaseall didn't fix it is, that it only rebases files
that have been installed with setup.exe. It makes use of files in
which the pathes of DLLs are listet. By creating such a list file it
is possible to rebase user contributed DLLs. The file is given with
the -T option of rebaseall.


Open a windows command shell (cmd):

/bin/rebaseall -T /home/prefix/rebase.lst

I create the rebase.lst with this lines:

rm $BASE/rebase.lst
find $BASE/gentoo/bin/ -name *.dll -o -name *.so >> $BASE/rebase.lst
find $BASE/gentoo/lib/ -name *.dll -o -name *.so >> $BASE/rebase.lst
find $BASE/gentoo/usr/bin -name *.dll -o -name *.so >> $BASE/rebase.lst
find $BASE/gentoo/usr/lib -name *.dll -o -name *.so >> $BASE/rebase.lst

Maybe some more is required if DLLs are outside of this pathes. It is
necessary that all DLLs have write access to change the default
address where they are loaded to.


A remaining problem is, that you can't run this script from within
bash, which depends on many DLLs itself. Hence you have to run it from
a very limited ash. This means, you can't include the rebaseall script
into emerge, if you wan't be able to run emerge from bash.

I need to adapt the rebase all script so that it only rebases those
DLLs that are not loaded by bash. It must load them to a completly
different address space. That would base DLLs from Perl and Python for

Remains the issue with the ncurses DLL wich has a bad (low) default
address, but bash depends on it. The best solution is probably to set
it explicitly to a sane address.


Thread Tools

All times are GMT. The time now is 07:48 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org