[Pvfs2-developers] building kernel module for different arch

Phil Carns carns at mcs.anl.gov
Sat Feb 16 17:24:53 EST 2008


I don't know how many people this is useful to, but there is a new tweak 
in the configure script to try to do the right thing with kernel headers 
if the ARCH environment variable is present.

One example would be to build pvfs2 against a kernel source tree 
configured for user mode linux.  You can now just do something like this 
to generate a working module:

   ./configure --with-kernel=/usr/src/linux-2.6.21-uml ARCH=um
   make all kmod ARCH=um

I've also tested this against a kernel tree configured for ARCH=ppc and 
it seems to work fine there as well.

The reason this is needed is because when you build against a kernel 
tree with a different arch than the build system, the configure script 
is guessing incorrect compile flags.  All this does is add one extra 
arch include path that seems to be enough to make the configure tests 
match what will happen at build time.  Previously you had to work around 
this by forcing extra CFLAGS for the entire build or manually tweaking 
pvfs2-config.h.

What I had really hoped to do was capture the verbatim CFLAGS that the 
kernel build process would use (in case there is anything else important 
there besides the include paths).  This didn't work, though.  The kernel 
makefile generates CFLAGS with some relative include paths and also adds 
-W flags that interfere with the existing configure tests.

-Phil


More information about the Pvfs2-developers mailing list