diff -r 535b349ddc43 -r 099ca34d54ac Makefile.pre.in --- a/Makefile.pre.in Tue Jun 03 15:54:34 2014 +0200 +++ b/Makefile.pre.in Tue Jun 03 15:59:01 2014 +0200 @@ -131,6 +131,8 @@ BLDSHARED= @BLDSHARED@ $(PY_LDFLAGS) LDCXXSHARED= @LDCXXSHARED@ DESTSHARED= $(BINLIBDEST)/lib-dynload +# list of exported symbols for AIX +EXPORTSYMS= @EXPORTSYMS@ # Executable suffix (.exe on Windows and Mac OS X) EXE= @EXEEXT@ @@ -532,7 +534,7 @@ $(RUNSHARED) $(PYTHON_FOR_BUILD) ./Tools/clinic/clinic.py --make # Build the interpreter -$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) +$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) $(EXPORTSYMS) $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Modules/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) platform: $(BUILDPYTHON) pybuilddir.txt @@ -587,6 +589,10 @@ libpython$(VERSION).sl: $(LIBRARY_OBJS) $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST) +# list of exported symbols for AIX +Modules/python.exp: $(LIBRARY) + $(srcdir)/Modules/makexp_aix $@ . $? + # Copy up the gdb python hooks into a position where they can be automatically # loaded by gdb during Lib/test/test_gdb.py # @@ -658,7 +664,7 @@ echo "-----------------------------------------------"; \ fi -Modules/_testembed: Modules/_testembed.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) +Modules/_testembed: Modules/_testembed.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) $(EXPORTSYMS) $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Modules/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) ############################################################################ diff -r 535b349ddc43 -r 099ca34d54ac configure --- a/configure Tue Jun 03 15:54:34 2014 +0200 +++ b/configure Tue Jun 03 15:59:01 2014 +0200 @@ -680,6 +680,7 @@ RANLIB USE_INLINE GNULD +EXPORTSYMS LINKCC LDVERSION RUNSHARED @@ -5444,8 +5445,6 @@ # If CXX is set, and if it is needed to link a main function that was # compiled with CXX, LINKCC is CXX instead. Always using CXX is undesirable: # python might then depend on the C++ runtime -# This is altered for AIX in order to build the export list before -# linking. { $as_echo "$as_me:${as_lineno-$LINENO}: checking LINKCC" >&5 $as_echo_n "checking LINKCC... " >&6; } @@ -5453,13 +5452,6 @@ then LINKCC='$(PURIFY) $(MAINCC)' case $ac_sys_system in - AIX*) - exp_extra="\"\"" - if test $ac_sys_release -ge 5 -o \ - $ac_sys_release -eq 4 -a `uname -r` -ge 2 ; then - exp_extra="." - fi - LINKCC="\$(srcdir)/Modules/makexp_aix Modules/python.exp $exp_extra \$(LIBRARY); $LINKCC";; QNX*) # qcc must be used because the other compilers do not # support -N. @@ -5469,6 +5461,22 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINKCC" >&5 $as_echo "$LINKCC" >&6; } +# EXPORTSYMS holds the list of exported symbols for AIX. + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking EXPORTSYMS" >&5 +$as_echo_n "checking EXPORTSYMS... " >&6; } +case $ac_sys_system in +AIX*) + if test -z "$EXPORTSYMS"; then + EXPORTSYMS="Modules/python.exp" + fi + ;; +*) + EXPORTSYMS= ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $EXPORTSYMS" >&5 +$as_echo "$EXPORTSYMS" >&6; } + # GNULD is set to "yes" if the GNU linker is used. If this goes wrong # make sure we default having it set to "no": this is used by # distutils.unixccompiler to know if it should add --enable-new-dtags @@ -8655,6 +8663,7 @@ $as_echo "$CCSHARED" >&6; } # LINKFORSHARED are the flags passed to the $(CC) command that links # the python executable -- this is only needed for a few systems +# Make-targets using $(LINKFORSHARED) need to depend on $(EXPORTSYMS) for AIX. { $as_echo "$as_me:${as_lineno-$LINENO}: checking LINKFORSHARED" >&5 $as_echo_n "checking LINKFORSHARED... " >&6; } if test -z "$LINKFORSHARED" diff -r 535b349ddc43 -r 099ca34d54ac configure.ac --- a/configure.ac Tue Jun 03 15:54:34 2014 +0200 +++ b/configure.ac Tue Jun 03 15:59:01 2014 +0200 @@ -833,21 +833,12 @@ # If CXX is set, and if it is needed to link a main function that was # compiled with CXX, LINKCC is CXX instead. Always using CXX is undesirable: # python might then depend on the C++ runtime -# 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 LINKCC='$(PURIFY) $(MAINCC)' case $ac_sys_system in - AIX*) - exp_extra="\"\"" - if test $ac_sys_release -ge 5 -o \ - $ac_sys_release -eq 4 -a `uname -r` -ge 2 ; then - exp_extra="." - fi - LINKCC="\$(srcdir)/Modules/makexp_aix Modules/python.exp $exp_extra \$(LIBRARY); $LINKCC";; QNX*) # qcc must be used because the other compilers do not # support -N. @@ -856,6 +847,20 @@ fi AC_MSG_RESULT($LINKCC) +# EXPORTSYMS holds the list of exported symbols for AIX. +AC_SUBST(EXPORTSYMS) +AC_MSG_CHECKING(EXPORTSYMS) +case $ac_sys_system in +AIX*) + if test -z "$EXPORTSYMS"; then + EXPORTSYMS="Modules/python.exp" + fi + ;; +*) + EXPORTSYMS= ;; +esac +AC_MSG_RESULT($EXPORTSYMS) + # GNULD is set to "yes" if the GNU linker is used. If this goes wrong # make sure we default having it set to "no": this is used by # distutils.unixccompiler to know if it should add --enable-new-dtags @@ -2129,6 +2134,7 @@ AC_MSG_RESULT($CCSHARED) # LINKFORSHARED are the flags passed to the $(CC) command that links # the python executable -- this is only needed for a few systems +# Make-targets using $(LINKFORSHARED) need to depend on $(EXPORTSYMS) for AIX. AC_MSG_CHECKING(LINKFORSHARED) if test -z "$LINKFORSHARED" then