Bug#384312: xawtv: FTBFS (powerpc/ppc64): 'PAGE_MASK' undeclared (first use in this function)
Package: xawtv
Version: 3.95-2
Severity: serious
Tags: patch
When building 'xawtv' on powerpc/unstable,
I get the following error:
CC console/fbtv.o
In file included from console/fbtv.c:31:
./libng/grab-ng.h:28:1: warning: "bool" redefined
In file included from /usr/include/curses.h:161,
from console/fbtv.c:24:
/usr/lib/gcc/powerpc64-linux-gnu/4.1.2/include/stdbool.h:36:1: warning: this is the location of the previous definition
console/fbtv.c: In function 'text_out':
console/fbtv.c:341: warning: pointer targets in passing argument 4 of 'fs_puts' differ in signedness
console/fbtv.c: In function 'text_width':
console/fbtv.c:347: warning: pointer targets in passing argument 2 of 'fs_textwidth' differ in signedness
console/fbtv.c: In function 'main':
console/fbtv.c:813: warning: pointer targets in assignment differ in signedness
CC console/fbtools.o
console/fbtools.c: In function 'fb_init':
console/fbtools.c:427: error: 'PAGE_MASK' undeclared (first use in this function)
console/fbtools.c:427: error: (Each undeclared identifier is reported only once
console/fbtools.c:427: error: for each function it appears in.)
make[1]: *** [console/fbtools.o] Error 1
make[1]: Leaving directory `/xawtv-3.95'
make: *** [build-stamp] Error 2
With the attached patch 'xawtv' can be compiled on powerpc.
Regards
Andreas Jochens
diff -urN ../tmp-orig/xawtv-3.95/console/fbtools.c ./console/fbtools.c
--- ../tmp-orig/xawtv-3.95/console/fbtools.c 2003-02-14 14:14:04.000000000 +0000
+++ ./console/fbtools.c 2006-08-23 10:57:40.000000000 +0000
@@ -21,8 +21,6 @@
#include <linux/vt.h>
#include <linux/fb.h>
-#include <asm/page.h>
-
#include "fbtools.h"
/* -------------------------------------------------------------------- */
@@ -424,7 +422,7 @@
goto err;
}
#endif
- fb_mem_offset = (unsigned long)(fb_fix.smem_start) & (~PAGE_MASK);
+ fb_mem_offset = (unsigned long)(fb_fix.smem_start) & ~(sysconf(_SC_PAGE_SIZE)-1);
fb_mem = mmap(NULL,fb_fix.smem_len+fb_mem_offset,
PROT_READ|PROT_WRITE,MAP_SHARED,fb,0);
if (-1L == (long)fb_mem) {
diff -urN ../tmp-orig/xawtv-3.95/console/matrox.c ./console/matrox.c
--- ../tmp-orig/xawtv-3.95/console/matrox.c 2005-02-03 10:40:41.000000000 +0000
+++ ./console/matrox.c 2006-08-23 11:09:51.000000000 +0000
@@ -9,7 +9,6 @@
#include <sys/ioctl.h>
#include <sys/mman.h>
-#include <asm/page.h> /* PAGE_SIZE */
#include <linux/fb.h>
#include "byteswap.h"
@@ -226,7 +225,7 @@
return -1;
}
off = (unsigned long)fb_fix.mmio_start -
- ((unsigned long)fb_fix.mmio_start & ~(PAGE_SIZE-1));
+ ((unsigned long)fb_fix.mmio_start & ~(sysconf(_SC_PAGE_SIZE)-1));
bmmio += off;
mmio = (uint32_t*)bmmio;
return 0;
Reply to: