changeset: 92197:599dc1304a70 parent: 92194:0c2792a8f9db parent: 92196:e52d85f2e284 user: Ned Deily date: Fri Aug 22 13:36:30 2014 -0700 files: Makefile.pre.in Misc/NEWS configure configure.ac description: Issue #21166: merge from 3.4 diff -r 0c2792a8f9db -r 599dc1304a70 Makefile.pre.in --- a/Makefile.pre.in Fri Aug 22 14:23:20 2014 -0400 +++ b/Makefile.pre.in Fri Aug 22 13:36:30 2014 -0700 @@ -553,8 +553,18 @@ # Create build directory and generate the sysconfig build-time data there. # pybuilddir.txt contains the name of the build dir and is used for # sys.path fixup -- see Modules/getpath.c. +# Since this step runs before shared modules are built, try to avoid bootstrap +# problems by creating a dummy pybuildstr.txt just to allow interpreter +# initialization to succeed. It will be overwritten by generate-posix-vars +# or removed in case of failure. pybuilddir.txt: $(BUILDPYTHON) - $(RUNSHARED) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars + @echo "none" > ./pybuilddir.txt + $(RUNSHARED) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars ;\ + if test $$? -ne 0 ; then \ + echo "generate-posix-vars failed" ; \ + rm -f ./pybuilddir.txt ; \ + exit 1 ; \ + fi # Build the shared modules # Under GNU make, MAKEFLAGS are sorted and normalized; the 's' for diff -r 0c2792a8f9db -r 599dc1304a70 Misc/NEWS --- a/Misc/NEWS Fri Aug 22 14:23:20 2014 -0400 +++ b/Misc/NEWS Fri Aug 22 13:36:30 2014 -0700 @@ -825,6 +825,9 @@ - Issue #21811: Anticipated fixes to support OS X versions > 10.9. +- Issue #21166: Prevent possible segfaults and other random failures of + python --generate-posix-vars in pybuilddir.txt build target. + C API ----- diff -r 0c2792a8f9db -r 599dc1304a70 configure --- a/configure Fri Aug 22 14:23:20 2014 -0400 +++ b/configure Fri Aug 22 13:36:30 2014 -0700 @@ -2954,6 +2954,9 @@ +# pybuilddir.txt will be created by --generate-posix-vars in the Makefile +rm -f pybuilddir.txt + if test "$cross_compiling" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python interpreter for cross build" >&5 $as_echo_n "checking for python interpreter for cross build... " >&6; } diff -r 0c2792a8f9db -r 599dc1304a70 configure.ac --- a/configure.ac Fri Aug 22 14:23:20 2014 -0400 +++ b/configure.ac Fri Aug 22 13:36:30 2014 -0700 @@ -53,6 +53,9 @@ AC_SUBST(build) AC_SUBST(host) +# pybuilddir.txt will be created by --generate-posix-vars in the Makefile +rm -f pybuilddir.txt + if test "$cross_compiling" = yes; then AC_MSG_CHECKING([for python interpreter for cross build]) if test -z "$PYTHON_FOR_BUILD"; then