can't compile Python modules that use C99

Bug #452667 reported by Zooko Wilcox-O'Hearn
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Python
Fix Released
Unknown
zfec
New
Unknown
Nexenta Operating System
New
Undecided
Unassigned

Bug Description

Using Python 2.5.2-0nexenta2 . When I try to build a Python module that is written in C99 I get this failure:

gcc -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -O2 -O2 -fPIC -I/usr/include/python2.5 -c zfec/_fecmodule.c -o build/temp.solaris-2.11-i86pc-2.5/zfec/_fecmodule.o -std=c99
In file included from /usr/include/limits.h:36,
                 from /usr/lib/gcc/i386-pc-solaris2.11/4.2.3/include/limits.h:122,
                 from /usr/lib/gcc/i386-pc-solaris2.11/4.2.3/include/syslimits.h:7,
                 from /usr/lib/gcc/i386-pc-solaris2.11/4.2.3/include/limits.h:11,
                 from /usr/include/python2.5/Python.h:18,
                 from zfec/_fecmodule.c:5:
/usr/include/sys/feature_tests.h:353:2: error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications and pre-2001 POSIX applications"

I believe that this is caused by this issue in Python:

http://bugs.python.org/issue1759169

There is a patch (by me) on that ticket. Here is the patch:

Index: configure.in
===================================================================
--- configure.in (revision 56514)
+++ configure.in (working copy)
@@ -208,9 +208,12 @@
   # Marc Recht
   NetBSD/1.5 | NetBSD/1.5.* | NetBSD/1.6 | NetBSD/1.6.* | NetBSD/1.6[A-S])
     define_xopen_source=no;;
- # On Solaris 2.6, sys/wait.h is inconsistent in the usage
- # of union __?sigval. Reported by Stuart Bishop.
- SunOS/5.6)
+ # From the perspective of Solaris, _XOPEN_SOURCE is not so much a
+ # request to enable features supported by the standard as a request
+ # to disable features not supported by the standard. The best way
+ # for Python to use Solaris is simply to leave _XOPEN_SOURCE out
+ # entirely and define __EXTENSIONS__ instead.
+ SunOS/*)
     define_xopen_source=no;;
   # On UnixWare 7, u_long is never defined with _XOPEN_SOURCE,
   # but used in /usr/include/netinet/tcp.h. Reported by Tim Rice.
@@ -271,7 +274,7 @@
   # except for Solaris 10, where it must not be defined,
   # as it implies XPG4.2
   case $ac_sys_system/$ac_sys_release in
- SunOS/5.10)
+ SunOS/*)
       ;;
     *)
       AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1,

Please apply that patch to the Nexenta packaging of Python.

Changed in python:
status: Unknown → New
Changed in zfec:
status: Unknown → New
Changed in python:
status: New → Fix Committed
Changed in python:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.