Issue Details (XML | Word | Printable)

Key: MODPYTHON-138
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Jim Gallacher
Reporter: Michel Jouvin
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
mod_python

Python.h should be included first

Created: 21/Feb/06 08:30 AM   Updated: 26/Feb/06 09:12 AM
Return to search
Component/s: core
Affects Version/s: 3.2.7
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works mod_python-3.2.6-tru64.patch 2006-02-21 08:33 AM Michel Jouvin 5 kB
Environment: Tru64 5.1B, Python 2.4.1, Apache 2..55


 Description  « Hide
I have a problem to build mod_pyton on Tru64 with the Python config I have. This is basically due to the fact that Python.h should be included first as its defines some macros used by standard includes. When included at the end of the includes, this results to some conflicts because the same include is included twice with a different macro value. This change should have no impact on platforms where the current include order works.

Affected files are :

      src/include/psp_parser.h
      src/include/mod_python.h
      src/include/psp_flex.h
      src/include/mod_python.h.in
      src/_pspmodule.c
      src/psp_parser.c

I have a patch file available, I'll try to attach it to this issue if I manage to find how to do it...

Michel

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Michel Jouvin added a comment - 21/Feb/06 08:33 AM
Diff file containing changes implemented to fix the issue described. Built for 3.2.6 but should probably works with any 3.2.x.

Jim Gallacher added a comment - 26/Feb/06 09:02 AM
Michel's patch does not work for Debian Linux. mod_python immediately segfaults. There was a different gcc warning, which I had not seen before:

/usr/bin/libtool --silent --mode=compile gcc -prefer-pic -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall -g -O2 -DAP_HAVE_DESIGNATED_INITIALIZER -DLINUX=2 -D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall -g -O2 -pthread -I/usr/include/apache2 -I/usr/include/apr-0 -I/usr/include/apr-0 -I/usr/include -I/tmp/mod_python/src/include -I/usr/include/apache2 -I/usr/include/python2.3 -c -o _apachemodule.lo _apachemodule.c && touch _apachemodule.slo
In file included from /usr/include/python2.3/Python.h:8,
                 from /tmp/mod_python/src/include/mod_python.h:46,
                 from _apachemodule.c:25:
/usr/include/python2.3/pyconfig.h:865:1: warning: "_XOPEN_SOURCE" redefined
<command line>:1:1: warning: this is the location of the previous definition



Jim Gallacher added a comment - 26/Feb/06 09:03 AM
I should have added that a similar error occurs 9 more times.

Graham Dumpleton added a comment - 26/Feb/06 09:12 AM
Suggest this be put on hold anyway until original poster actually attaches here the original output from the build, including compiler options and error output.

I suggest this, as their original comment:

  "When included at the end of the includes, this results to some conflicts because the same include is included twice with a different macro value."

makes no sense. If header files are correctly protected with #ifndef they shouldn't be able to be included twice. Thus more information needed about the actual error message and which header files is supposedly being included twice, so it can be debugged properly rather than trying to solve it by just shifting stuff around.