Hi Sebastien,

Forwarding another bug report - PAGE_SIZE is not longer defined on
powerpc arch.

Regards,
robert



--- Begin Message ---
Package: sysstat
Version: 7.0.0-1
Severity: serious
Tags: patch

When building 'sysstat' on powerpc/unstable,
I get the following error:

sa.h:397: warning: 'packed' attribute ignored for field of type 'unsigned 
char[3u]'
sed s+VERSION_NUMBER+7.0.0+g version.in > version.h
gcc -o common.o -c -Wall -Wstrict-prototypes -pipe -g -fno-strength-reduce -O2  
-DUSE_NLS -DPACKAGE=\"sysstat\" -DLOCALEDIR=\"/usr/share/locale\" common.c
common.c: In function 'get_kb_shift':
common.c:434: error: 'PAGE_SIZE' undeclared (first use in this function)
common.c:434: error: (Each undeclared identifier is reported only once
common.c:434: error: for each function it appears in.)
make[1]: *** [common.o] Error 1
make[1]: Leaving directory `/sysstat-7.0.0'
make: *** [build-stamp] Error 2

With the attached patch 'sysstat' can be compiled on powerpc.

Regards
Andreas Jochens

diff -urN ../tmp-orig/sysstat-7.0.0/common.c ./common.c
--- ../tmp-orig/sysstat-7.0.0/common.c  2006-07-09 08:19:06.000000000 +0000
+++ ./common.c  2006-08-23 11:20:05.000000000 +0000
@@ -29,13 +29,6 @@
 #include <sys/types.h>
 #include <sys/ioctl.h>
 
-/*
- * For PAGE_SIZE (which may be itself a call to getpagesize()).
- * PAGE_SHIFT no longer necessarily exists in <asm/page.h>. So
- * we use PAGE_SIZE to compute PAGE_SHIFT...
- */
-#include <asm/page.h>
-
 #include "version.h"
 #include "common.h"
 #include "ioconf.h"
@@ -431,7 +424,7 @@
    int shift = 0;
    int size;
 
-   size = PAGE_SIZE >> 10; /* Assume that a page has a minimum size of 1 kB */
+   size = sysconf(_SC_PAGE_SIZE) >> 10; /* Assume that a page has a minimum 
size of 1 kB */
    while (size > 1) {
       shift++;
       size >>= 1;




--- End Message ---

Reply via email to