Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: David Edelsohn <dje.gcc@gmail.com>
To: Andreas Schwab <schwab@suse.de>, Joel Brobecker <brobecker@adacore.com>
Cc: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: Re: GDB Python extension on AIX
Date: Thu, 11 Aug 2016 13:56:00 -0000	[thread overview]
Message-ID: <CAGWvnykKKTeZHm9XSWc-1ensapFzQPiDd4LvNBUY55RgnYWcFw@mail.gmail.com> (raw)
In-Reply-To: <mvmk2fnsr0a.fsf@hawking.suse.de>

On Thu, Aug 11, 2016 at 3:29 AM, Andreas Schwab <schwab@suse.de> wrote:
> On Aug 11 2016, David Edelsohn <dje.gcc@gmail.com> wrote:
>
>> What is the preferred way to address this?
>
> The preferred way is to arrange to include <pyconfig.h> before any
> system headers.  And file a bug with python that their use of feature
> test macros makes this necessary.

Python already is aware of the problem

https://bugs.python.org/issue17120


GDB chose to manipulate the feature test macros further to avoid build
warnings instead of re-arranging the order of headers:


commit aac63f0f2626a3fce5ee936f07ecb48ab7b12ca8
Author: Joel Brobecker <brobecker@gnat.com>
Date:   Wed Jun 30 23:12:04 2010 +0000

    Fix build failure with Python installed in non-system location.

    The debugger fails to build when configure with --python-python=<path>
    where <path> is a non-system location.  The reason is a warning made
    fatal due to the definition of _XOPEN_SOURCE inside pyconfig.h.  This
    is exactly the same problem as with _POSIX_C_SOURCE, handled in
    python-internal.h as follow:

    | /* /usr/include/features.h on linux systems will define _POSIX_C_SOURCE
    |    if it sees _GNU_SOURCE (which config.h will define).
    |    pyconfig.h defines _POSIX_C_SOURCE to a different value than
    |    /usr/include/features.h does causing compilation to fail.
    |    To work around this, undef _POSIX_C_SOURCE before we include Python.h.
 */
    | #undef _POSIX_C_SOURCE

    This patch fixes this problem the same way.

    2010-06-30  Joel Brobecker  <brobecker@adacore.com>

            * python/python-internal.h (_XOPEN_SOURCE): Undefine before
            including Python.h.


I think the ball is in GDB's court.

If GDB is going to intervene in these macros for some systems and
configuratino, I request a method to disable this for AIX.

Thanks, David


  parent reply	other threads:[~2016-08-11 13:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-11  1:56 David Edelsohn
     [not found] ` <mvmk2fnsr0a.fsf@hawking.suse.de>
2016-08-11 13:56   ` David Edelsohn [this message]
2016-08-18  7:21     ` Joel Brobecker
2016-08-18 13:00       ` David Edelsohn
2016-08-19  5:49         ` Joel Brobecker
2016-08-19 15:36           ` David Edelsohn
2016-08-31 23:41             ` Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGWvnykKKTeZHm9XSWc-1ensapFzQPiDd4LvNBUY55RgnYWcFw@mail.gmail.com \
    --to=dje.gcc@gmail.com \
    --cc=brobecker@adacore.com \
    --cc=gdb@sourceware.org \
    --cc=schwab@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox