summaryrefslogtreecommitdiffstats
path: root/package/python/0013-sqlite3-fix-build-when-threads-are-not-used-availabl.patch
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2017-03-08 00:00:26 +0100
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2017-03-09 22:35:21 +0100
commit652076293235276e2f978fe377322a6cbd615455 (patch)
tree9de85c8771bbff3dc8dee18aa23e38b29c3cfa90 /package/python/0013-sqlite3-fix-build-when-threads-are-not-used-availabl.patch
parent98b831b855559ba2bc3fcdccf9c29c4936008d12 (diff)
downloadbuildroot-652076293235276e2f978fe377322a6cbd615455.tar.gz
buildroot-652076293235276e2f978fe377322a6cbd615455.zip
python: move to Git formatted patches
Now that the cpython project has a nice Github repository, with tags, it's much nicer to handle the stack of Python patches with Git. The python3 package patches had already been converted, but not the python package patches. Therefore, this commit does the move. There is no functional change, only reformatting of the patches. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Reviewed-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/python/0013-sqlite3-fix-build-when-threads-are-not-used-availabl.patch')
-rw-r--r--package/python/0013-sqlite3-fix-build-when-threads-are-not-used-availabl.patch58
1 files changed, 58 insertions, 0 deletions
diff --git a/package/python/0013-sqlite3-fix-build-when-threads-are-not-used-availabl.patch b/package/python/0013-sqlite3-fix-build-when-threads-are-not-used-availabl.patch
new file mode 100644
index 0000000000..dfc11efc7e
--- /dev/null
+++ b/package/python/0013-sqlite3-fix-build-when-threads-are-not-used-availabl.patch
@@ -0,0 +1,58 @@
+From 0f0be88526ece7d2f6ee21c1f59b1546ec6dc7c0 Mon Sep 17 00:00:00 2001
+From: "Yann E. MORIN" <yann.morin.1998@free.fr>
+Date: Tue, 7 Mar 2017 22:25:14 +0100
+Subject: [PATCH] sqlite3: fix build when threads are not used/available
+
+When threads are not used/available, a function in the sqlite3 extension
+ends up with a label at the end:
+
+ void _pysqlite_final_callback(sqlite3_context* context)
+ {
+ PyObject* function_result;
+ PyObject** aggregate_instance;
+ int ok;
+
+ #ifdef WITH_THREAD
+ PyGILState_STATE threadstate;
+
+ threadstate = PyGILState_Ensure();
+ #endif
+
+ aggregate_instance = (PyObject**)sqlite3_aggregate_context(context, sizeof(PyObject*));
+ if (!*aggregate_instance) {
+ goto error;
+ }
+
+ [......]
+
+ error:
+ #ifdef WITH_THREAD
+ PyGILState_Release(threadstate);
+ #endif
+ }
+
+This is not valid, and gcc complains.
+
+Fix that by adding a dummy statement after the label, so that the label
+is never the last statement of the function.
+
+Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
+---
+ Modules/_sqlite/connection.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
+index 237d6e4..cdf69ab 100644
+--- a/Modules/_sqlite/connection.c
++++ b/Modules/_sqlite/connection.c
+@@ -794,6 +794,7 @@ error:
+ #ifdef WITH_THREAD
+ PyGILState_Release(threadstate);
+ #endif
++ ; /* Make gcc happy: a label can't be at the end of a function */
+ }
+
+ static void _pysqlite_drop_unused_statement_references(pysqlite_Connection* self)
+--
+2.7.4
+
OpenPOWER on IntegriCloud