nitingupta910 / compcache

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

hg source doesn't compile #49

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. make

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

Linux 2.6.32, compcache from the hg

Please provide any additional information below.

Since the 0.6 doesn't work with 2.6.32 (issue #48), I tried the hg source
as of today, but it doesn't compile. There are 3 xvmalloc.h in the source
tree, which one shold be used?

make
make -C "/lib/modules/2.6.32/build" M=/tmp/compcache modules
make[1]: Entering directory `/usr/src/linux-2.6.32/HOST'
make -C /usr/src/linux-2.6.32 O=/usr/src/linux-2.6.32/HOST/. modules
  CC [M]  /tmp/compcache/ramzswap_drv.o
In file included from /tmp/compcache/ramzswap_drv.c:35:
/tmp/compcache/ramzswap_drv.h:19:22: error: xvmalloc.h: No such file or
directory
/tmp/compcache/ramzswap_drv.c: In function 'ramzswap_ioctl_get_stats':
/tmp/compcache/ramzswap_drv.c:264: error: implicit declaration of function
'xv_get_total_size_bytes'
/tmp/compcache/ramzswap_drv.c: In function 'ramzswap_free_page':
/tmp/compcache/ramzswap_drv.c:638: error: implicit declaration of function
'xv_get_object_size'
/tmp/compcache/ramzswap_drv.c:641: error: implicit declaration of function
'xv_free'
/tmp/compcache/ramzswap_drv.c: In function 'ramzswap_write':
/tmp/compcache/ramzswap_drv.c:895: error: implicit declaration of function
'xv_malloc'
/tmp/compcache/ramzswap_drv.c: In function 'reset_device':
/tmp/compcache/ramzswap_drv.c:1074: error: implicit declaration of function
'xv_destroy_pool'
/tmp/compcache/ramzswap_drv.c: In function 'ramzswap_ioctl_init_device':
/tmp/compcache/ramzswap_drv.c:1184: error: implicit declaration of function
'xv_create_pool'
/tmp/compcache/ramzswap_drv.c:1184: warning: assignment makes pointer from
integer without a cast
make[4]: *** [/tmp/compcache/ramzswap_drv.o] Error 1
make[3]: *** [_module_/tmp/compcache] Error 2
make[2]: *** [sub-make] Error 2
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.32/HOST'
make: *** [all] Error 2

Original issue reported on code.google.com by xming...@gmail.com on 3 Dec 2009 at 3:20

GoogleCodeExporter commented 8 years ago
As mentioned in the Makefile:

XVM = sub-projects/allocators/xvmalloc-kmod
EXTRA_CFLAGS    :=      -DCONFIG_RAMZSWAP_STATS         \
                        -I$(PWD)/$(XVM)                 \
                        -g -Wall

XVM gives version of xvmalloc to use and extra flags adds it to include search 
path.
The compilation works fine on my system. Not yet sure why its failing on your 
system.

Original comment by nitingupta910@gmail.com on 4 Dec 2009 at 1:43

GoogleCodeExporter commented 8 years ago
ok I see that now. My problem seem to be with $(PWD), after make -C
$(KERNEL_BUILD_PATH), the $(PWD) is obviously the kernel dir and not compcache 
dir.
It seems that my make is not expanding $(PWD) before (see
-I/usr/src/linux-2.6.32/sub-projects/allocators/xvmalloc-kmod below). I have to
hardcode it to get compcache to compile.

make -f /usr/src/linux-2.6.32/scripts/Makefile.build obj=/tmp/compcache
  gcc -Wp,-MD,/tmp/compcache/.ramzswap_drv.o.d  -nostdinc -isystem
/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.4/include -Iinclude -Iinclude2
-I/usr/src/linux-2.6.32/include -I/usr/src/linux-2.6.32/arch/x86/include 
-include
include/linux/autoconf.h   -I/tmp/compcache -D__KERNEL__ -Wall -Wundef
-Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common
-Werror-implicit-function-declaration -Wno-format-security
-fno-delete-null-pointer-checks -Os -m64 -march=k8 -mno-red-zone -mcmodel=kernel
-funit-at-a-time -maccumulate-outgoing-args -DCONFIG_AS_CFI=1
-DCONFIG_AS_CFI_SIGNAL_FRAME=1 -pipe -Wno-sign-compare
-fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow
-fno-stack-protector -fomit-frame-pointer -Wdeclaration-after-statement
-Wno-pointer-sign -fno-strict-overflow -DCONFIG_RAMZSWAP_STATS  
-I/usr/src/linux-2.6.32/sub-projects/allocators/xvmalloc-kmod -g -Wall  -DMODULE
-D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(ramzswap_drv)" 
-D"KBUILD_MODNAME=KBUILD_STR(ramzswap)"  -c -o /tmp/compcache/ramzswap_drv.o
/tmp/compcache/ramzswap_drv.c

Original comment by xming...@gmail.com on 4 Dec 2009 at 10:16

GoogleCodeExporter commented 8 years ago
/me wonders whats a more portable way to create such Makefile.

Original comment by nitingupta910@gmail.com on 12 Dec 2009 at 1:56

GoogleCodeExporter commented 8 years ago
I am using gmake on Linux, I suppose you do too. I don't understand what you 
mean by
"portable", we are suppose to be on the same platform using the same make (GNU
version), unless the version of gmake does matter.

$ make -v
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for x86_64-pc-linux-gnu

Original comment by xming...@gmail.com on 15 Dec 2009 at 6:24

GoogleCodeExporter commented 8 years ago
I mentioned/ "portable" in a casual sense -- i meant how to create makefile 
that runs
on, at least slightly, different environments. However, it looks like there is 
zero
diff here. On my system:

$ make -v
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for x86_64-redhat-linux-gnu

Original comment by nitingupta910@gmail.com on 15 Dec 2009 at 6:32

GoogleCodeExporter commented 8 years ago

Original comment by nitingupta910@gmail.com on 12 Jan 2010 at 1:31