tthtlc / compcache

Automatically exported from code.google.com/p/compcache
0 stars 0 forks source link

Make fails in Maemo 5 SDK #54

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Download latest source from mercurial
2. Run make in latest Maemo 5 SDK, with KERNEL_BUILD_PATH pointing to
kernel headers

What version of the product are you using? On what operating system?

Latest mercurial sources:
changeset:   124:7f18e56b4acb
tag:         tip
user:        Nitin Gupta <ngupta@vflare.org>
date:        Sun Jan 24 14:53:50 2010 +0530
summary:     Fix crash when backing_swap is busy

Error messages from make:
[sbox-FREMANTLE_ARMEL: ~/compcache] > make
KERNEL_BUILD_PATH=/usr/src/kernel-headers
make -C /usr/src/kernel-headers M=/home/locusf/compcache modules          

make[1]: Entering directory
`/targets/FREMANTLE_ARMEL/usr/src/kernel-headers'       
  CC [M]  /home/locusf/compcache/ramzswap_drv.o                           

In file included from /home/locusf/compcache/ramzswap_drv.c:35:           

/home/locusf/compcache/ramzswap_drv.h:85: error: expected ')' before '*'
token      
/home/locusf/compcache/ramzswap_drv.h:89: error: expected ')' before '*'
token      
/home/locusf/compcache/ramzswap_drv.h:132: error: expected
specifier-qualifier-list before 'atomic64_t'
/home/locusf/compcache/ramzswap_drv.c: In function
'ramzswap_ioctl_get_stats':                         
/home/locusf/compcache/ramzswap_drv.c:268: error: 'struct ramzswap_stats'
has no member named 'pages_expand'
/home/locusf/compcache/ramzswap_drv.c:269: error: implicit declaration of
function 'atomic64_read'          
/home/locusf/compcache/ramzswap_drv.c:269: error: 'struct ramzswap_stats'
has no member named 'num_writes'  
/home/locusf/compcache/ramzswap_drv.c:270: error: 'struct ramzswap_stats'
has no member named 'failed_writes'
/home/locusf/compcache/ramzswap_drv.c:272: error: 'struct ramzswap_stats'
has no member named 'pages_stored' 
/home/locusf/compcache/ramzswap_drv.c:273: error: 'struct ramzswap_stats'
has no member named 'good_compress'
/home/locusf/compcache/ramzswap_drv.c:274: error: 'struct ramzswap_stats'
has no member named 'pages_stored' 
/home/locusf/compcache/ramzswap_drv.c:275: error: 'struct ramzswap_stats'
has no member named 'pages_expand' 
/home/locusf/compcache/ramzswap_drv.c:276: error: 'struct ramzswap_stats'
has no member named 'pages_stored' 
/home/locusf/compcache/ramzswap_drv.c:279: error: 'struct ramzswap_stats'
has no member named 'num_reads'    
/home/locusf/compcache/ramzswap_drv.c:280: error: 'struct ramzswap_stats'
has no member named 'num_writes'   
/home/locusf/compcache/ramzswap_drv.c:281: error: 'struct ramzswap_stats'
has no member named 'failed_reads' 
/home/locusf/compcache/ramzswap_drv.c:282: error: 'struct ramzswap_stats'
has no member named 'failed_writes'
/home/locusf/compcache/ramzswap_drv.c:283: error: 'struct ramzswap_stats'
has no member named 'invalid_io'   
/home/locusf/compcache/ramzswap_drv.c:284: error: 'struct ramzswap_stats'
has no member named 'notify_free'  
/home/locusf/compcache/ramzswap_drv.c:285: error: 'struct ramzswap_stats'
has no member named 'pages_zero'   
/home/locusf/compcache/ramzswap_drv.c:290: error: 'struct ramzswap_stats'
has no member named 'pages_stored' 
/home/locusf/compcache/ramzswap_drv.c:292: error: 'struct ramzswap_stats'
has no member named 'pages_stored'
/home/locusf/compcache/ramzswap_drv.c:296: error: 'struct ramzswap_stats'
has no member named 'bdev_num_reads'
/home/locusf/compcache/ramzswap_drv.c:297: error: 'struct ramzswap_stats'
has no member named 'bdev_num_writes'
/home/locusf/compcache/ramzswap_drv.c: In function 'ramzswap_free_page':
/home/locusf/compcache/ramzswap_drv.c:634: error: 'struct ramzswap_stats'
has no member named 'pages_zero'
/home/locusf/compcache/ramzswap_drv.c:643: error: 'struct ramzswap_stats'
has no member named 'pages_expand'
/home/locusf/compcache/ramzswap_drv.c:653: error: 'struct ramzswap_stats'
has no member named 'good_compress'
/home/locusf/compcache/ramzswap_drv.c:657: error: 'struct ramzswap_stats'
has no member named 'pages_stored'
/home/locusf/compcache/ramzswap_drv.c: In function 'handle_ramzswap_fault':
/home/locusf/compcache/ramzswap_drv.c:719: error: implicit declaration of
function 'stat64_dec'
/home/locusf/compcache/ramzswap_drv.c:719: error: 'struct ramzswap_stats'
has no member named 'num_reads'
/home/locusf/compcache/ramzswap_drv.c:720: error: implicit declaration of
function 'stat64_inc'
/home/locusf/compcache/ramzswap_drv.c:720: error: 'struct ramzswap_stats'
has no member named 'bdev_num_reads'
/home/locusf/compcache/ramzswap_drv.c: In function 'ramzswap_read':
/home/locusf/compcache/ramzswap_drv.c:758: error: 'struct ramzswap_stats'
has no member named 'num_reads'
/home/locusf/compcache/ramzswap_drv.c:792: error: 'struct ramzswap_stats'
has no member named 'failed_reads'
/home/locusf/compcache/ramzswap_drv.c: In function 'ramzswap_write':
/home/locusf/compcache/ramzswap_drv.c:816: error: 'struct ramzswap_stats'
has no member named 'num_writes'
/home/locusf/compcache/ramzswap_drv.c:840: error: 'struct ramzswap_stats'
has no member named 'pages_zero'
/home/locusf/compcache/ramzswap_drv.c:863: error: 'struct ramzswap_stats'
has no member named 'failed_writes'
/home/locusf/compcache/ramzswap_drv.c:886: error: 'struct ramzswap_stats'
has no member named 'failed_writes'
/home/locusf/compcache/ramzswap_drv.c:892: error: 'struct ramzswap_stats'
has no member named 'pages_expand'
/home/locusf/compcache/ramzswap_drv.c:904: error: 'struct ramzswap_stats'
has no member named 'failed_writes'
/home/locusf/compcache/ramzswap_drv.c:933: error: 'struct ramzswap_stats'
has no member named 'pages_stored'
/home/locusf/compcache/ramzswap_drv.c:935: error: 'struct ramzswap_stats'
has no member named 'good_compress'
/home/locusf/compcache/ramzswap_drv.c:945: error: 'struct ramzswap_stats'
has no member named 'bdev_num_writes'
/home/locusf/compcache/ramzswap_drv.c: In function 'ramzswap_make_request':
/home/locusf/compcache/ramzswap_drv.c:1007: error: 'struct ramzswap_stats'
has no member named 'invalid_io'
make[2]: *** [/home/locusf/compcache/ramzswap_drv.o] Error 1
make[1]: *** [_module_/home/locusf/compcache] Error 2
make[1]: Leaving directory `/targets/FREMANTLE_ARMEL/usr/src/kernel-headers'
make: *** [all] Error 2

I guess the problems are related to the data types in the stats collection.

Original issue reported on code.google.com by suomalai...@gmail.com on 24 Jan 2010 at 3:35

GoogleCodeExporter commented 9 years ago
I am using the ARMEL target, just to be clear on this :). So is there a way to 
fix
this, ie. does the ARM architecture support atomic64_t structures or such?

Original comment by suomalai...@gmail.com on 24 Jan 2010 at 3:36

GoogleCodeExporter commented 9 years ago
I just pushed changes that should fix it. Can you pull again and try?

Original comment by nitingupta910@gmail.com on 24 Jan 2010 at 4:23

GoogleCodeExporter commented 9 years ago
Now I get some compilation errors:

/home/locusf/compcache/ramzswap_drv.c: In function 'ramzswap_ioctl_get_stats':
/home/locusf/compcache/ramzswap_drv.c:269: error: implicit declaration of 
function
'stat64_read'
/home/locusf/compcache/ramzswap_drv.c: In function 'ramzswap_free_page':
/home/locusf/compcache/ramzswap_drv.c:634: error: implicit declaration of 
function
'stat_dec'
/home/locusf/compcache/ramzswap_drv.c: In function 'handle_ramzswap_fault':
/home/locusf/compcache/ramzswap_drv.c:719: error: implicit declaration of 
function
'stat64_dec'
/home/locusf/compcache/ramzswap_drv.c:720: error: implicit declaration of 
function
'stat64_inc'
/home/locusf/compcache/ramzswap_drv.c: In function 'ramzswap_write':
/home/locusf/compcache/ramzswap_drv.c:840: error: implicit declaration of 
function
'stat_inc'
/home/locusf/compcache/ramzswap_drv.c: In function 'create_device':
/home/locusf/compcache/ramzswap_drv.c:1359: error: 'struct ramzswap' has no 
member
named 'stat64_lock'
make[2]: *** [/home/locusf/compcache/ramzswap_drv.o] Error 1

Original comment by suomalai...@gmail.com on 24 Jan 2010 at 4:46

GoogleCodeExporter commented 9 years ago
Weird. I'm not getting any error when cross compiling on ARM (kernel:
2.6.30.10-105.2.4.fc11). Whats the kernel version you are compiling against?

Anyway, I now pushed changes which explicitly includes spinlock.h which should 
solve
this. Can you please try again? Thanks.

If you still get any errors, please post full compiler output (not just error 
part)
in verbose mode (make V=1).

Original comment by nitingupta910@gmail.com on 24 Jan 2010 at 5:00

GoogleCodeExporter commented 9 years ago
I believe that the kernel is 2.6.28-omap1, for the N900.

I'll try the new version.

Original comment by suomalai...@gmail.com on 24 Jan 2010 at 5:10

GoogleCodeExporter commented 9 years ago
Hmm the Maemo 5 headers do not contain the spinlock.h file, so the compilation 
still
fails ...

Original comment by suomalai...@gmail.com on 24 Jan 2010 at 5:27

GoogleCodeExporter commented 9 years ago
Oh yeah, here is the verbose make error:
[sbox-FREMANTLE_ARMEL: ~/compcache] > make 
KERNEL_BUILD_PATH=/usr/src/kernel-headers V=1
make -C /usr/src/kernel-headers M=/home/locusf/compcache modules
make[1]: Entering directory `/targets/FREMANTLE_ARMEL/usr/src/kernel-headers'
test -e include/linux/autoconf.h -a -e include/config/auto.conf || (            
\
        echo;                                                           \
        echo "  ERROR: Kernel configuration is invalid.";               \
        echo "         include/linux/autoconf.h or include/config/auto.conf are
missing.";      \
        echo "         Run 'make oldconfig && make prepare' on kernel src to fix it.";  \
        echo;                                                           \
        /bin/false)
mkdir -p /home/locusf/compcache/.tmp_versions ; rm -f
/home/locusf/compcache/.tmp_versions/*
make -f scripts/Makefile.build obj=/home/locusf/compcache
  arm-linux-gcc -Wp,-MD,/home/locusf/compcache/.ramzswap_drv.o.d  -nostdinc -isystem
/scratchbox/compilers/cs2007q3-glibc2.5-arm7/bin/../lib/gcc/arm-none-linux-gnuea
bi/4.2.1/include
-D__KERNEL__ -Iinclude 
-I/targets/FREMANTLE_ARMEL/usr/src/kernel-headers/arch/arm/include -include
include/linux/autoconf.h -mlittle-endian -Iarch/arm/mach-omap2/include
-Iarch/arm/plat-omap/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs
-fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Os -marm
-fno-omit-frame-pointer -mapcs -mno-sched-prolog -mabi=aapcs-linux
-mno-thumb-interwork -D__LINUX_ARM_ARCH__=7 -march=armv7-a -msoft-float -Uarm
-fno-stack-protector -fno-omit-frame-pointer -fno-optimize-sibling-calls -g
-Wdeclaration-after-statement -Wno-pointer-sign -DCONFIG_RAMZSWAP_STATS -Wall
-DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(ramzswap_drv)" 
-D"KBUILD_MODNAME=KBUILD_STR(ramzswap)"  -c -o
/home/locusf/compcache/.tmp_ramzswap_drv.o /home/locusf/compcache/ramzswap_drv.c
/home/locusf/compcache/ramzswap_drv.c: In function 'ramzswap_ioctl_get_stats':
/home/locusf/compcache/ramzswap_drv.c:268: error: implicit declaration of 
function
'stat64_read'
/home/locusf/compcache/ramzswap_drv.c: In function 'ramzswap_free_page':
/home/locusf/compcache/ramzswap_drv.c:633: error: implicit declaration of 
function
'stat_dec'
/home/locusf/compcache/ramzswap_drv.c: In function 'handle_ramzswap_fault':
/home/locusf/compcache/ramzswap_drv.c:718: error: implicit declaration of 
function
'stat64_dec'
/home/locusf/compcache/ramzswap_drv.c:719: error: implicit declaration of 
function
'stat64_inc'
/home/locusf/compcache/ramzswap_drv.c: In function 'ramzswap_write':
/home/locusf/compcache/ramzswap_drv.c:839: error: implicit declaration of 
function
'stat_inc'
/home/locusf/compcache/ramzswap_drv.c: In function 'create_device':
/home/locusf/compcache/ramzswap_drv.c:1358: error: 'struct ramzswap' has no 
member
named 'stat64_lock'
make[2]: *** [/home/locusf/compcache/ramzswap_drv.o] Error 1
make[1]: *** [_module_/home/locusf/compcache] Error 2
make[1]: Leaving directory `/targets/FREMANTLE_ARMEL/usr/src/kernel-headers'
make: *** [all] Error 2

Original comment by suomalai...@gmail.com on 24 Jan 2010 at 5:33

GoogleCodeExporter commented 9 years ago
> Hmm the Maemo 5 headers do not contain the spinlock.h file, so the 
compilation still
fails ...

I don't understand Maemo installation setup but on Fedora, you need to have
kernel-devel (not kernel-headers) package in order to compile any module against
running kernel. This package also provides spinlock.h.

So, maybe you are missing corresponding package on Maemo?

Original comment by nitingupta910@gmail.com on 24 Jan 2010 at 5:58

GoogleCodeExporter commented 9 years ago
Ok, it works now, thanks :). I did a wrong kind of merge and had to revert it 
to the
mercurial repository default.

Original comment by suomalai...@gmail.com on 24 Jan 2010 at 6:43

GoogleCodeExporter commented 9 years ago
Ok, at least the original bug due to atomic64_t is fixed. Thanks for reporting 
this :)

Original comment by nitingupta910@gmail.com on 24 Jan 2010 at 7:46