This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author srmadsen
Recipients Doug.Shea, Jerzy.Kozera, Matt.Selsky, mark.dickinson, mhenriq, srmadsen
Date 2011-01-10.22:25:00
SpamBayes Score 1.3715997e-07
Marked as misclassified No
Message-id <1294698316.77.0.0898635590542.issue9742@psf.upfronthosting.co.za>
In-reply-to
Content
Python support,

This issue with not being able to build on Solaris 9 is easily fixed.  I have attached a patch with the fix for Python 2.7.

When linking with libpython-2.7.a, the linker will only extract modules that satisfy dependencies emanating from python.o.  There may be objects in the archive that are not needed to satisfy any of these dependencies and those WILL NOT be included in the executable.

The GNU linker supports two options that can be use to force the linker to include ALL objects in the archive.  Thus if you change the python link line from:


 $(BUILDPYTHON):  Modules/python.o $(LIBRARY) $(LDLIBRARY)
     $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
         Modules/python.o \
         $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)

to:

 $(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY)
     $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
         Modules/python.o \
         -Wl,--whole-archive $(BLDLIBRARY) -Wl,--no-whole-archive \
         $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)

Then the problem is resolved.

For compiler toolchains that do not support the --whole-library option, you can change the link to link with the individual .o files and not use the archive library at all.

Let me know if I can be of any more help.

Reid Madsen
History
Date User Action Args
2011-01-10 22:25:16srmadsensetrecipients: + srmadsen, mark.dickinson, mhenriq, Doug.Shea, Jerzy.Kozera, Matt.Selsky
2011-01-10 22:25:16srmadsensetmessageid: <1294698316.77.0.0898635590542.issue9742@psf.upfronthosting.co.za>
2011-01-10 22:25:00srmadsenlinkissue9742 messages
2011-01-10 22:25:00srmadsencreate