On Mon, 25 Aug 2008, Niklas Edmundsson wrote:

I can now read from AFS, it was mostly build system issues with the spice of a stupid bug or two in the openafs sources.

Correction: I can now read from AFS, but ALL 64bit processes fail when they try to do an ioctl (for example calling fopen() has that effect).

32bit processes seems to work, which includes most of AIX userland. I can for example do kinit/aklog and read/write to afs.

However, all 64bit binaries fail (usually on fopen()), for example /usr/bin/w ... I suspect that there's something very wrong with the replacing of the 64bit kioctl syscall but I haven't quite figured out how the openafs interaction with the kernel is supposed to stick together.

/usr/bin/w works when having loaded export64.ext.nonfs (ie. cfgexport64 -a export64.ext.nonfs) but stops to work after having loaded afs.ext.64 (ie. cfgafs64 -a afs.ext.64). I tried to get a grip on it but failed to find where to start digging...

Any tips on where to dig would be useful, I'm quite lost at the moment which is quite annoying since I'm obviously so close to getting it to work ;)

In any case, I include the patchset for trunk which got me this far. param.rs_aix61.h goes into src/config/.
The patch consists roughly of the following fixes:

- Make build system recognise AIX 6.1
- Convince build system to only build 64bit kernel modules on AIX 6.1,
  there is no 32bit kernel on AIX 6.
- Misc build fixes, trunk obviously haven't worked on AIX for a while.
- Fix cfgexport to allocate enough memory (the realloc stuff didn't
  work).
- Don't ignore building aklog.
- Fix the AIX rc.afs startup script to correctly determine 32/64-bit
  kernels on all AIX versions.

/Nikke
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 Niklas Edmundsson, Admin @ {acc,hpc2n}.umu.se     |    [EMAIL PROTECTED]
---------------------------------------------------------------------------
 Reality--what a concept!
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
? src/config/param.rs_aix61.h
? src/export/AFS_component_version_number.c
? src/export/export64.exp
? src/export/export64.ext
? src/kopenafs/libkopenafs.o.1.0
? src/shlibafsauthent/libafsauthent.o.1.0
? src/shlibafsrpc/libafsrpc.o.1.1
Index: Makefile.in
===================================================================
RCS file: /cvs/openafs/Makefile.in,v
retrieving revision 1.115
diff -p -u -r1.115 Makefile.in
--- Makefile.in 19 Jul 2008 05:42:23 -0000      1.115
+++ Makefile.in 25 Aug 2008 10:25:39 -0000
@@ -327,7 +327,7 @@ bozo: cmd comerr audit auth kauth volser
 vfsck: vol
        set -x; \
        case ${SYS_NAME} in \
-       sgi_* | *linux* | rs_aix42 | *_darwin* | ia64_hpux* | *fbsd* | *_obsd* 
| *_nbsd* | sun*_4* | rs_aix5* ) \
+       sgi_* | *linux* | rs_aix* | *_darwin* | ia64_hpux* | *fbsd* | *_obsd* | 
*_nbsd* | sun*_4* ) \
                echo skip vfsck for ${SYS_NAME} ;; \
         * ) \
                ${COMPILE_PART1} vfsck ${COMPILE_PART2} ;; \
@@ -616,14 +616,14 @@ finale: project cmd comerr afsd butc tbu
        ptserver tptserver scout bu_utils ubik uss bozo vfsck volser tvolser 
tsalvaged \
        venus update xstat afsmonitor rxdebug libafsrpc \
        libafsauthent shlibafsrpc shlibafsauthent libadmin man-pages \
-       platform kopenafs
+       platform kopenafs aklog
        ${COMPILE_PART1} finale ${COMPILE_PART2}
 
 finale_nolibafs: project cmd comerr afsd butc tbutc tbudb libuafs audit kauth 
log \
        ptserver tptserver scout bu_utils ubik tubik uss bozo vfsck volser 
tvolser tsalvaged \
        venus update xstat afsmonitor rxdebug libafsrpc \
        libafsauthent shlibafsrpc shlibafsauthent libadmin man-pages \
-       platform kopenafs
+       platform kopenafs aklog
        ${COMPILE_PART1} finale ${COMPILE_PART2}
 
 # Use washtool to ensure MakefileProto is current and obj/libafs exists.
Index: README
===================================================================
RCS file: /cvs/openafs/README,v
retrieving revision 1.36
diff -p -u -r1.36 README
--- README      14 Jul 2008 05:46:27 -0000      1.36
+++ README      25 Aug 2008 10:25:40 -0000
@@ -60,7 +60,7 @@ A  Configuring
          ppc_darwin_70, ppc_darwin_80, ppc_darwin_90
       ppc_linux22, ppc_linux24, ppc_linux26
       ppc_nbsd16, ppc_nbsd20
-      rs_aix42, rs_aix51, rs_aix52, rs_aix53
+      rs_aix42, rs_aix51, rs_aix52, rs_aix53, rs_aix61
       s390_linux22, s390_linux24, s390_linux26
       s390x_linux24, s390x_linux26
       sgi_62, sgi_63, sgi_64, sgi_65 (file server not tested)
@@ -245,7 +245,26 @@ G  FreeBSD Notes
 
    You can't run arla and OpenAFS at the same time.
 
-H  Other configure options
+H  AIX notes
+
+   Make sure that your default build environment is 32bit, ie.
+   the OBJECT_MODE environment variable is either unset or set to "32". If
+   afsd coredumps on startup this is the first to verify (yes it's a bug, but
+   noone has found what the problem is).
+
+   Verify this before doing configure and make. For example, assuming ksh/bash:
+   export OBJECT_MODE=32
+
+   To build aklog (in order to be able to get tokens from your KRB5 ticket)
+   you have to supply --with-krb5 to configure, the following example is for
+   building on AIX 6.1 with the IBM Kerberos5 (krb5.client.rte and
+   krb5.toolkit.adt on the Expansion Pack):
+
+   ./configure --with-afs-sysname=rs_aix61 --enable-transarc-paths \
+       --enable-supergroups \
+       --with-krb5 KRB5CFLAGS=-I/usr/include KRB5LIBS=-lkrb5
+
+I  Other configure options
 
    AFS has a ton of other optional features that must be enabled using
    configure options.  Here is a summary:
Index: acinclude.m4
===================================================================
RCS file: /cvs/openafs/acinclude.m4,v
retrieving revision 1.241
diff -p -u -r1.241 acinclude.m4
--- acinclude.m4        16 Aug 2008 21:37:29 -0000      1.241
+++ acinclude.m4        25 Aug 2008 10:25:40 -0000
@@ -636,6 +636,10 @@ else
                        AFS_SYSNAME="rs_aix53"
                        enable_pam="no"
                        ;;
+               power*-ibm-aix6.1*)
+                       AFS_SYSNAME="rs_aix61"
+                       enable_pam="no"
+                       ;;
                x86_64-*-linux-gnu)
                        AFS_SYSNAME="amd64_linuxXX"
                        enable_pam="no"
Index: src/afsd/rc.afs.rs_aix
===================================================================
RCS file: /cvs/openafs/src/afsd/rc.afs.rs_aix,v
retrieving revision 1.3
diff -p -u -r1.3 rc.afs.rs_aix
--- src/afsd/rc.afs.rs_aix      1 Jul 2003 18:37:25 -0000       1.3
+++ src/afsd/rc.afs.rs_aix      25 Aug 2008 10:25:41 -0000
@@ -49,21 +49,17 @@ fi
 # find out whether we have 32 or 64 bit kernel
 
 kernel=32
-if [ -x /bin/w64 ]; then
-    /bin/w64 >/dev/null 2>&1
-    if [ $? -eq 0 ]; then
-        kernel=64
-    fi
+if [ -x /usr/sbin/bootinfo ]; then
+       kernel=`/usr/sbin/bootinfo -K`
 fi
 
 # Load AFS into the kernel
 
+echo "$0: Loading $kernel bit kernel AFS modules"
 cd /usr/vice/etc/dkload
 if [ $kernel -eq 32 ]; then
-    echo "32-bit kernel found"
     ./cfgexport -a export.ext${ExportExt} && ./cfgafs -a afs.ext.32
 else
-    echo "64-bit kernel assumed"
     ./cfgexport64 -a export64.ext${ExportExt} && ./cfgafs64 -a afs.ext.64
 fi
 if [ $? -ne 0 ]; then
Index: src/cf/osconf.m4
===================================================================
RCS file: /cvs/openafs/src/cf/osconf.m4,v
retrieving revision 1.99
diff -p -u -r1.99 osconf.m4
--- src/cf/osconf.m4    19 Jul 2008 06:11:06 -0000      1.99
+++ src/cf/osconf.m4    25 Aug 2008 10:25:41 -0000
@@ -567,6 +567,7 @@ case $AFS_SYSNAME in
                XCFLAGS="-K -D_NONSTD_TYPES -D_MBI=void"
                XLIBS="${LIB_AFSDB} -ldl"
                SHLIB_LINKER="${MT_CC} -bM:SRE -berok"
+               AIX32=""
                AIX64="#"
                ;;
 
@@ -583,6 +584,7 @@ case $AFS_SYSNAME in
                XCFLAGS="-K -D_NONSTD_TYPES -D_MBI=void"
                XLIBS="${LIB_AFSDB} -ldl"
                SHLIB_LINKER="${MT_CC} -bM:SRE -berok"
+               AIX32=""
                AIX64=""
                ;;
 
@@ -598,6 +600,7 @@ case $AFS_SYSNAME in
                XCFLAGS="-K -D_NONSTD_TYPES -D_MBI=void"
                XLIBS="${LIB_AFSDB} -ldl"
                SHLIB_LINKER="${MT_CC} -bM:SRE -berok"
+               AIX32=""
                AIX64=""
                ;;
 
@@ -613,6 +616,23 @@ case $AFS_SYSNAME in
                XCFLAGS="-K -D_NONSTD_TYPES -D_MBI=void"
                XLIBS="${LIB_AFSDB} -ldl"
                SHLIB_LINKER="${MT_CC} -bM:SRE -berok"
+               AIX32=""
+               AIX64=""
+               ;;
+
+       rs_aix61)       
+               DBG="-g"
+               LEX="lex"
+               LIBSYS_AIX_EXP="afsl.exp"
+               MT_CC="xlc_r"
+               MT_CFLAGS='-DAFS_PTHREAD_ENV ${XCFLAGS}'
+               MT_LIBS="-lpthreads"
+               SHLIB_SUFFIX="o"
+               TXLIBS="-lcurses"
+               XCFLAGS="-K -D_NONSTD_TYPES -D_MBI=void"
+               XLIBS="${LIB_AFSDB} -ldl"
+               SHLIB_LINKER="${MT_CC} -bM:SRE -berok"
+               AIX32="#"
                AIX64=""
                ;;
 
@@ -1106,6 +1126,7 @@ AC_SUBST(CCXPG2)
 AC_SUBST(CCOBJ)
 AC_SUBST(AFSD_LIBS)
 AC_SUBST(AFSD_LDFLAGS)
+AC_SUBST(AIX32)
 AC_SUBST(AIX64)
 AC_SUBST(AR)
 AC_SUBST(AS)
Index: src/config/afs_sysnames.h
===================================================================
RCS file: /cvs/openafs/src/config/afs_sysnames.h,v
retrieving revision 1.84
diff -p -u -r1.84 afs_sysnames.h
--- src/config/afs_sysnames.h   15 Jan 2008 06:04:52 -0000      1.84
+++ src/config/afs_sysnames.h   25 Aug 2008 10:25:41 -0000
@@ -73,6 +73,7 @@
 #define SYS_NAME_ID_rs_aix43            705
 #define SYS_NAME_ID_rs_aix52            706
 #define SYS_NAME_ID_rs_aix53            707
+#define SYS_NAME_ID_rs_aix61            708
 
 #define SYS_NAME_ID_sun3_411            906
 #define SYS_NAME_ID_sun3x_411           912
Index: src/export/Makefile.in
===================================================================
RCS file: /cvs/openafs/src/export/Makefile.in,v
retrieving revision 1.23
diff -p -u -r1.23 Makefile.in
--- src/export/Makefile.in      3 Aug 2006 02:37:20 -0000       1.23
+++ src/export/Makefile.in      25 Aug 2008 10:25:42 -0000
@@ -16,17 +16,20 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
   IMPORTS = /lib/kernex.exp /lib/syscalls.exp ${srcdir}/extras.exp
      KOBJ = export.o symtab.o
 
-EXPORTS64 = @[EMAIL PROTECTED] export64.ext cfgexport64 cfgafs64
+EXPORTS32 = @[EMAIL PROTECTED] export.ext.nonfs export.ext cfgexport cfgafs
+EXPORTS64 = @[EMAIL PROTECTED] export64.ext.nonfs export64.ext cfgexport64 
cfgafs64
+TOPEXP32  = @[EMAIL PROTECTED]/export.exp
+TOPEXP64  = @[EMAIL PROTECTED]/export64.exp
 
-all: ${TOP_LIBDIR}/export.exp ${TOP_LIBDIR}/export64.exp 
${TOP_LIBDIR}/extras.exp cfgexport cfgafs
+all: $(TOPEXP32) $(TOPEXP64) ${TOP_LIBDIR}/extras.exp
        ${INSTALL} -d ${KERNELDIR}
        ${INSTALL} -d ${UKERNELDIR}
        ${INSTALL_DATA} ${srcdir}/export.h ${KERNELDIR}/export.h
-       ${INSTALL_DATA} export.exp ${KERNELDIR}/export.exp
-       ${INSTALL_DATA} export64.exp ${KERNELDIR}/export64.exp
+       @[EMAIL PROTECTED] export.exp ${KERNELDIR}/export.exp
+       @[EMAIL PROTECTED] export64.exp ${KERNELDIR}/export64.exp
        ${INSTALL_DATA} ${srcdir}/export.h ${UKERNELDIR}/export.h
-       ${INSTALL_DATA} export64.exp ${UKERNELDIR}/export64.exp
-       ${INSTALL_DATA} export.exp ${UKERNELDIR}/export.exp
+       @[EMAIL PROTECTED] export.exp ${UKERNELDIR}/export.exp
+       @[EMAIL PROTECTED] export64.exp ${UKERNELDIR}/export64.exp
 
 ${TOP_LIBDIR}/export.exp: export.exp
        ${INSTALL_DATA} $? $@
@@ -43,9 +46,17 @@ export.exp: ${srcdir}/export4.exp ${srcd
        case ${SYS_NAME} in \
        rs_aix4* ) \
                cp -p ${srcdir}/export4.exp export.exp ; \
-               cp -p ${srcdir}/export4-64.exp export64.exp ;; \
        rs_aix5* ) \
                cp -p ${srcdir}/export5.exp export.exp ; \
+       esac
+
+export64.exp: ${srcdir}/export4-64.exp ${srcdir}/export5-64.exp
+       case ${SYS_NAME} in \
+       rs_aix4* ) \
+               cp -p ${srcdir}/export4-64.exp export64.exp ;; \
+       rs_aix5* ) \
+               cp -p ${srcdir}/export5-64.exp export64.exp ;; \
+       rs_aix6* ) \
                cp -p ${srcdir}/export5-64.exp export64.exp ;; \
        esac
 
@@ -72,6 +83,9 @@ symtab.o symtab64.o: ${srcdir}/symtab.c
                ${CC} ${CFLAGS} -q64 -D__XCOFF64__ -DAFS_64BIT_KERNEL 
-DAFS_AIX51_ENV -c ${srcdir}/symtab.c ; \
                mv symtab.o symtab64.o ; \
                ${CC} ${CFLAGS} -DAFS_AIX51_ENV -c ${srcdir}/symtab.c ;; \
+       rs_aix6* ) \
+               ${CC} ${CFLAGS} -q64 -D__XCOFF64__ -DAFS_64BIT_KERNEL 
-DAFS_AIX51_ENV -c ${srcdir}/symtab.c ; \
+               mv symtab.o symtab64.o ;; \
        esac
 
 export.o export64.o: ${srcdir}/export.c
@@ -82,18 +96,25 @@ export.o export64.o: ${srcdir}/export.c
                ${CC} ${CFLAGS} -q64 -D__XCOFF64__ -DAFS_64BIT_KERNEL 
-DAFS_AIX51_ENV -c ${srcdir}/export.c ; \
                mv export.o export64.o ; \
                ${CC} ${CFLAGS} -DAFS_AIX51_ENV -c ${srcdir}/export.c ;; \
+       rs_aix6* ) \
+               ${CC} ${CFLAGS} -q64 -D__XCOFF64__ -DAFS_64BIT_KERNEL 
-DAFS_AIX51_ENV -c ${srcdir}/export.c ; \
+               mv export.o export64.o ;; \
        esac
 
 export.nonfs.o export64.nonfs.o: ${srcdir}/export.c
        case ${SYS_NAME} in \
        rs_aix4* ) \
-               ${CC} ${INCS} -DAFS_NONFSTRANS -c ${srcdir}/export.c ;; \
+               ${CC} ${INCS} -DAFS_NONFSTRANS -c ${srcdir}/export.c ; \
+               mv export.o export.nonfs.o ;; \
        rs_aix5* ) \
                ${CC} -q64 ${INCS} -D__XCOFF64__ -DAFS_64BIT_KERNEL 
-DAFS_NONFSTRANS -DAFS_AIX51_ENV -c ${srcdir}/export.c ; \
                mv export.o export64.nonfs.o ; \
-               ${CC} ${INCS} -DAFS_NONFSTRANS -DAFS_AIX51_ENV -c 
${srcdir}/export.c ;; \
+               ${CC} ${INCS} -DAFS_NONFSTRANS -DAFS_AIX51_ENV -c 
${srcdir}/export.c ; \
+               mv export.o export.nonfs.o ;; \
+       rs_aix6* ) \
+               ${CC} -q64 ${INCS} -D__XCOFF64__ -DAFS_64BIT_KERNEL 
-DAFS_NONFSTRANS -DAFS_AIX51_ENV -c ${srcdir}/export.c ; \
+               mv export.o export64.nonfs.o ;; \
        esac
-       -mv export.o export.nonfs.o
 
 cfgexport: cfgexport.o
        ${CC} -g ${INCS} -o cfgexport cfgexport.o
@@ -122,36 +143,34 @@ clean:
        $(RM) -f cfgafs cfgafs64
        $(RM) -f *.ext *.ext.nonfs
 
-install: export.ext export.ext.nonfs export.exp export64.exp cfgexport \
-               cfgafs $(EXPORTS64)
+install: $(EXPORTS32) $(EXPORTS64)
        ${INSTALL} -d ${DESTDIR}${afskerneldir}
        ${INSTALL} -d ${DESTDIR}${libdir}/afs
-       ${INSTALL_DATA} export.ext ${DESTDIR}${afskerneldir}/export.ext
-       ${INSTALL_DATA} export.ext.nonfs 
${DESTDIR}${afskerneldir}/export.ext.nonfs
-       ${INSTALL_DATA} export.exp ${DESTDIR}${libdir}/afs/export.exp
-       ${INSTALL_DATA} export64.exp ${DESTDIR}${libdir}/afs/export64.exp
        ${INSTALL_DATA} ${srcdir}/extras.exp ${DESTDIR}${libdir}/afs/extras.exp
-       ${INSTALL_DATA} cfgexport ${DESTDIR}${afskerneldir}/cfgexport
-       ${INSTALL_DATA} cfgafs ${DESTDIR}${afskerneldir}/cfgafs
-       @[EMAIL PROTECTED] export64.ext.nonfs 
${DESTDIR}${afskerneldir}/export64.ext.nonfs
+       @[EMAIL PROTECTED] export.exp ${DESTDIR}${libdir}/afs/export.exp
+       @[EMAIL PROTECTED] export.ext ${DESTDIR}${afskerneldir}/export.ext
+       @[EMAIL PROTECTED] export.ext.nonfs 
${DESTDIR}${afskerneldir}/export.ext.nonfs
+       @[EMAIL PROTECTED] cfgexport ${DESTDIR}${afskerneldir}/cfgexport
+       @[EMAIL PROTECTED] cfgafs ${DESTDIR}${afskerneldir}/cfgafs
+       @[EMAIL PROTECTED] export64.exp ${DESTDIR}${libdir}/afs/export64.exp
        @[EMAIL PROTECTED] export64.ext ${DESTDIR}${afskerneldir}/export64.ext
+       @[EMAIL PROTECTED] export64.ext.nonfs 
${DESTDIR}${afskerneldir}/export64.ext.nonfs
        @[EMAIL PROTECTED] cfgexport64 ${DESTDIR}${afskerneldir}/cfgexport64
        @[EMAIL PROTECTED] cfgafs64 ${DESTDIR}${afskerneldir}/cfgafs64
 
-dest: export.ext export.ext.nonfs export.exp export64.exp cfgexport \
-               cfgafs $(EXPORTS64)
+dest: $(EXPORTS32) $(EXPORTS64)
        ${INSTALL} -d ${DEST}/root.client/usr/vice/etc/dkload
        ${INSTALL} -d ${DEST}/lib/afs
-       ${INSTALL_DATA} export.ext 
${DEST}/root.client/usr/vice/etc/dkload/export.ext
-       ${INSTALL_DATA} export.ext.nonfs 
${DEST}/root.client/usr/vice/etc/dkload/export.ext.nonfs
-       ${INSTALL_DATA} export.exp ${DEST}/lib/afs/export.exp
        ${INSTALL_DATA} ${srcdir}/extras.exp ${DEST}/lib/afs/extras.exp
-       ${INSTALL_DATA} cfgexport 
${DEST}/root.client/usr/vice/etc/dkload/cfgexport
-       ${INSTALL_DATA} cfgafs ${DEST}/root.client/usr/vice/etc/dkload/cfgafs
-       @[EMAIL PROTECTED] export64.ext.nonfs 
${DEST}/root.client/usr/vice/etc/dkload/export64.ext.nonfs \
-       @[EMAIL PROTECTED] export64.exp ${DEST}/lib/afs/export64.exp \
-       @[EMAIL PROTECTED] export64.ext 
${DEST}/root.client/usr/vice/etc/dkload/export64.ext \
-       @[EMAIL PROTECTED] cfgexport64 
${DEST}/root.client/usr/vice/etc/dkload/cfgexport64 \
-       @[EMAIL PROTECTED] cfgafs64 
${DEST}/root.client/usr/vice/etc/dkload/cfgafs64
+       @[EMAIL PROTECTED] export.exp ${DEST}/lib/afs/export.exp
+       @[EMAIL PROTECTED] export.ext 
${DEST}/root.client/usr/vice/etc/dkload/export.ext
+       @[EMAIL PROTECTED] export.ext.nonfs 
${DEST}/root.client/usr/vice/etc/dkload/export.ext.nonfs
+       @[EMAIL PROTECTED] cfgexport 
${DEST}/root.client/usr/vice/etc/dkload/cfgexport
+       @[EMAIL PROTECTED] cfgafs ${DEST}/root.client/usr/vice/etc/dkload/cfgafs
+       @[EMAIL PROTECTED] export64.exp ${DEST}/lib/afs/export64.exp
+       @[EMAIL PROTECTED] export64.ext 
${DEST}/root.client/usr/vice/etc/dkload/export64.ext
+       @[EMAIL PROTECTED] export64.ext.nonfs 
${DEST}/root.client/usr/vice/etc/dkload/export64.ext.nonfs
+       @[EMAIL PROTECTED] cfgexport64 
${DEST}/root.client/usr/vice/etc/dkload/cfgexport64
+       @[EMAIL PROTECTED] cfgafs64 
${DEST}/root.client/usr/vice/etc/dkload/cfgafs64
 
 include ../config/Makefile.version
Index: src/export/cfgexport.c
===================================================================
RCS file: /cvs/openafs/src/export/cfgexport.c,v
retrieving revision 1.12
diff -p -u -r1.12 cfgexport.c
--- src/export/cfgexport.c      7 Dec 2004 16:49:07 -0000       1.12
+++ src/export/cfgexport.c      25 Aug 2008 10:25:42 -0000
@@ -377,7 +377,7 @@ get_syms(conf, syms)
  *     strp    -       ^ to ^ to EXPORT string table
  *     szp     -       ^ to EXPORT string table size
  */
-#define SYMBUFSIZE 262144
+#define SYMBUFSIZE 1048576
 xlate_xtok(xp, kp, strp, szp)
      register struct syment *xp;
      register sym_t *kp;
@@ -420,12 +420,18 @@ xlate_xtok(xp, kp, strp, szp)
         */
        len = strlen(xstrings + xp->n_offset) + 1;
        while (len >= left) {
+           fprintf(stderr, "cfgexport: Out of memory. Increase SYMBUFSIZE and 
recompile\n");
+           exit(1);
+#if 0
+           /* Something is broken with this code, after being here
+              cfgexport segfaults */
            export_strings = (char *)realloc(*strp, sz += SYMBUFSIZE);
            if (!export_strings)
                error("no memory for EXPORT string table");
            *strp = export_strings;
            left += SYMBUFSIZE;
            prev = "";          /* lazy */
+#endif
        }
 
        strcpy(prev = *strp + offset, xstrings + xp->n_offset);
Index: src/kopenafs/Makefile.in
===================================================================
RCS file: /cvs/openafs/src/kopenafs/Makefile.in,v
retrieving revision 1.3
diff -p -u -r1.3 Makefile.in
--- src/kopenafs/Makefile.in    3 Aug 2006 02:37:22 -0000       1.3
+++ src/kopenafs/Makefile.in    25 Aug 2008 10:25:42 -0000
@@ -59,7 +59,7 @@ syscall.o: ${SYS}/syscall.s
                 ${CC} ${CFLAGS} -c ${SYS}/syscall.s; \
                ;; \
        rs_aix* | hp_ux10*) \
-               /lib/cpp -P ${SFLAGS} ${srcdir}/syscall.s syscall.ss; \
+               /lib/cpp -P ${CFLAGS} ${SYS}/syscall.s syscall.ss; \
                as -o syscall.o syscall.ss; \
                $(RM) syscall.ss; \
                ;; \
@@ -68,7 +68,7 @@ syscall.o: ${SYS}/syscall.s
                ;; \
        esac
 
-libkopenafs.a: ${LIBOBJS}
+libkopenafs.a: ${LIBOBJS} syscall.o
        ${RM} -f $@
        @set -e; set -x; case "$(SYS_NAME)" in \
        sgi_* | rs_aix* | hp_ux10*) \
@@ -78,7 +78,7 @@ libkopenafs.a: ${LIBOBJS}
        esac
        ${RANLIB} $@
 
-${LIBKOPENAFS}: ${LIBOBJS}
+${LIBKOPENAFS}: ${LIBOBJS} syscall.o
        @set -e; set -x; case ${SYS_NAME} in \
        sgi_* | rs_aix* | hp_ux10*) \
                ../config/shlib-build -d $(srcdir) -l libkopenafs \
Index: src/libafs/MakefileProto.AIX.in
===================================================================
RCS file: /cvs/openafs/src/libafs/MakefileProto.AIX.in,v
retrieving revision 1.31
diff -p -u -r1.31 MakefileProto.AIX.in
--- src/libafs/MakefileProto.AIX.in     1 Jul 2008 02:38:03 -0000       1.31
+++ src/libafs/MakefileProto.AIX.in     25 Aug 2008 10:25:42 -0000
@@ -80,6 +80,8 @@ DESTDIRS = aix_destdirs
 KMODS=32 
 <rs_aix50 rs_aix51 rs_aix52 rs_aix53>
 KMODS=32 64
+<rs_aix61>
+KMODS=64
 <all>
 
 include Makefile.common
#ifndef UKERNEL
/* This section for kernel libafs compiles only */

/*
 * Copyright 2000, International Business Machines Corporation and others.
 * All Rights Reserved.
 * 
 * This software has been released under the terms of the IBM Public
 * License.  For details, see the LICENSE file in the top-level source
 * directory or online at http://www.openafs.org/dl/license10.html
 */

#ifndef AFS_PARAM_H
#define AFS_PARAM_H

#define AFS_AIX_ENV             1
#define AFS_AIX32_ENV           1
#define AFS_AIX41_ENV           1
#define AFS_AIX42_ENV           1
#define AFS_AIX51_ENV           1
#define AFS_AIX52_ENV           1
#define AFS_AIX53_ENV           1
#define AFS_AIX61_ENV           1

#define AFS_64BIT_ENV           1
#define AFS_64BIT_CLIENT        1
#define AFS_NAMEI_ENV           1
#ifdef AFS_NAMEI_ENV
#define AFS_64BIT_IOPS_ENV      1
#endif

#define AFS_HAVE_FLOCK_SYSID    1

#include <afs/afs_sysnames.h>

/* Global lock in AFS part of client. */
#define AFS_GLOBAL_SUNLOCK 1
#define AFS_GCPAGS              1       /* if nonzero, garbage collect PAGs */

/* File system entry (used if vmount.h doesn't define MNT_AFS */
#define AFS_MOUNT_AFS   4
#define AFS_SYSCALL    31

/* Machine / Operating system information */
#define SYS_NAME        "rs_aix61"
#define SYS_NAME_ID     SYS_NAME_ID_rs_aix61
#define AFSBIG_ENDIAN   1
#define RIOS            1       /* POWERseries 6000. (sj/pc)    */
#define AFS_VM_RDWR_ENV 1       /* read/write implemented via VM */
#define AFS_USE_GETTIMEOFDAY 1  /* use gettimeofday to implement rx clock */
#define AFS_HAVE_STATVFS        1       /* System supports statvfs */

#ifndef _POWER
#define _POWER          1       /* _POWERseries!                */
#endif
#ifndef COMPAT_43
#define COMPAT_43
#endif

#define KERNEL_HAVE_UERROR 1
#define KERNEL_HAVE_PIN 1

/* Extra kernel definitions (from kdefs file) */
#ifdef _KERNEL
#define AFS_SHORTGID    1
#define AFS_UIOFMODE    1
#define afsio_iov       uio_iov
#define afsio_iovcnt    uio_iovcnt
#define afsio_offset    uio_offset
#define afsio_seg       uio_segflg
#define afsio_fmode     uio_fmode
#define afsio_resid     uio_resid
#define AFS_UIOSYS      UIO_SYSSPACE
#define AFS_UIOUSER     UIO_USERSPACE
#define AFS_CLBYTES     CLBYTES
#define AFS_MINCHANGE   2
#define osi_GetTime(x)          do {curtime(x); (x)->tv_usec = 
(x)->tv_usec/1000;} while (0)
#define osi_GTime(x)    time    /* something for the silly time(0)?? */
#define AFS_KALLOC      kmem_alloc
#define AFS_KFREE       kmem_free
#define VATTR_NULL(V)   memset((void*)V, -1, sizeof(*(V)))
#define va_nodeid       va_serialno
#endif /* !_KERNEL      */
#define AFS_DIRENT
#endif /* AFS_PARAM_H */

#else /* !defined(UKERNEL) */

/* This section for user space compiles only */

/*
 * Copyright 2000, International Business Machines Corporation and others.
 * All Rights Reserved.
 * 
 * This software has been released under the terms of the IBM Public
 * License.  For details, see the LICENSE file in the top-level source
 * directory or online at http://www.openafs.org/dl/license10.html
 */

#ifndef AFS_PARAM_H
#define AFS_PARAM_H

#define AFS_64BIT_ENV           1
#define AFS_64BIT_CLIENT        1
#define AFS_NAMEI_ENV           1
#ifdef AFS_NAMEI_ENV
#define AFS_64BIT_IOPS_ENV      1
#endif
#define BITMAP_LATER            1
#define FAST_RESTART            1

#define AFS_VFS_ENV     1
/* Used only in vfsck code; is it needed any more???? */
#define RXK_LISTENER_ENV        1
#define AFS_USERSPACE_IP_ADDR   1
#define AFS_GCPAGS              0       /* if nonzero, garbage collect PAGs */

#ifdef KERNEL

#define UKERNEL                 1       /* user space kernel */
#define AFS_ENV                 1
#define AFS_USR_AIX_ENV         1
#define AFS_USR_AIX41_ENV       1
#define AFS_USR_AIX42_ENV       1
#define AFS_USR_AIX51_ENV               1

#else /* KERNEL */

#define AFS_AIX_ENV             1
#define AFS_AIX32_ENV           1
#define AFS_AIX41_ENV           1
#define AFS_AIX42_ENV           1
#define AFS_AIX51_ENV           1

#define AFS_HAVE_FLOCK_SYSID    1

#endif /* KERNEL */

#include <afs/afs_sysnames.h>

                                                                                
                               /*#define AFS_GLOBAL_SUNLOCK    1 *//* For 
global locking */

#define AFS_3DISPARES           1       /* Utilize the 3 available disk inode 
'spares' */
#define AFS_SYSCALL             105

/* File system entry (used if mount.h doesn't define MOUNT_AFS */
#define AFS_MOUNT_AFS    4

/* Machine / Operating system information */
#define sys_rs_aix51    1
#define SYS_NAME        "rs_aix51"
#define SYS_NAME_ID     SYS_NAME_ID_rs_aix51
#define AFSBIG_ENDIAN   1
#define AFS_HAVE_FFS            1       /* Use system's ffs. */
#define AFS_HAVE_STATVFS        0       /* System doesn't support statvfs */

/* Extra kernel definitions (from kdefs file) */
#ifdef KERNEL
#define AFS_UIOFMODE            1       /* Only in afs/afs_vnodeops.c 
(afs_ustrategy) */
#define AFS_SYSVLOCK            1       /* sys v locking supported */
/*#define       AFS_USEBUFFERS  1*/
#define afsio_iov       uio_iov
#define afsio_iovcnt    uio_iovcnt
#define afsio_offset    uio_offset
#define afsio_seg       uio_segflg
#define afsio_fmode     uio_fmode
#define afsio_resid     uio_resid
#define AFS_UIOSYS      1
#define AFS_UIOUSER     UIO_USERSPACE
#define AFS_CLBYTES     MCLBYTES
#define AFS_MINCHANGE   2
#define VATTR_NULL      usr_vattr_null
#endif /* KERNEL */
#define AFS_DIRENT
#ifndef CMSERVERPREF
#define CMSERVERPREF
#endif

#endif /* AFS_PARAM_H */

#endif /* !defined(UKERNEL) */

Reply via email to