This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug build/20470] New: Python extension fails to build on AIX


https://sourceware.org/bugzilla/show_bug.cgi?id=20470

            Bug ID: 20470
           Summary: Python extension fails to build on AIX
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: build
          Assignee: unassigned at sourceware dot org
          Reporter: dje at gcc dot gnu.org
  Target Milestone: ---

Building GDB with Python extension enabled fails

In file included from
/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/6.1.0/include/c++/math.h:36:0,
                 from build-gnulib/import/math.h:27,
                 from /opt/freeware/include/python2.7/pyport.h:325,
                 from /opt/freeware/include/python2.7/Python.h:58,
                 from
/home/dje/src/binutils-gdb/gdb/python/python-internal.h:9,
                 from /home/dje/src/binutils-gdb/gdb/python/python.c:94:
/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/6.1.0/include/c++/cmath:640:11:
error: '::isnan' has not been declared
   using ::isnan;
           ^~~~~
Makefile:2593: recipe for target 'python.o' failed

due to a Python extension header redefining feature test
macros in the compiler namespace that interfere with AIX math.h and
libstdc++ math.h behavior.

/* Python 2.4 doesn't include stdint.h soon enough to get {u,}intptr_t
   needed by pyport.h.  */
/* /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.

   Same problem with _XOPEN_SOURCE.  */
#undef _POSIX_C_SOURCE
#undef _XOPEN_SOURCE

Redefining and undefining feature test macros, such as _POSIX_C_SOURCE
and _XOPEN_SOURCE are not very wise things to do, especially in the
middle of a sequence of includes that already may have included other
system header files with conditionals that were affected by the macros
in their original state.

Either these #undef's should be bracketed by

#ifndef _AIX
#endif

or all of the GDB python files should be modified to include the headeres that
include python-config.h first.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]