commit 2d5f84057e222f2d91e2fa4fec29e59b86b517e5 Author: Eric N. Vander Weele Date: Sun Nov 27 09:20:32 2016 -0500 Fix parallel build on AIX with Modules/python.exp * Modules/python.exp becomes a separate make-target * EXPORTSYMS configure variable holds its name on AIX, empty otherways * LINKCC does not create it itself any more * any make-target using $(LINKFORSHARED) must depend on $(EXPORTSYMS) * Dropping support for AIX 4.1 and earlier. Reported-by: Issue 19521 Based-on-patch-by: Michael Haubenwallner Signed-off-by: Eric N. Vander Weele diff --git a/Makefile.pre.in b/Makefile.pre.in index 180cbac..0433bdc 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -147,6 +147,8 @@ LDSHARED= @LDSHARED@ $(PY_LDFLAGS) 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@ @@ -564,7 +566,7 @@ clinic: $(BUILDPYTHON) $(srcdir)/Modules/_blake2/blake2s_impl.c $(RUNSHARED) $(PYTHON_FOR_BUILD) ./Tools/clinic/clinic.py --make # Build the interpreter -$(BUILDPYTHON): Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) +$(BUILDPYTHON): Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) $(EXPORTSYMS) $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) platform: $(BUILDPYTHON) pybuilddir.txt @@ -639,6 +641,10 @@ libpython$(LDVERSION).dylib: $(LIBRARY_OBJS) 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 # @@ -710,7 +716,7 @@ Modules/Setup: $(srcdir)/Modules/Setup.dist echo "-----------------------------------------------"; \ fi -Programs/_testembed: Programs/_testembed.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) +Programs/_testembed: Programs/_testembed.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) $(EXPORTSYMS) $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) ############################################################################ diff --git a/configure b/configure index 4e0a212..55cf860 100755 --- a/configure +++ b/configure @@ -697,6 +697,7 @@ AR RANLIB USE_INLINE GNULD +EXPORTSYMS LINKCC LDVERSION RUNSHARED @@ -784,7 +785,6 @@ infodir docdir oldincludedir includedir -runstatedir localstatedir sharedstatedir sysconfdir @@ -895,7 +895,6 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1148,15 +1147,6 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; - -runstatedir | --runstatedir | --runstatedi | --runstated \ - | --runstate | --runstat | --runsta | --runst | --runs \ - | --run | --ru | --r) - ac_prev=runstatedir ;; - -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ - | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ - | --run=* | --ru=* | --r=*) - runstatedir=$ac_optarg ;; - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1294,7 +1284,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir runstatedir + libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1447,7 +1437,6 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -5810,13 +5799,6 @@ 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. @@ -5826,6 +5808,20 @@ fi { $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 + ;; +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 @@ -9338,6 +9334,7 @@ fi $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" @@ -17139,7 +17136,7 @@ python config.status 3.7 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." diff --git a/configure.ac b/configure.ac index 33a9d56..3ccf55f 100644 --- a/configure.ac +++ b/configure.ac @@ -1054,13 +1054,6 @@ 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. @@ -1069,6 +1062,18 @@ then 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 + ;; +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 @@ -2579,6 +2584,7 @@ fi 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