[Patches] [ python-Patches-439848 ] Generic AIX C++ Module Support

noreply@sourceforge.net noreply@sourceforge.net
Mon, 09 Jul 2001 14:21:58 -0700


Patches item #439848, was opened at 2001-07-09 14:12
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=439848&group_id=5470

Category: Build
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: Generic AIX C++ Module Support

Initial Comment:
The current support for C++ modules on AIX is out of
date and incompatible with more recent compiler
versions. Depending on which compiler is being used,
the "load.h" include could be in any of at least three
places, which may or may not be in the include path.
Since only a single prototype is required, it is
identical in all versions, and isn't likely to change,
the simplest way to deal with the issue is to simply
include the one prototype in the configuration and the
dynload module. Also, the symbol is always going to
live in /usr/lib/libC.a, so a simple -lC is sufficient
to pull it in. I've tested it with C Set++ 3.1.4 on AIX
4.2.1 and VACPP 5.0 on AIX 4.3.3 (the two extremes,
more or less) and it works fine.

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2001-07-09 14:21

Message:
Logged In: NO 

It seems the patch didn't attach. It is pretty
straightforward, though, so I'll paste it here:

Index: dist/src/configure.in
===================================================================
RCS file: /cvsroot/python/python/dist/src/configure.in,v
retrieving revision 1.223
diff -c -r1.223 configure.in
*** dist/src/configure.in       2001/06/27 20:22:04     1.223
--- dist/src/configure.in       2001/07/09 20:58:17
***************
*** 874,884 ****
  # checks for system dependent C++ extensions support
  case "$ac_sys_system" in
        AIX*)   AC_MSG_CHECKING(for genuine AIX C++
extensions support)
!               AC_TRY_LINK([#include
"/usr/lpp/xlC/include/load.h"],
                            [loadAndInit("", 0, "")],
                            [AC_DEFINE(AIX_GENUINE_CPLUSPLUS)
                             AC_MSG_RESULT(yes)],
!                           [AC_MSG_RESULT(no)]);;
        *) ;;
  esac
  
--- 874,887 ----
  # checks for system dependent C++ extensions support
  case "$ac_sys_system" in
        AIX*)   AC_MSG_CHECKING(for genuine AIX C++
extensions support)
!               LIBS_SAVE=$LIBS
!               LIBS="$LIBS -lC"
!               AC_TRY_LINK([int (*loadAndInit(char *name,
int flags, char *path))();],
                            [loadAndInit("", 0, "")],
                            [AC_DEFINE(AIX_GENUINE_CPLUSPLUS)
                             AC_MSG_RESULT(yes)],
!                           [LIBS=$LIBS_SAVE
!                            AC_MSG_RESULT(no)]);;
        *) ;;
  esac
  
Index: dist/src/Python/dynload_aix.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/dynload_aix.c,v
retrieving revision 2.10
diff -c -r2.10 dynload_aix.c
*** dist/src/Python/dynload_aix.c       2000/09/04 00:54:56
    2.10
--- dist/src/Python/dynload_aix.c       2001/07/09 20:58:17
***************
*** 12,18 ****
  
  
  #ifdef AIX_GENUINE_CPLUSPLUS
! #include "/usr/lpp/xlC/include/load.h"
  #define aix_load loadAndInit
  #else
  #define aix_load load
--- 12,18 ----
  
  
  #ifdef AIX_GENUINE_CPLUSPLUS
! int (*loadAndInit(char *name, int flags, char *path))();
  #define aix_load loadAndInit
  #else
  #define aix_load load


----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2001-07-09 14:18

Message:
Logged In: NO 

One more thing. This supports xlC-compiled modules; g++
modules are another issue entirely. We have something that
works for both xlC and g++ based on the AIX loader from
Apache, but g++ requires its own set of fixes for things to
work properly, so the xlC-only fix seems more practical
until the AIX g++ problems are ironed out.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=439848&group_id=5470