Bug#384307: [Fwd: Bug#384307: sysstat: FTBFS (powerpc/ppc64): 'PAGE_SIZE' undeclared (first use in this function)]

2006-08-27 Thread Robert Luberda
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.0 +
+++ ./common.c  2006-08-23 11:20:05.0 +
@@ -29,13 +29,6 @@
 #include 
 #include 
 
-/*
- * For PAGE_SIZE (which may be itself a call to getpagesize()).
- * PAGE_SHIFT no longer necessarily exists in . So
- * we use PAGE_SIZE to compute PAGE_SHIFT...
- */
-#include 
-
 #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 ---


Bug#384307: [Fwd: Bug#384307: sysstat: FTBFS (powerpc/ppc64): 'PAGE_SIZE' undeclared (first use in this function)]

2006-09-10 Thread Sebastien Godard

Hi Robert,

This bug will be fixed in sysstat 7.0.1 which will be released next week.
Sysstat will use the sysconf() system call to get the size of a page 
instead of using PAGE_SIZE definition.


Regards,
Sébastien.

Robert Luberda wrote:

Hi Sebastien,

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

Regards,
robert

  




Sujet:
Bug#384307: sysstat: FTBFS (powerpc/ppc64): 'PAGE_SIZE' undeclared 
(first use in this function)

Expéditeur:
Andreas Jochens <[EMAIL PROTECTED]>
Date:
Wed, 23 Aug 2006 13:54:27 +0200
Destinataire:
Debian Bug Tracking System <[EMAIL PROTECTED]>

Destinataire:
Debian Bug Tracking System <[EMAIL PROTECTED]>


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.0 +
+++ ./common.c  2006-08-23 11:20:05.0 +
@@ -29,13 +29,6 @@
 #include 
 #include 
 
-/*

- * For PAGE_SIZE (which may be itself a call to getpagesize()).
- * PAGE_SHIFT no longer necessarily exists in . So
- * we use PAGE_SIZE to compute PAGE_SHIFT...
- */
-#include 
-
 #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;



  



--
Sébastien Godard (sysstat  wanadoo.fr)
http://perso.orange.fr/sebastien.godard/