[python26/el5/master] Add Patch: Python-2.6.5-parallel_build.patch

derks derks at fedoraproject.org
Mon Feb 28 18:17:54 UTC 2011


commit 844178c55a91666d4fb755b850a0b8d3d4a78f39
Author: BJ Dierkes <wdierkes at 5dollarwhitebox.org>
Date:   Mon Feb 21 13:03:12 2011 -0600

    Add Patch: Python-2.6.5-parallel_build.patch

 Python-2.6.5-parallel_build.patch |   42 +++++++++++++++++++++++++++++++++++++
 python26.spec                     |    9 +++++++-
 2 files changed, 50 insertions(+), 1 deletions(-)
---
diff --git a/Python-2.6.5-parallel_build.patch b/Python-2.6.5-parallel_build.patch
new file mode 100644
index 0000000..ddb97ae
--- /dev/null
+++ b/Python-2.6.5-parallel_build.patch
@@ -0,0 +1,42 @@
+
+Resolves http://bugs.python.org/issue10013
+
+Title: fix `./libpython2.6.so: undefined reference to `_PyParser_Grammar` in 
+parallel builds
+
+--- Python-2.6.5/Makefile.pre.in.parallel_bug	2011-02-21 11:46:52.794223000 -0600
++++ Python-2.6.5/Makefile.pre.in	2011-02-21 12:53:41.140881402 -0600
+@@ -197,6 +197,7 @@
+ 
+ ##########################################################################
+ # Grammar
++GRAMMAR_STAMP=	$(srcdir)/grammar-stamp
+ GRAMMAR_H=	$(srcdir)/Include/graminit.h
+ GRAMMAR_C=	$(srcdir)/Python/graminit.c
+ GRAMMAR_INPUT=	$(srcdir)/Grammar/Grammar
+@@ -503,9 +504,24 @@
+ 	$(MAINCC) -c $(PY_CFLAGS) -o $@ $(srcdir)/Modules/python.c
+ 
+ 
+-$(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
++# GNU "make" interprets rules with two dependents as two copies of the rule.
++# 
++# In a parallel build this can lead to pgen being run twice, once for each of
++# GRAMMAR_H and GRAMMAR_C, leading to race conditions in which the compiler
++# reads a partially-overwritten copy of one of these files, leading to syntax
++# errors (or linker errors if the fragment happens to be syntactically valid C)
++#
++# See http://www.gnu.org/software/hello/manual/automake/Multiple-Outputs.html
++# for more information
++#
++# Introduce ".grammar-stamp" as a contrived single output from PGEN to avoid
++# this:
++$(GRAMMAR_H) $(GRAMMAR_C): $(GRAMMAR_STAMP)
++
++$(GRAMMAR_STAMP): $(PGEN) $(GRAMMAR_INPUT)
+ 		-@$(INSTALL) -d Include
+ 		-$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
++		touch $(GRAMMAR_STAMP)
+ 
+ $(PGEN):	$(PGENOBJS)
+ 		$(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
diff --git a/python26.spec b/python26.spec
index 658bae7..862ff0a 100644
--- a/python26.spec
+++ b/python26.spec
@@ -365,6 +365,11 @@ Patch117: python-2.6.2-CVE-2010-2089.patch
 # the old layout before the whitespeace cleanup of release26-maint in r81031):
 Patch118: python-2.6.2-CVE-2008-5983.patch
 
+# Resolves http://bugs.python.org/issue10013
+# Title: fix `./libpython2.6.so: undefined reference to `_PyParser_Grammar` in 
+# parallel builds
+Patch119: Python-2.6.5-parallel_build.patch
+
 # Patch up pyexpat.h so it will build against RHEL-5's pyexpat-devel:
 Patch200: python-2.6.4-expat-version.patch
 
@@ -584,6 +589,7 @@ rm -r Modules/zlib || exit 1
 %patch116 -p1 -b .CVE-2010-1634
 %patch117 -p1 -b .CVE-2010-2089
 %patch118 -p1 -b .CVE-2008-5983
+%patch119 -p1 -b .parallel_build
 
 %if 0%{?with_system_expat}
 %patch200 -p1 -b .expat-version
@@ -1010,7 +1016,6 @@ rm -fr %{buildroot}
 %{_bindir}/python%{pybasever}
 %{_mandir}/*/*
 %config(noreplace) %{_sysconfdir}/rpm/macros.python26
-/usr/lib/rpm/brp-multiple-python-bytecompile
 
 %dir %{pylibdir}
 %dir %{dynload_dir}
@@ -1215,6 +1220,8 @@ rm -fr %{buildroot}
 - Added brp-multiple-python-bytecompile
 - Added __multiple_python_os_install_post macro to macros.python26
 - Added --without tests option to make building without tests optional
+- Added Patch119: Python-2.6.5-parallel_build.patch.  Resolves Python 
+  bug #10013 http://bugs.python.org/issue10013
 
 * Fri Jun  4 2010 David Malcolm <dmalcolm at redhat.com> - 2.6.5-5
 - ensure that the compiler is invoked with "-fwrapv" (rhbz#594819)


More information about the scm-commits mailing list