[Python-bugs-list] [ python-Bugs-596422 ] build dumps core (binutils 2.13/solaris)

noreply@sourceforge.net noreply@sourceforge.net
Wed, 13 Nov 2002 09:40:41 -0800


Bugs item #596422, was opened at 2002-08-17 15:44
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=596422&group_id=5470

Category: Build
Group: Platform-specific
Status: Open
Resolution: None
Priority: 5
Submitted By: Andrew Koenig (arkoenig)
Assigned to: Martin v. L÷wis (loewis)
Summary: build dumps core (binutils 2.13/solaris)

Initial Comment:
Installing Python 2.2.1 on Solaris causes a core dump
during build (just after trying to load struct.so) if I
am using binutils 2.13.  This happens with either gcc
3.1.1 or gcc 3.2, on either solaris 7 or solaris 8.  I
suspect it happens on other combinations as well.

It works just fine with binutils 2.12.1, so the problem
appears to be in binutils, not Python per se.  The
attached file, contributed by Zack Weinberg
(zack@codesourcery.com), tests for the presence of the
problem; if it executes to completion, the problem
isn't there.

Perhaps it might make sense to put a similar test into
the Python installation procedure?



----------------------------------------------------------------------

>Comment By: Martin v. L÷wis (loewis)
Date: 2002-11-13 18:40

Message:
Logged In: YES 
user_id=21627

I still have the plan of adding a comment to README pointing
out what binutils releases need to be avoided, but that can
be done when we know what binutils release to use.

----------------------------------------------------------------------

Comment By: Andrew Koenig (arkoenig)
Date: 2002-11-13 16:59

Message:
Logged In: YES 
user_id=418174

Here is a patch (to binutils) that makes it possible to
build Python with binutils 2.13.1.

----------------------------------------------------------------------

Comment By: Andrew Koenig (arkoenig)
Date: 2002-11-13 16:54

Message:
Logged In: YES 
user_id=418174

At this point, I do not believe that any changes to Python
are necessary.  The main point is for people installing
Python on Solaris (and perhaps elsewhere) to realize that
they must not use binutils 2.13 or 2.13.1.  The attached
patch will make binutils 2.13.1 work.

----------------------------------------------------------------------

Comment By: Martin v. L÷wis (loewis)
Date: 2002-11-13 16:40

Message:
Logged In: YES 
user_id=21627

I will wait before making changes until the entire issue is
settled (or until the 2.3 release is getting near). Thanks
for the update.

----------------------------------------------------------------------

Comment By: Andrew Koenig (arkoenig)
Date: 2002-11-13 16:00

Message:
Logged In: YES 
user_id=418174

Binutils 2.13.1 is still not right.  I am told that 2.13.2
will be out soon and will fix the problem.

----------------------------------------------------------------------

Comment By: Martin v. L÷wis (loewis)
Date: 2002-09-21 01:14

Message:
Logged In: YES 
user_id=21627

combreloc is not a compiler option, but a linker option. For
GNU binutils, it was first implemented in 2.12. The system
linker supports this option since Solaris 7. Older binutils
versions ignore -z options that they don't recognize, so
there is no need for a version check here.

The option arranges to combine multiple relocation sections,
sorting them by symbol so that multiple relocations for the
same symbol follow each other. The dynamic linker can cache
the most-recently looked-up symbol from relocation to
relocation, so that combreloc reduces the number of symbol
lookups.

I somehow doubt the validity of this patch, though: the
entire approach was pioneered by Sun for Solaris, so if it
causes problems with GNU binutils, it is likely a binutils bug.

Therefore, I'd postpone this patch until the issue has been
fully studied by binutils maintainers, and would advise
against using binutils 2.13 on Solaris for the moment.



----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2002-09-21 00:26

Message:
Logged In: YES 
user_id=6380

Looks harmless to me, but I can't test it. Only the
configure.in patch is really needed; we generate configure
using autoconf (and then check it in for the benefit of others).

Assigning to MvL.

Martin, can you test this on Solaris with the indicated GCC
release? Or should we just jump the gun???  (Hm, what about
older GCC releases -- it needs to be tested there too.)

I'd still like to understand what "combreloc" does...

----------------------------------------------------------------------

Comment By: Andrew Koenig (arkoenig)
Date: 2002-09-20 19:19

Message:
Logged In: YES 
user_id=418174

Here's the patch to configure.in

----------------------------------------------------------------------

Comment By: Andrew Koenig (arkoenig)
Date: 2002-09-20 19:17

Message:
Logged In: YES 
user_id=418174

I have learned from Nick Clifton at Red Hat that the source
of the problem is a change in the default linker options
between 2.12 and 2.13.  The specific option that causes the
trouble is -zcombreloc, which is the default in 2.13, and
which apparently produces a dll that doesn't work under
Solaris.  Don't know whether this is a Solaris bug or not,
but a workaround is clearly indicated.

Attached are patch files that can be applied to configure
and configure.in (in the Python root directory) to work
around the problem.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=596422&group_id=5470