New version of Vladimir Marangozov's AIX hacks -- simpler etc.
diff --git a/Misc/AIX-NOTES b/Misc/AIX-NOTES
index 45aec1b..6050dd4 100644
--- a/Misc/AIX-NOTES
+++ b/Misc/AIX-NOTES
@@ -1,8 +1,7 @@
-Subject: AIX-NOTES FOR 1.4
-From: Manus Hand <Manus.Hand@evolving.com>
-To: guido@CNRI.Reston.VA.US
-cc: Vladimir.Marangozov@imag.fr
-Date: Fri, 25 Oct 1996 15:19:23 -0600 (MDT)
+Subject: AIX - Misc/AIX-NOTES
+From: Vladimir Marangozov <Vladimir.Marangozov@imag.fr>
+To: guido@CNRI.Reston.Va.US (Guido van Rossum)
+Date: Wed, 6 Aug 1997 11:41:00 +0200 (EET)
==============================================================================
COMPILER INFORMATION
@@ -19,7 +18,6 @@
AIX C compiler version 3.1.2 on AIX 4.1.3 and AIX 4.1.4
AIX C compiler version 1.3.0 on AIX 3.2.5
If you have this problem, please report the compiler/OS version.
- [Postscript: it has also been spotted on AIX 4.2.1 --Guido]
(2) Stefan Esser (se@MI.Uni-Koeln.DE), in work done to compile Python
1.0.0 on AIX 3.2.4, reports that AIX compilers don't like the LANG
@@ -56,8 +54,7 @@
THREAD SUPPORT
------------------------------------------------------------------------------
-AIX uses pthreads. However, as of AIX version 4, there are two (incompatible)
-types of pthreads on AIX:
+As of AIX version 4, there are two (incompatible) types of pthreads on AIX:
a) AIX DCE pthreads (on AIX 3.2.5)
b) AIX 4 pthreads (on AIX 4.1 and up)
Support has been added to Python to handle the distinction.
@@ -92,16 +89,15 @@
Python modules may now be built as shared libraries on AIX using the normal
process of uncommenting the "*shared*" line in Modules/Setup.in before the
-build. There is one additional step required, and that is to also uncomment
-the line in Modules/Setup.in which reads
- LINKCC= makexp_aix python.exp "" $(MYLIBS) $(ADDOBJS) ; $(CC)
+build.
AIX shared libraries require that an "export" and "import" file be provided
at compile time to list all extern symbols which may be shared between
-modules. The effect of uncommenting the LINKCC line in Modules/Setup.in is
-to create the "export" file for the modules and the libraries that belong to
-the Python core. This is done by the "makexp_aix" script, which creates a
-file named python.exp before performing the link of the python binary.
+modules. The "export" file (named python.exp) for the modules and the
+libraries that belong to the Python core is created by the "makexp_aix"
+script before performing the link of the python binary. It lists all global
+symbols (exported during the link) of the modules and the libraries that
+make up the python executable.
When shared library modules (.so files) are made, a second shell script
is invoked. This script is named "ld_so_aix" and is also provided with
@@ -111,16 +107,6 @@
command that creates the shared module. Among other things, it specifies
that the "python.exp" file is an "import" file for the shared module.
-A default python.exp file is provided with the distribution. It will be
-overwritten (by the action of the makexp_aix script) if you build with shared
-libraries. The python.exp file which comes with the distribution contains
-all extern symbols of a completely statically built python executable.
-Any python.exp file which is created from a build of python with some of the
-modules linked as shared modules will obviously not list symbols from the now
-dynamic modules. The distributed python.exp is provided so that, with
-assistance from the ld_so_aix and makexp_aix scripts, shared extension
-modules may be added to an otherwise completely static python build.
-
At the time of this writing, neither the python.exp file nor the makexp_aix
or ld_so_aix scripts are installed by the make procedure, so you should
remember to keep these and/or copy them to a different location for
diff --git a/Modules/Makefile.pre.in b/Modules/Makefile.pre.in
index 0abe6ef..213c74a 100644
--- a/Modules/Makefile.pre.in
+++ b/Modules/Makefile.pre.in
@@ -70,7 +70,7 @@
# === Variables that are customizable by hand or by inclusion in Setup ===
-LINKCC= $(PURIFY) $(CC)
+LINKCC= $(PURIFY) @LINKCC@
INCLDIR= $(srcdir)/../Include
CONFIGINCLDIR= ..
CFLAGS= $(OPT) -I$(INCLDIR) -I$(CONFIGINCLDIR) $(DEFS)
diff --git a/Modules/Setup.in b/Modules/Setup.in
index bb06b11..3e886fc 100644
--- a/Modules/Setup.in
+++ b/Modules/Setup.in
@@ -51,11 +51,6 @@
# to ftp sources from elsewhere.
-# -------> Uncomment this line if you are running AIX <----------
-# -------> and if you are building with shared libraries <----------
-#LINKCC= makexp_aix python.exp "" $(MYLIBS) $(ADDOBJS) ; $(CC)
-
-
# Some special rules to define PYTHONPATH.
# Edit the definitions below to indicate which options you are using.
# Don't add any whitespace or comments!
diff --git a/Modules/defmakexp_aix b/Modules/defmakexp_aix
deleted file mode 100755
index 675602c..0000000
--- a/Modules/defmakexp_aix
+++ /dev/null
@@ -1,106 +0,0 @@
-#! /bin/sh
-#
-# ============================================================================
-# FILE: defmakexp_aix
-# TYPE: standalone executable
-# SYSTEM: AIX, Solaris
-#
-# DESCRIPTION: This script creates the default export list file "python.exp"
-# for AIX platforms which has to be included in the Modules
-# directory of the python source tree.
-# It contains all global symbols defined in the following files:
-# a) python.o
-# b) ../libpython1.5.a
-#
-# The script should be run after a new unpack, configure & make
-# of the python release, without any options nor changes to
-# Modules/Setup.in (i.e. a default static build).
-#
-# USAGE: defmakexp_aix [path]
-#
-# where [path] points to the Python source root directory.
-# ============================================================================
-#
-
-
-#
-# Check for AIX or Solaris
-#
-if (test `uname -s` != "AIX") &&
- (test `uname -s` != "IRIX") &&
- (test `uname -s` != "SunOS" || test `uname -r | cut -d. -f1` != "5"); then
- echo "*** Make sure you are running AIX or Solaris"
- exit 1
-fi
-
-if test "$*" = ""; then
- echo "Usage: defmakexp_aix [path to python's source root directory]"
- exit 1
-fi
-
-#
-# Variables
-#
-VERSION=1.5
-ROOTDIR=$1
-MODSDIR=$ROOTDIR/Modules
-PYTHDIR=$ROOTDIR/Python
-OBJSDIR=$ROOTDIR/Objects
-PARSDIR=$ROOTDIR/Parser
-
-OBJFILES="$MODSDIR/python.o"
-LIBFILES="$ROOTDIR/libpython$(VERSION).a"
-ALLFILES="$OBJFILES $LIBFILES"
-
-#
-# Check for object and library files
-#
-for i in $ALLFILES; do
- echo "checking for $i"
- if test ! -f $i; then echo "*** Cannot find $i"; exit 1; fi
-done
-
-#
-# Setup the header of Modules/python.exp
-#
-pyexp=$MODSDIR/python.exp
-echo "making export list $pyexp"
-echo "#!" > $pyexp
-echo "*" >> $pyexp
-echo "* ========================================================= " >> $pyexp
-echo "* This is the default export list of the python executable. " >> $pyexp
-echo "* This file is used for the AIX platform ONLY. It provides " >> $pyexp
-echo "* a list of all variables in the python executable that are " >> $pyexp
-echo "* "exported" -- that is, which may be used by any extension " >> $pyexp
-echo "* modules that are created. This file should be used as an " >> $pyexp
-echo "* AIX "import" file when creating extension modules on that " >> $pyexp
-echo "* platform. " >> $pyexp
-echo "* " >> $pyexp
-echo "* This file was generated from the default configuration of " >> $pyexp
-echo "* the distribution (that is, from a build in which NONE of " >> $pyexp
-echo "* the python Modules were built as shared libraries). " >> $pyexp
-echo "* " >> $pyexp
-echo "* THIS FILE IS OVERWRITTEN anytime the python executable is " >> $pyexp
-echo "* re-built using a Modules/Setup file that was customized " >> $pyexp
-echo "* to call for the building of some or all python Modules as " >> $pyexp
-echo "* shared libraries and with the definition of LINKCC having " >> $pyexp
-echo "* been uncommented. A new python.exp will be generated by " >> $pyexp
-echo "* such a build; it will list ONLY the global symbols which " >> $pyexp
-echo "* are defined in the statically-bound modules and libraries." >> $pyexp
-echo "* ========================================================= " >> $pyexp
-echo "*" >> $pyexp
-
-#
-# Make the export list
-#
-if test `uname -s` = "AIX"; then
- nmflags='-Bex'
-else
- nmflags='-p'
-fi
-: ${nm=nm}
-$nm $nmflags $ALLFILES \
-| sed -e '/ [^BDT] /d' -e '/\./d' -e 's/.* [BDT] //' \
-| sort | uniq >> $pyexp
-
-echo "done"
diff --git a/Modules/ld_so_aix b/Modules/ld_so_aix
index 57fbdeb..7106c0b 100755
--- a/Modules/ld_so_aix
+++ b/Modules/ld_so_aix
@@ -20,6 +20,7 @@
# (*) -bE:[ExportFile] -bE:[OutputBaseName].exp
# (*) -bI:[ImportFile] -bI:./python.exp
# -bM:[ModuleType] -bM:SRE
+# -bhalt:[Number] -bhalt:4
# -T[Number] -T512
# -H[Number] -H512
# -lm
@@ -155,7 +156,7 @@
entry=init`echo $filename | sed "s/module.*//"`
fi
-#echo "ld_so_aix: Debug info section
+#echo "ld_so_aix: Debug info section"
#echo " -> output file : $objfile"
#echo " -> import file : $impfile"
#echo " -> export file : $expfile"
@@ -163,7 +164,7 @@
#echo " -> object files: $objs"
#echo " -> CC arguments: $args"
-CCOPT="-Wl,-e$entry -Wl,-bE:$expfile -Wl,-bI:$impfile"
+CCOPT="-Wl,-e$entry -Wl,-bE:$expfile -Wl,-bI:$impfile -Wl,-bhalt:4"
CCOPT="$CCOPT -Wl,-bM:SRE -Wl,-T512 -Wl,-H512 -lm -o $objfile"
CCARGS="$args"
diff --git a/Modules/python.exp b/Modules/python.exp
deleted file mode 100644
index 0d72da9..0000000
--- a/Modules/python.exp
+++ /dev/null
@@ -1,422 +0,0 @@
-#!
-*
-* =========================================================
-* This is the default export list of the python executable.
-* This file is used for the AIX platform ONLY. It provides
-* a list of all variables in the python executable that are
-* "exported" -- that is, which may be used by any extension
-* modules that are created. This file should be used as an
-* AIX "import" file when creating extension modules on that
-* platform.
-*
-* This file was generated from the default configuration of
-* the distribution (that is, from a build in which NONE of
-* the python Modules were built as shared libraries).
-*
-* THIS FILE IS OVERWRITTEN anytime the python executable is
-* re-built using a Modules/Setup file that was customized
-* to call for the building of some or all python Modules as
-* shared libraries and with the definition of LINKCC having
-* been uncommented. A new python.exp will be generated by
-* such a build; it will list ONLY the global symbols which
-* are defined in the statically-bound modules and libraries.
-* =========================================================
-*
-PyAST_Type
-PyArg_Parse
-PyArg_ParseTuple
-PyArg_ParseTupleAndKeywords
-PyArg_VaParse
-PyBuiltin_GetDict
-PyBuiltin_GetModule
-PyBuiltin_Init
-PyCFunction_GetFlags
-PyCFunction_GetFunction
-PyCFunction_GetSelf
-PyCFunction_New
-PyCFunction_Type
-PyCObject_AsVoidPtr
-PyCObject_FromVoidPtr
-PyCObject_Import
-PyCObject_Type
-PyCallable_Check
-PyClass_IsSubclass
-PyClass_New
-PyClass_Type
-PyCode_Addr2Line
-PyCode_New
-PyCode_Type
-PyComplex_AsCComplex
-PyComplex_FromCComplex
-PyComplex_FromDoubles
-PyComplex_ImagAsDouble
-PyComplex_RealAsDouble
-PyComplex_Type
-PyDict_Clear
-PyDict_DelItem
-PyDict_DelItemString
-PyDict_GetItem
-PyDict_GetItemString
-PyDict_Items
-PyDict_Keys
-PyDict_New
-PyDict_Next
-PyDict_SetItem
-PyDict_SetItemString
-PyDict_Size
-PyDict_Type
-PyDict_Values
-PyErr_BadArgument
-PyErr_BadInternalCall
-PyErr_CheckSignals
-PyErr_Clear
-PyErr_Fetch
-PyErr_Format
-PyErr_NoMemory
-PyErr_Occurred
-PyErr_Print
-PyErr_Restore
-PyErr_SetFromErrno
-PyErr_SetInterrupt
-PyErr_SetNone
-PyErr_SetObject
-PyErr_SetString
-PyEval_CallFunction
-PyEval_CallMethod
-PyEval_CallObject
-PyEval_CallObjectWithKeywords
-PyEval_EvalCode
-PyEval_GetBuiltins
-PyEval_GetFrame
-PyEval_GetGlobals
-PyEval_GetLocals
-PyEval_GetRestricted
-PyEval_RestoreThread
-PyEval_SaveThread
-PyExc_AccessError
-PyExc_AssertionError
-PyExc_AttributeError
-PyExc_EOFError
-PyExc_FloatingPointError
-PyExc_IOError
-PyExc_ImportError
-PyExc_IndexError
-PyExc_KeyError
-PyExc_KeyboardInterrupt
-PyExc_MemoryError
-PyExc_NameError
-PyExc_OverflowError
-PyExc_RuntimeError
-PyExc_SyntaxError
-PyExc_SystemError
-PyExc_SystemExit
-PyExc_TypeError
-PyExc_ValueError
-PyExc_ZeroDivisionError
-PyFile_AsFile
-PyFile_FromFile
-PyFile_FromString
-PyFile_GetLine
-PyFile_Name
-PyFile_SetBufSize
-PyFile_SoftSpace
-PyFile_Type
-PyFile_WriteObject
-PyFile_WriteString
-PyFloat_AsDouble
-PyFloat_AsString
-PyFloat_FromDouble
-PyFloat_Type
-PyFrame_BlockPop
-PyFrame_BlockSetup
-PyFrame_FastToLocals
-PyFrame_LocalsToFast
-PyFrame_New
-PyFrame_Type
-PyFunction_GetCode
-PyFunction_GetDefaults
-PyFunction_GetGlobals
-PyFunction_New
-PyFunction_SetDefaults
-PyFunction_Type
-PyGrammar_AddAccelerators
-PyGrammar_FindDFA
-PyGrammar_LabelRepr
-PyImport_AddModule
-PyImport_Cleanup
-PyImport_ExecCodeModule
-PyImport_FrozenModules
-PyImport_GetMagicNumber
-PyImport_GetModuleDict
-PyImport_ImportFrozenModule
-PyImport_ImportModule
-PyImport_Init
-PyImport_ReloadModule
-PyInstance_DoBinOp
-PyInstance_New
-PyInstance_Type
-PyInt_AsLong
-PyInt_FromLong
-PyInt_GetMax
-PyInt_Type
-PyInterpreterState_Delete
-PyInterpreterState_New
-PyList_Append
-PyList_AsTuple
-PyList_GetItem
-PyList_GetSlice
-PyList_Insert
-PyList_New
-PyList_Reverse
-PyList_SetItem
-PyList_SetSlice
-PyList_Size
-PyList_Sort
-PyList_Type
-PyLong_AsDouble
-PyLong_AsLong
-PyLong_AsUnsignedLong
-PyLong_FromDouble
-PyLong_FromLong
-PyLong_FromString
-PyLong_FromUnsignedLong
-PyLong_Type
-PyMapping_Check
-PyMapping_GetItemString
-PyMapping_HasKey
-PyMapping_HasKeyString
-PyMapping_Length
-PyMapping_SetItemString
-PyMarshal_Init
-PyMarshal_ReadLongFromFile
-PyMarshal_ReadObjectFromFile
-PyMarshal_ReadObjectFromString
-PyMarshal_WriteLongToFile
-PyMarshal_WriteObjectToFile
-PyMarshal_WriteObjectToString
-PyMember_Get
-PyMember_Set
-PyMethod_Class
-PyMethod_Function
-PyMethod_New
-PyMethod_Self
-PyMethod_Type
-PyModule_GetDict
-PyModule_GetName
-PyModule_New
-PyModule_Type
-PyNode_AddChild
-PyNode_Compile
-PyNode_Free
-PyNode_New
-PyNumber_Absolute
-PyNumber_Add
-PyNumber_And
-PyNumber_Check
-PyNumber_Coerce
-PyNumber_Divide
-PyNumber_Divmod
-PyNumber_Float
-PyNumber_Int
-PyNumber_Invert
-PyNumber_Long
-PyNumber_Lshift
-PyNumber_Multiply
-PyNumber_Negative
-PyNumber_Or
-PyNumber_Positive
-PyNumber_Power
-PyNumber_Remainder
-PyNumber_Rshift
-PyNumber_Subtract
-PyNumber_Xor
-PyOS_GetLastModificationTime
-PyOS_GnuReadline
-PyOS_InitInterrupts
-PyOS_InterruptOccurred
-PyOS_Readline
-PyOS_ReadlineFunctionPointer
-PyOS_ReadlineInit
-PyOS_StdioReadline
-PyOS_strtol
-PyOS_strtoul
-PyObject_CallFunction
-PyObject_CallMethod
-PyObject_CallObject
-PyObject_Cmp
-PyObject_Compare
-PyObject_DelItem
-PyObject_GetAttr
-PyObject_GetAttrString
-PyObject_GetItem
-PyObject_HasAttrString
-PyObject_Hash
-PyObject_IsTrue
-PyObject_Length
-PyObject_Print
-PyObject_Repr
-PyObject_SetAttr
-PyObject_SetAttrString
-PyObject_SetItem
-PyObject_Str
-PyObject_Type
-PyParser_AddToken
-PyParser_Delete
-PyParser_New
-PyParser_ParseFile
-PyParser_ParseString
-PyParser_SimpleParseFile
-PyParser_SimpleParseString
-PyRange_New
-PyRange_Type
-PyRun_AnyFile
-PyRun_File
-PyRun_InteractiveLoop
-PyRun_InteractiveOne
-PyRun_SimpleFile
-PyRun_SimpleString
-PyRun_String
-PySequence_Check
-PySequence_Concat
-PySequence_Count
-PySequence_DelItem
-PySequence_DelSlice
-PySequence_GetItem
-PySequence_GetSlice
-PySequence_In
-PySequence_Index
-PySequence_Length
-PySequence_List
-PySequence_Repeat
-PySequence_SetItem
-PySequence_SetSlice
-PySequence_Tuple
-PySlice_GetIndices
-PySlice_New
-PySlice_Type
-PyString_AsString
-PyString_Concat
-PyString_ConcatAndDel
-PyString_Format
-PyString_FromString
-PyString_FromStringAndSize
-PyString_InternFromString
-PyString_InternInPlace
-PyString_Size
-PyString_Type
-PySys_GetFile
-PySys_GetObject
-PySys_Init
-PySys_SetArgv
-PySys_SetObject
-PySys_SetPath
-PyThreadState_Delete
-PyThreadState_Get
-PyThreadState_New
-PyThreadState_Swap
-PyToken_OneChar
-PyToken_TwoChars
-PyTokenizer_Free
-PyTokenizer_FromFile
-PyTokenizer_FromString
-PyTokenizer_Get
-PyTraceBack_Here
-PyTraceBack_Print
-PyTraceBack_Type
-PyTuple_GetItem
-PyTuple_GetSlice
-PyTuple_New
-PyTuple_SetItem
-PyTuple_Size
-PyTuple_Type
-PyType_Type
-Py_AddPendingCall
-Py_AtExit
-Py_BuildValue
-Py_Cleanup
-Py_CompileString
-Py_DebugFlag
-Py_Exit
-Py_FatalError
-Py_FdIsInteractive
-Py_FindMethod
-Py_FindMethodInChain
-Py_FlushLine
-Py_GetArgcArgv
-Py_GetBuildInfo
-Py_GetCompiler
-Py_GetCopyright
-Py_GetExecPrefix
-Py_GetPath
-Py_GetPlatform
-Py_GetPrefix
-Py_GetProgramName
-Py_GetVersion
-Py_InitModule4
-Py_Initialize
-Py_InteractiveFlag
-Py_MakePendingCalls
-Py_OptimizeFlag
-Py_Setup
-Py_SuppressPrintingFlag
-Py_VaBuildValue
-Py_VerboseFlag
-_PyImport_Filetab
-_PyImport_Inittab
-_PyImport_LoadDynamicModule
-_PyImport_MaxSuffixSize
-_PyImport_Modules
-_PyLong_New
-_PyObject_New
-_PyObject_NewVar
-_PyParser_Grammar
-_PyParser_TokenNames
-_PyString_Resize
-_PyTuple_Resize
-_Py_EllipsisObject
-_Py_MD5Final
-_Py_MD5Init
-_Py_MD5Update
-_Py_NoneStruct
-_Py_TrueStruct
-_Py_ZeroStruct
-_Py_abstract_hack
-_Py_c_diff
-_Py_c_neg
-_Py_c_pow
-_Py_c_prod
-_Py_c_quot
-_Py_c_sum
-_Py_cobject_hack
-_Py_re_compile_fastmap
-_Py_re_compile_pattern
-_Py_re_match
-_Py_re_search
-_Py_re_set_syntax
-_Py_re_syntax
-initarray
-initaudioop
-initbinascii
-initcmath
-initcrypt
-initerrno
-initfcntl
-initgrp
-initimageop
-initimp
-initmath
-initmd5
-initoperator
-initparser
-initposix
-initpwd
-initregex
-initrgbimg
-initrotor
-initselect
-initsignal
-initsocket
-initstrop
-initstruct
-inittime
-main
diff --git a/configure.in b/configure.in
index ba17455..21ac890 100644
--- a/configure.in
+++ b/configure.in
@@ -81,6 +81,21 @@
fi
AC_PROG_CC
+
+# LINKCC is the command that links the python executable -- default is $(CC).
+# This is altered for AIX in order to build the export list before linking.
+AC_SUBST(LINKCC)
+AC_MSG_CHECKING(LINKCC)
+if test -z "$LINKCC"
+then
+ case $ac_sys_system in
+ AIX*)
+ LINKCC="makexp_aix python.exp \"\" \$(MYLIBS) \$(ADDOBJS); \$(CC)";;
+ *) LINKCC="\$(CC)";;
+ esac
+fi
+AC_MSG_RESULT($LINKCC)
+
AC_PROG_RANLIB
AC_SUBST(AR)
AC_CHECK_PROGS(AR, ar aal, ar)