tthtlc / compcache

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

older kernel (2.6.12) compile issue #30

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm trying to compile compcache for an older kernel on an DNS-323 network 
attached storage 
embedded arm device.  Since I needed gcc 3.4.6 I went the route of chrooting 
into Debian Etch to 
install gcc kernel-packages (compile dependencies, etc).  Built the dlink 
kernel (from DNS-323 
Firmware 1.06, a modified 2.6.12) then tried compile compcache.

(After adding the symlink //lib/modules/2.6.12.6-arm1/build -> 
/usr/src/linux-2.6.12.6)

Results:

root@dlink-nas:/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod# 
make
make -C /lib/modules/2.6.12.6-arm1/build M=/usr/src/compcache-0.5.3/sub-
projects/allocators/xvmalloc-kmod modules
make[1]: Entering directory `/usr/src/linux-2.6.12.6'
  CC [M]  /usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.o
In file included from /usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-
kmod/xvmalloc.c:22:
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.h:24: 
error: 
syntax error before "gfp_t"
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.h:24: 
warning: 
function declaration isn't a prototype
In file included from /usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-
kmod/xvmalloc.c:23:
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc_int.h:78
: 
warning: implicit declaration of function `DIV_ROUND_UP'
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc_int.h:78
: error: 
variable-size type declared outside of any function
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c: In 
function 
`test_flag':
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:37: 
warning: 
implicit declaration of function `BIT'
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c: At 
top level:
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:54: 
warning: 
"enum km_type" declared inside parameter list
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:54: 
warning: its 
scope is only this definition or declaration, which is probably not what you 
want
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:55: 
error: 
parameter `type' has incomplete type
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:62: 
warning: 
"enum km_type" declared inside parameter list
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:63: 
error: 
parameter `type' has incomplete type
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:109: 
error: 
syntax error before "flags"
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:110: 
warning: 
function declaration isn't a prototype
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c: In 
function 
`xv_alloc_page':
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:114: 
error: 
`flags' undeclared (first use in this function)
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:114: 
error: 
(Each undeclared identifier is reported only once
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:114: 
error: for 
each function it appears in.)
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c: In 
function 
`insert_block':
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:222: 
error: 
`KM_USER1' undeclared (first use in this function)
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c: In 
function 
`remove_block_head':
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:257: 
error: 
`KM_USER1' undeclared (first use in this function)
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c: In 
function 
`remove_block':
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:283: 
error: 
`KM_USER1' undeclared (first use in this function)
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c: At 
top level:
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:303: 
error: 
syntax error before "gfp_t"
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:304: 
warning: 
function declaration isn't a prototype
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c: In 
function 
`grow_pool':
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:308: 
error: 
`flags' undeclared (first use in this function)
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:312: 
error: 
`pool' undeclared (first use in this function)
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:315: 
error: 
`KM_USER0' undeclared (first use in this function)
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c: In 
function 
`xv_create_pool':
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:339: 
warning: 
implicit declaration of function `roundup'
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:340: 
warning: 
implicit declaration of function `kzalloc'
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:340: 
warning: 
assignment makes pointer from integer without a cast
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c: At 
top level:
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:370: 
error: 
syntax error before "gfp_t"
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:371: 
warning: 
function declaration isn't a prototype
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c: In 
function 
`xv_malloc':
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:376: 
error: 
`pagenum' undeclared (first use in this function)
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:377: 
error: 
`offset' undeclared (first use in this function)
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:378: 
error: 
`size' undeclared (first use in this function)
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:385: 
error: 
`pool' undeclared (first use in this function)
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:391: 
error: 
`flags' undeclared (first use in this function)
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:391: 
error: 
`GFP_NOWAIT' undeclared (first use in this function)
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:406: 
error: 
`KM_USER0' undeclared (first use in this function)
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c: In 
function 
`xv_free':
/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:457: 
error: 
`KM_USER0' undeclared (first use in this function)
make[2]: *** 
[/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod/xvmalloc.o] 
Error 1
make[1]: *** 
[_module_/usr/src/compcache-0.5.3/sub-projects/allocators/xvmalloc-kmod] 
Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.12.6'

My attempts so far:
typedef gfp_t -> removed the error at least...
manually adding some macros to kernel.h -> fixed the div_roundup related errors

Are these errors just because I have an older kernel or is this something wrong 
with my includes?

Any ideas on how to resolve this?

Original issue reported on code.google.com by tbea...@gmail.com on 6 Jun 2009 at 12:56

GoogleCodeExporter commented 9 years ago
I think it should not be too difficult to get it working on 2.6.12. I will try 
to
look into this soon.

Original comment by nitingupta910@gmail.com on 8 Jun 2009 at 5:43

GoogleCodeExporter commented 9 years ago
Fixed. Please clone hg repository to test the fix:

hg clone http://compcache.googlecode.com/hg/ compcache

Original comment by nitingupta910@gmail.com on 18 Jun 2009 at 3:49

GoogleCodeExporter commented 9 years ago
The proper fix would be to not use an ancient kernel ;-).  Here are the errors 
for the record, though.

# make
make -C /lib/modules/2.6.12.6-arm1/build \
                M=/root/compcache/sub-projects/allocators/xvmalloc-kmod modules
make[1]: Entering directory `/usr/src/linux-2.6.12.6'
  CC [M]  /root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.o
In file included from 
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:22:
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.h:24: error: 
syntax error before "gfp_t"
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.h:24: warning: 
function declaration isn't 
a prototype
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c: In function 
`test_flag':
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:37: warning: 
implicit declaration of 
function `BIT'
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c: At top level:
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:54: warning: 
"enum km_type" declared 
inside parameter list
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:54: warning: 
its scope is only this 
definition or declaration, which is probably not what you want
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:55: error: 
parameter `type' has 
incomplete type
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:62: warning: 
"enum km_type" declared 
inside parameter list
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:63: error: 
parameter `type' has 
incomplete type
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:109: error: 
syntax error before "flags"
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:110: warning: 
function declaration 
isn't a prototype
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c: In function 
`xv_alloc_page':
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:113: error: 
`flags' undeclared (first 
use in this function)
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:113: error: 
(Each undeclared identifier 
is reported only once
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:113: error: 
for each function it 
appears in.)
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c: In function 
`insert_block':
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:221: error: 
`KM_USER1' undeclared 
(first use in this function)
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c: In function 
`remove_block_head':
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:256: error: 
`KM_USER1' undeclared 
(first use in this function)
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c: In function 
`remove_block':
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:282: error: 
`KM_USER1' undeclared 
(first use in this function)
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c: At top level:
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:302: error: 
syntax error before "gfp_t"
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:303: warning: 
function declaration 
isn't a prototype
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c: In function 
`grow_pool':
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:307: error: 
`flags' undeclared (first 
use in this function)
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:311: error: 
`pool' undeclared (first use 
in this function)
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:314: error: 
`KM_USER0' undeclared 
(first use in this function)
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c: In function 
`xv_create_pool':
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:339: warning: 
implicit declaration of 
function `kzalloc'
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:339: warning: 
assignment makes 
pointer from integer without a cast
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c: At top level:
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:369: error: 
syntax error before "gfp_t"
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:370: warning: 
function declaration 
isn't a prototype
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c: In function 
`xv_malloc':
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:375: error: 
`pagenum' undeclared 
(first use in this function)
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:376: error: 
`offset' undeclared (first 
use in this function)
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:377: error: 
`size' undeclared (first use 
in this function)
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:382: warning: 
type defaults to `int' in 
declaration of `type name'
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:382: warning: 
type defaults to `int' in 
declaration of `type name'
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:384: error: 
`pool' undeclared (first use 
in this function)
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:390: error: 
`flags' undeclared (first 
use in this function)
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:390: error: 
`GFP_NOWAIT' undeclared 
(first use in this function)
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:405: error: 
`KM_USER0' undeclared 
(first use in this function)
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c: In function 
`xv_free':
/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.c:456: error: 
`KM_USER0' undeclared 
(first use in this function)
make[2]: *** [/root/compcache/sub-projects/allocators/xvmalloc-kmod/xvmalloc.o] 
Error 1
make[1]: *** [_module_/root/compcache/sub-projects/allocators/xvmalloc-kmod] 
Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.12.6'

Original comment by tbea...@gmail.com on 18 Jun 2009 at 7:09

GoogleCodeExporter commented 9 years ago
Yeah, best thing to do is not to use these pre-historic kernels.

Anyway, these errors are strange since the 'missing' functions are defined in
compache/compat.h and sub-projects/allocators/xvmalloc-kmod/compat.h. I also 
tested
by compiling against 2.6.12 using gcc 3.4.6.

Original comment by nitingupta910@gmail.com on 19 Jun 2009 at 3:43

GoogleCodeExporter commented 9 years ago
I had the same issue trying to build compcache 0.5.4 for the Nokia N8x0, kernel 
2.6.21 (omap branch)
I finally solved it by adding some defines to "compat.h" files. See attached 
patch (against compcache 0.5.4)

Original comment by maac...@gmail.com on 3 Jan 2011 at 9:21

Attachments: