summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerito12019-09-18 01:29:21 -0300
committerGerito12019-09-18 01:29:21 -0300
commit5657df9b07f1df4fbbf6c6d7abdd0445aeddd8d1 (patch)
tree7642c1c740555efbc0ea1e016101b91f8f8c7940
parentcf17355c8233dc50f95f9893a7b6f38841fe7e17 (diff)
downloadaur-5657df9b07f1df4fbbf6c6d7abdd0445aeddd8d1.tar.gz
Fix build error _PyImport_FixupBuiltin
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD2
-rw-r--r--gdb.patch68
3 files changed, 69 insertions, 7 deletions
diff --git a/.SRCINFO b/.SRCINFO
index b960c7cb27b4..9be43db7921b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = mips-harvard-os161-gdb
pkgdesc = The GNU Debugger modified for mips-harvard-os161 arquitecture. This is part of toolset for the course os161 from Harvard.
pkgver = 7.8+os161_2.1
- pkgrel = 2
+ pkgrel = 3
url = http://os161.eecs.harvard.edu/
arch = i686
arch = x86_64
@@ -14,7 +14,7 @@ pkgbase = mips-harvard-os161-gdb
depends = gmp
depends = mpfr
depends = libmpc
- depends = guile2.0
+ depends = guile2.0
options = staticlibs
options = !libtool
options = !emptydirs
@@ -22,7 +22,9 @@ pkgbase = mips-harvard-os161-gdb
options = zipman
options = docs
source = http://os161.eecs.harvard.edu/download/gdb-7.8+os161-2.1.tar.gz
+ source = gdb.patch
md5sums = 26295f3f67090e534e3d488a3edce5ae
+ md5sums = SKIP
pkgname = mips-harvard-os161-gdb
diff --git a/PKGBUILD b/PKGBUILD
index 84a07b278c1a..af4218206759 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@ _target="mips-harvard-os161"
pkgname=${_target}-gdb
_pkgver=7.8+os161-2.1
pkgver=${_pkgver/os161-/os161_}
-pkgrel=2
+pkgrel=3
pkgdesc="The GNU Debugger modified for ${_target} arquitecture. This is part of toolset for the course os161 from Harvard."
arch=(i686 x86_64)
url="http://os161.eecs.harvard.edu/"
diff --git a/gdb.patch b/gdb.patch
index 10ac97d9f571..89064e17731b 100644
--- a/gdb.patch
+++ b/gdb.patch
@@ -1,6 +1,66 @@
+diff -rup gdb-7.8+os161-2.1/gdb/python/python.c gdb-7.8+os161-2.1-new/gdb/python/python.c
+--- gdb-7.8+os161-2.1/gdb/python/python.c 2014-09-30 23:00:34.000000000 -0300
++++ gdb-7.8+os161-2.1-new/gdb/python/python.c 2019-09-17 22:09:14.270409170 -0300
+@@ -108,7 +108,7 @@ int gdb_python_initialized;
+ static PyMethodDef GdbMethods[];
+
+ #ifdef IS_PY3K
+-static struct PyModuleDef GdbModuleDef;
++extern struct PyModuleDef GdbModuleDef;
+ #endif
+
+ PyObject *gdb_module;
+@@ -1556,6 +1556,17 @@ finalize_python (void *ignore)
+ }
+ #endif
+
++#ifdef IS_PY3K
++/* This is called via the PyImport_AppendInittab mechanism called
++ during initialization, to make the built-in _gdb module known to
++ Python. */
++PyMODINIT_FUNC
++init__gdb_module (void)
++{
++ return PyModule_Create (&GdbModuleDef);
++}
++#endif
++
+ /* Provide a prototype to silence -Wmissing-prototypes. */
+ extern initialize_file_ftype _initialize_python;
+
+@@ -1677,6 +1688,9 @@ message == an error message without a st
+ remain alive for the duration of the program's execution, so
+ it is not freed after this call. */
+ Py_SetProgramName (progname_copy);
++
++ /* Define _gdb as a built-in module. */
++ PyImport_AppendInittab ("_gdb", init__gdb_module);
+ #else
+ Py_SetProgramName (progname);
+ #endif
+@@ -1686,9 +1700,7 @@ message == an error message without a st
+ PyEval_InitThreads ();
+
+ #ifdef IS_PY3K
+- gdb_module = PyModule_Create (&GdbModuleDef);
+- /* Add _gdb module to the list of known built-in modules. */
+- _PyImport_FixupBuiltin (gdb_module, "_gdb");
++ gdb_module = PyImport_ImportModule ("_gdb");
+ #else
+ gdb_module = Py_InitModule ("_gdb", GdbMethods);
+ #endif
+@@ -2005,7 +2017,7 @@ Return a tuple containing all inferiors.
+ };
+
+ #ifdef IS_PY3K
+-static struct PyModuleDef GdbModuleDef =
++extern struct PyModuleDef GdbModuleDef =
+ {
+ PyModuleDef_HEAD_INIT,
+ "_gdb",
diff -rup gdb-7.8+os161-2.1/sim/common/sim-arange.c gdb-7.8+os161-2.1-new/sim/common/sim-arange.c
---- gdb-7.8+os161-2.1/sim/common/sim-arange.c 2017-07-29 07:10:29.906548572 +0000
-+++ gdb-7.8+os161-2.1-new/sim/common/sim-arange.c 2017-07-29 07:11:59.793216829 +0000
+--- gdb-7.8+os161-2.1/sim/common/sim-arange.c 2014-09-30 23:01:49.000000000 -0300
++++ gdb-7.8+os161-2.1-new/sim/common/sim-arange.c 2019-09-17 21:43:20.400500779 -0300
@@ -280,11 +280,7 @@ sim_addr_range_delete (ADDR_RANGE *ar, a
build_search_tree (ar);
}
@@ -21,8 +81,8 @@ diff -rup gdb-7.8+os161-2.1/sim/common/sim-arange.c gdb-7.8+os161-2.1-new/sim/co
-#endif /* DEFINE_INLINE_P */
+#endif /* DEFINE_NON_INLINE_P */
diff -rup gdb-7.8+os161-2.1/sim/common/sim-arange.h gdb-7.8+os161-2.1-new/sim/common/sim-arange.h
---- gdb-7.8+os161-2.1/sim/common/sim-arange.h 2017-07-29 06:53:05.909863433 +0000
-+++ gdb-7.8+os161-2.1-new/sim/common/sim-arange.h 2017-07-29 06:56:21.329866890 +0000
+--- gdb-7.8+os161-2.1/sim/common/sim-arange.h 2014-09-30 23:01:49.000000000 -0300
++++ gdb-7.8+os161-2.1-new/sim/common/sim-arange.h 2019-09-17 21:43:20.400500779 -0300
@@ -62,7 +62,7 @@ extern void sim_addr_range_delete (ADDR_
/* Return non-zero if ADDR is in range AR, traversing the entire tree.