From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4042 invoked by alias); 1 Oct 2010 23:53:47 -0000 Received: (qmail 4026 invoked by uid 22791); 1 Oct 2010 23:53:45 -0000 X-SWARE-Spam-Status: No, hits=-4.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-outbound-1.vmware.com (HELO smtp-outbound-1.vmware.com) (65.115.85.69) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 01 Oct 2010 23:53:40 +0000 Received: from mailhost2.vmware.com (mailhost2.vmware.com [10.16.67.167]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 595D12B005; Fri, 1 Oct 2010 16:53:39 -0700 (PDT) Received: from msnyder-server.eng.vmware.com (promd-2s-dhcp138.eng.vmware.com [10.20.124.138]) by mailhost2.vmware.com (Postfix) with ESMTP id 49CF08E6BA; Fri, 1 Oct 2010 16:53:39 -0700 (PDT) Message-ID: <4CA67482.7010206@vmware.com> Date: Fri, 01 Oct 2010 23:53:00 -0000 From: Michael Snyder User-Agent: Thunderbird 2.0.0.24 (X11/20100903) MIME-Version: 1.0 To: Joel Brobecker CC: "gdb-patches@sourceware.org" Subject: Re: [patch] Fix build failures with python support on sparc-solaris References: <1285976168-4119-1-git-send-email-brobecker@adacore.com> In-Reply-To: <1285976168-4119-1-git-send-email-brobecker@adacore.com> Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-10/txt/msg00017.txt.bz2 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