Python 2.2.1 vs. gcc 3.1?

Martin v. Löwis loewis at informatik.hu-berlin.de
Fri Jun 7 21:44:45 CEST 2002


Andrew Koenig <ark at research.att.com> writes:

> ImportError: ld.so.1: ./python: fatal: relocation error: file /tmp/build-python/Python-2.2.1/build/lib.solaris-2.8-sun4u-2.2/struct.so: symbol PyString_Type: referenced symbol not found
> 
> So apparently the shared libraries are not being built properly.
> 
> Any more ideas?

The typical cause of this problem is that you are using GNU binutils,
in which case the compiler needs the option -Wl,--export-dynamic when
linking the Python executable. 

Now, there is machinery in configure.in to determine whether this flag
is needed. Traditionally (up to Python 2.2.1), this machinery invokes
'gcc -Xlinker -V' and expects to find 'BFD' in its output if it is GNU
ld, such as

GNU ld version 2.11.2 (with BFD 2.11.2)
  Supported emulations:
   elf32_sparc
   elf64_sparc

Starting with binutils 2.12, GNU ld stops printing BFD in its -V
output, so that this detection mechanism fails.

This has been fixed in the CVS, by checking presence of the
--export-dynamic linker option directly (configure.in 2.288.6.5, for
the 2.2 branch).

Regards,
Martin



More information about the Python-list mailing list