[uClibc]Still trouble building Python 2.2

Jon Nelson jnelson at securepipe.com
Fri Feb 1 22:59:07 UTC 2002


I'm looking to use the buildroot stuff to compile Python 2.2
It looks like I run into a few issues, one of which being that
*during* the build phase the newly-built python is run,
resulting sometimes in errors (because the dynamic linker
can't find the library) and other times in very strange
behavior (infinite looping that is unexplained).

I'm using the stock uClibc build flags with 
DODEBUG, INCLUDE_RPC, and DOPIC turned *off*
and
DOLFS and DO_C99_MATH turned *on*

I unpack Python 2.2 into Python-2.2
I edit Python-2.2/setup.py to change 
"disabled_module_list = []"
to look like
disabled_module_list = ['_tkinter', 'fpectl', 'zlib', 'readline',
                        'dbm', 'gdbm', 'bsddb', 'mpz', 'nis',
                        '_curses', '_curses_panel',]
and changed line 361 from:
        if (ssl_incs is not None and
to
        if (ssl_incs is not None and 0 and

to prevent it from trying to build SSL support in.


I create python 'mkdir python'
I cd into python, and run:
CC=../staging_dir/bin/gcc ../Python-2.2/configure \
  --without-threads --disable-ipv6 --with-cycle-gc \
  --with-pymalloc

I'll be trying shortly with various combinations
of with and without cycle-gc and pymalloc.

Anyway, then I just type 'make' and it proceeds to build
Parser/pgen:(Some comments added by me)
...

../staging_dir/bin/gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes 
Parser/acceler.o Parser/grammar1.o Parser/listnode.o
Parser/node.o Parser/parser.o Parser/parsetok.o
Parser/tokenizer.o Parser/bitset.o Parser/metagrammar.o
Python/mysnprintf.o Parser/firstsets.o Parser/grammar.o
Parser/pgen.o Parser/printgrammar.o Parser/pgenmain.o -ldl 
-lutil -o Parser/pgen^^^^^^^^^^^^--------------------- Success
Parser/pgen ../Python-2.2/Grammar/Grammar
../Python-2.2/Include/graminit.h
../Python-2.2/Python/graminit.c^^^^^^^^^^^^---------------------
it tries to run pgen and it doesn't work, of course, because it
can't find the libraries

make: Parser/pgen: Command not found
make: [../Python-2.2/Include/graminit.h] Error 127 (ignored)
(temporarily interrupted at this stage via control-s)

Now I crack open another shell, and in the same python directory,
type../staging_dir/bin/ldd Parser/pgen
and I get:
Segmentation fault (core dumped)

and ltrace shows:

strcat("/usr/lib/", "libutil.so.0\241")           =
"/usr/lib/libutil.so.0\241"__xstat(3,
"/usr/lib/libutil.so.0\241", 0xbffff6f8) = -1 free(0x0804a470)   
                              = <void> free(0x0804a470)          
                       = <void>--- SIGSEGV (Segmentation fault)
---+++ killed by SIGSEGV +++

So, anyway, I let the build continue.
pgen throughout the build continues to fail,
but it's apparently not fatal.
Then, while trying to compile the socket module, I get
an error for getaddrinfo.c:203, conflicting types for
`gai_strerror', where the previous definition is in uClibc's
include/netdb.h:490

Grr.

OK, so how do they differ?

(From getaddrinfo.c)
char *
gai_strerror(ecode)
        int ecode;
{
        if (ecode < 0 || ecode > EAI_MAX)
                ecode = EAI_MAX;
        return ai_errlist[ecode];
}

and from netdb.h:
extern __const char *gai_strerror (int __ecode) __THROW;


OK, so no big deal, fix getaddrinfo.c to use 'const'
Done, issue 'make':
there is an error but I'm not sure it's fatal, although
building it *did* succeed without warning or error:
WARNING: removing "_socket" since importing it failed

Note that I get the same error with the fcntl module,
although it, too, builds successfully.

Aha! I hacked setup.py to blather to me *why* the imports
fail, and they both fail because of an unresolved symbol:
fcntl64

Grr.

So, that's where I am thus far.


-- 
The Amazing* Jon Nelson <jnelson at securepipe.com>
C and Python Programmer, Code Gardener
Just because it's not broken doesn't mean we can't take it apart.
  (* may not actually amaze)



More information about the uClibc mailing list