* [patch] Fix build failures with python support on sparc-solaris
@ 2010-10-01 23:36 Joel Brobecker
2010-10-01 23:53 ` Michael Snyder
2010-10-26 18:08 ` [patch] Fix build failures with python support on sparc-solaris Joel Brobecker
0 siblings, 2 replies; 4+ messages in thread
From: Joel Brobecker @ 2010-10-01 23:36 UTC (permalink / raw)
To: gdb-patches; +Cc: Joel Brobecker
Hello,
This is something that I'd like to commit in a few days, bearing
suggestions.
There were two types of errors, mostly compiler warnings:
1. _FILE_OFFSET_BITS being redefined in pyconfig.h;
This is a problem we're familiar with, having seen similar
issues on GNU/Linux systems. I used a similar solution.
2. GCC 4.5 complains that calls to PyEval_InitThreads and
PyEval_ReleaseLock have no effect. This is because our Python
is built without thread support, leading us to use the dummy
#define in python-internal.h which just gets replaced by `0'.
Since this function returns void (checked versions 2.4 and 2.7),
I simply removed the 0.
gdb/ChangeLog:
python/python-internal.h (_FILE_OFFSET_BITS): Undefine.
(PyEval_InitThreads): Remove duplicate. Define as nothing.
(PyEval_ReleaseLock): Define as nothing.
Tested on x86_64-linux.
---
gdb/python/python-internal.h | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h
index c5d1e73..97ac2fd 100644
--- a/gdb/python/python-internal.h
+++ b/gdb/python/python-internal.h
@@ -36,6 +36,11 @@
#undef _POSIX_C_SOURCE
#undef _XOPEN_SOURCE
+/* On sparc-solaris, /usr/include/sys/feature_tests.h defines
+ _FILE_OFFSET_BITS, which pyconfig.h also defines. Same work
+ arount technique as above. */
+#undef _FILE_OFFSET_BITS
+
#if HAVE_LIBPYTHON2_4
#include "python2.4/Python.h"
#include "python2.4/frameobject.h"
@@ -63,10 +68,9 @@ typedef int Py_ssize_t;
#ifndef WITH_THREAD
#define PyGILState_Ensure() ((PyGILState_STATE) 0)
#define PyGILState_Release(ARG) ((void)(ARG))
-#define PyEval_InitThreads() 0
+#define PyEval_InitThreads()
#define PyThreadState_Swap(ARG) ((void)(ARG))
-#define PyEval_InitThreads() 0
-#define PyEval_ReleaseLock() 0
+#define PyEval_ReleaseLock()
#endif
/* In order to be able to parse symtab_and_line_to_sal_object function
--
1.7.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch] Fix build failures with python support on sparc-solaris
2010-10-01 23:36 [patch] Fix build failures with python support on sparc-solaris Joel Brobecker
@ 2010-10-01 23:53 ` Michael Snyder
2010-10-26 18:09 ` [commit] fix typo in _FILE_OFFSET_BITS comment Joel Brobecker
2010-10-26 18:08 ` [patch] Fix build failures with python support on sparc-solaris Joel Brobecker
1 sibling, 1 reply; 4+ messages in thread
From: Michael Snyder @ 2010-10-01 23:53 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches
Joel Brobecker wrote:
> Hello,
>
> This is something that I'd like to commit in a few days, bearing
> suggestions.
>
> There were two types of errors, mostly compiler warnings:
>
> 1. _FILE_OFFSET_BITS being redefined in pyconfig.h;
> This is a problem we're familiar with, having seen similar
> issues on GNU/Linux systems. I used a similar solution.
>
> 2. GCC 4.5 complains that calls to PyEval_InitThreads and
> PyEval_ReleaseLock have no effect. This is because our Python
> is built without thread support, leading us to use the dummy
> #define in python-internal.h which just gets replaced by `0'.
> Since this function returns void (checked versions 2.4 and 2.7),
> I simply removed the 0.
>
> gdb/ChangeLog:
>
> python/python-internal.h (_FILE_OFFSET_BITS): Undefine.
> (PyEval_InitThreads): Remove duplicate. Define as nothing.
> (PyEval_ReleaseLock): Define as nothing.
>
> Tested on x86_64-linux.
>
> ---
> gdb/python/python-internal.h | 10 +++++++---
> 1 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h
> index c5d1e73..97ac2fd 100644
> --- a/gdb/python/python-internal.h
> +++ b/gdb/python/python-internal.h
> @@ -36,6 +36,11 @@
> #undef _POSIX_C_SOURCE
> #undef _XOPEN_SOURCE
>
> +/* On sparc-solaris, /usr/include/sys/feature_tests.h defines
> + _FILE_OFFSET_BITS, which pyconfig.h also defines. Same work
> + arount technique as above. */
"around".
> +#undef _FILE_OFFSET_BITS
> +
> #if HAVE_LIBPYTHON2_4
> #include "python2.4/Python.h"
> #include "python2.4/frameobject.h"
> @@ -63,10 +68,9 @@ typedef int Py_ssize_t;
> #ifndef WITH_THREAD
> #define PyGILState_Ensure() ((PyGILState_STATE) 0)
> #define PyGILState_Release(ARG) ((void)(ARG))
> -#define PyEval_InitThreads() 0
> +#define PyEval_InitThreads()
> #define PyThreadState_Swap(ARG) ((void)(ARG))
> -#define PyEval_InitThreads() 0
> -#define PyEval_ReleaseLock() 0
> +#define PyEval_ReleaseLock()
> #endif
>
> /* In order to be able to parse symtab_and_line_to_sal_object function
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch] Fix build failures with python support on sparc-solaris
2010-10-01 23:36 [patch] Fix build failures with python support on sparc-solaris Joel Brobecker
2010-10-01 23:53 ` Michael Snyder
@ 2010-10-26 18:08 ` Joel Brobecker
1 sibling, 0 replies; 4+ messages in thread
From: Joel Brobecker @ 2010-10-26 18:08 UTC (permalink / raw)
To: gdb-patches
> gdb/ChangeLog:
>
> python/python-internal.h (_FILE_OFFSET_BITS): Undefine.
> (PyEval_InitThreads): Remove duplicate. Define as nothing.
> (PyEval_ReleaseLock): Define as nothing.
FYI: I just checked this patch in.
Thanks,
--
Joel
^ permalink raw reply [flat|nested] 4+ messages in thread
* [commit] fix typo in _FILE_OFFSET_BITS comment
2010-10-01 23:53 ` Michael Snyder
@ 2010-10-26 18:09 ` Joel Brobecker
0 siblings, 0 replies; 4+ messages in thread
From: Joel Brobecker @ 2010-10-26 18:09 UTC (permalink / raw)
To: gdb-patches; +Cc: Joel Brobecker
This fixes a typo that MichaelS noticed in a patch I submitted and
forgot to fix.
gdb/ChangeLog:
* (_FILE_OFFSET_BITS): Fix typo in comment.
Checked in.
---
gdb/ChangeLog | 4 ++++
gdb/python/python-internal.h | 2 +-
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 4bfe017..8dcbd1a 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2010-10-26 Joel Brobecker <brobecker@adacore.com>
+ * (_FILE_OFFSET_BITS): Fix typo in comment.
+
+2010-10-26 Joel Brobecker <brobecker@adacore.com>
+
* python/python-internal.h (_FILE_OFFSET_BITS): Undefine.
(PyEval_InitThreads): Remove duplicate. Define as nothing.
(PyEval_ReleaseLock): Define as nothing.
diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h
index e18f50a..67de622 100644
--- a/gdb/python/python-internal.h
+++ b/gdb/python/python-internal.h
@@ -38,7 +38,7 @@
/* On sparc-solaris, /usr/include/sys/feature_tests.h defines
_FILE_OFFSET_BITS, which pyconfig.h also defines. Same work
- arount technique as above. */
+ around technique as above. */
#undef _FILE_OFFSET_BITS
#if HAVE_LIBPYTHON2_4
--
1.7.1
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-10-26 18:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-01 23:36 [patch] Fix build failures with python support on sparc-solaris Joel Brobecker
2010-10-01 23:53 ` Michael Snyder
2010-10-26 18:09 ` [commit] fix typo in _FILE_OFFSET_BITS comment Joel Brobecker
2010-10-26 18:08 ` [patch] Fix build failures with python support on sparc-solaris Joel Brobecker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).