VMware Cloud Community
admin
Immortal
Immortal

AIX5.2 + 64bit

Hi,

In my test-compile I run into a problem with AIX 5.2 on PowerPC64:

$ cc -qlanglvl=extended -q64 -ma -O2 -g -qstrict -qoptimize=2
-qmaxmem=8192 -DDISABLE_VISIBILITY -Isigar/include/ -Isigar/src/os/aix/
-o sigar-test-all sigar-test-all.c sigar/src/sigar_signal.c
sigar/src/sigar_version.c sigar/src/sigar_fileinfo.c sigar/src/sigar.c
sigar/src/sigar_getline.c sigar/src/sigar_cache.c sigar/src/sigar_ptql.c
sigar/src/sigar_util.c sigar/src/os/aix/aix_sigar.c
sigar/src/os/aix/perfstat/sigar_perfstat.c -lodm -lcfg

sigar-test-all.c:
sigar/src/sigar_signal.c:
sigar/src/sigar_version.c:
sigar/src/sigar_fileinfo.c:
sigar/src/sigar.c:
sigar/src/sigar_getline.c:
sigar/src/sigar_cache.c:
sigar/src/sigar_ptql.c:
sigar/src/sigar_util.c:
sigar/src/os/aix/aix_sigar.c:
"/usr/include/sys/user.h", line 380.25: 1506-194 (S) Incomplete type is
not allowed.
sigar/src/os/aix/perfstat/sigar_perfstat.c:
make: *** [sigar-test-all] Error 1

I tried to dive into the internals, but fails to find the reason why it
fails [struct rlimit32 is missing, ...]

AIX5.2 32bit, on the same machine compiles fine.

cheers,
Jan
--
Jan Kneschke, Enterprise Tools Dev, MySQL GmbH, D-81373 München
Radlkoferstr. 2, GF: Hans von Bell, Kaj Arnö - HRB München 162140

0 Kudos
3 Replies
dougm_hyperic
VMware Employee
VMware Employee


Weird, rlimit32 is only defined ifdef _KERNEL.  I checked in the change below, but no 64-bit AIX kernel to confirm with..

-#define _KERNEL 1 /* for struct file */
-#include <sys/file.h>
+/* pull in time.h before resource.h does w/ _KERNEL */
+#include <sys/time.h>
+#define _KERNEL 1
+#include <sys/file.h>     /* for struct file */
+#include <sys/resource.h> /* for rlimit32 in 64-bit mode */
#undef  _KERNEL

On May 10, 2007, at 8:44 AM, Jan Kneschke wrote:

Hi,

In my test-compile I run into a problem with AIX 5.2 on PowerPC64:

$ cc -qlanglvl=extended -q64 -ma -O2 -g -qstrict -qoptimize=2
-qmaxmem=8192 -DDISABLE_VISIBILITY -Isigar/include/ -Isigar/src/os/aix/
-o sigar-test-all sigar-test-all.c sigar/src/sigar_signal.c
sigar/src/sigar_version.c sigar/src/sigar_fileinfo.c sigar/src/sigar.c
sigar/src/sigar_getline.c sigar/src/sigar_cache.c sigar/src/sigar_ptql.c
sigar/src/sigar_util.c sigar/src/os/aix/aix_sigar.c
sigar/src/os/aix/perfstat/sigar_perfstat.c -lodm -lcfg

sigar-test-all.c:
sigar/src/sigar_signal.c:
sigar/src/sigar_version.c:
sigar/src/sigar_fileinfo.c:
sigar/src/sigar.c:
sigar/src/sigar_getline.c:
sigar/src/sigar_cache.c:
sigar/src/sigar_ptql.c:
sigar/src/sigar_util.c:
sigar/src/os/aix/aix_sigar.c:
"/usr/include/sys/user.h", line 380.25: 1506-194 (S) Incomplete type is
not allowed.
sigar/src/os/aix/perfstat/sigar_perfstat.c:
make: *** [sigar-test-all] Error 1

I tried to dive into the internals, but fails to find the reason why it
fails [struct rlimit32 is missing, ...]

AIX5.2 32bit, on the same machine compiles fine.

cheers,
  Jan
--
Jan Kneschke, Enterprise Tools Dev, MySQL GmbH, D-81373 München
Radlkoferstr. 2, GF: Hans von Bell, Kaj Arnö - HRB München 162140



0 Kudos
admin
Immortal
Immortal

Doug MacEachern wrote:
> Weird, rlimit32 is only defined ifdef _KERNEL. I checked in the change
> below, but no 64-bit AIX kernel to confirm with..
>
> -#define _KERNEL 1 /* for struct file */
> -#include <sys/file.h>
> +/* pull in time.h before resource.h does w/ _KERNEL */
> +#include <sys/time.h>
> +#define _KERNEL 1
> +#include <sys/file.h> /* for struct file */
> +#include <sys/resource.h> /* for rlimit32 in 64-bit mode */
> #undef _KERNEL

looks better.

I'm only stuck with a linking error now:

(ld): er full
ld: 0711-318 ERROR: Undefined symbols were found.
The following symbols are in error:
Symbol Inpndx TY CL Source-File(Object-File) OR
Import-File{Shared-object}
RLD: Address Section Rld-type
Referencing Symbol
----------------------------------------------------------------------------------------------
ld: 0711-317 ERROR: Undefined symbol: .getuser
.getuser [2748] ER PR
sigar/src/os/aix/aix_sigar.c(aix_sigar.o)
00004048 .text R_RBR [2178]
.sigar_proc_fd_get

I tried to find a header in /usr/include/ which declares getuser(), but
there is no header for it.


bash-2.05a$ nm -X64 /usr/lib/libc.a | grep '\.getuser'
.getuserattr T 1060216
.getuserpw T 1133080
.getusershell T 1581804
bash-2.05a$ nm -X32 /usr/lib/libc.a | grep '\.getuser'
.getuser T 1549176
.getuserattr T 977136
.getuserpw T 1044796
.getusershell T 1444764

Unbelievable. getuser() only exists as 32bit symbol.

According to:
http://search.cpan.org/src/DURIST/Proc-ProcessTable-0.41/README.aix

o Documentation under AIX is rather cryptic and incomplete. I managed to
read the process table using undocumented calls : getproc, getuser,
getargs.

Looks like they are undocumented for a reason 🙂

cheers,
Jan
--
Jan Kneschke, Enterprise Tools Dev, MySQL GmbH, D-81373 München
Radlkoferstr. 2, GF: Hans von Bell, Kaj Arnö - HRB München 162140

0 Kudos
dougm_hyperic
VMware Employee
VMware Employee


On May 11, 2007, at 9:56 AM, Jan Kneschke wrote:
...

I'm only stuck with a linking error now:

(ld): er full
ld: 0711-318 ERROR: Undefined symbols were found.
        The following symbols are in error:
 Symbol                    Inpndx  TY CL Source-File(Object-File) OR
Import-File{Shared-object}
                              RLD: Address  Section  Rld-type
Referencing Symbol
 ----------------------------------------------------------------------------------------------
ld: 0711-317 ERROR: Undefined symbol: .getuser
 .getuser                  [2748]  ER PR
sigar/src/os/aix/aix_sigar.c(aix_sigar.o)
                                   00004048 .text    R_RBR    [2178]
.sigar_proc_fd_get

I tried to find a header in /usr/include/ which declares getuser(), but
there is no header for it.


bash-2.05a$ nm -X64 /usr/lib/libc.a | grep '\.getuser'
.getuserattr         T     1060216
.getuserpw           T     1133080
.getusershell        T     1581804
bash-2.05a$ nm -X32 /usr/lib/libc.a | grep '\.getuser'
.getuser             T     1549176
.getuserattr         T      977136
.getuserpw           T     1044796
.getusershell        T     1444764

Unbelievable. getuser() only exists as 32bit symbol.

According to:
http://search.cpan.org/src/DURIST/Proc-ProcessTable-0.41/README.aix

o Documentation under AIX is rather cryptic and incomplete. I managed to
  read the process table using undocumented calls : getproc, getuser,
  getargs.

Looks like they are undocumented for a reason 🙂

Indeed.  I just made the change below which removes the getuser() reference in 64-bit mode.  We'll have to see if there's another way to get the fd count for a process.

 int sigar_proc_fd_get(sigar_t *sigar, sigar_pid_t pid,
                       sigar_proc_fd_t *procfd)
{
+#ifdef SIGAR_64BIT
+    /* XXX no getuser() in 64-bit mode */
+    return SIGAR_ENOTIMPL;
+#else



0 Kudos