|
From: Miklos S. <mi...@sz...> - 2006-01-10 10:11:53
|
> I'd send you a patch, but this particular problem shines the spotlight on my
> ignorance concerning autoconf.
>
> After compiling the kernel module for kernel 2.4.21-37.EL (Redhat EL 3) on my
> x86_64 box, the insmod produces a slew of the following errors:
> # insmod fuse
> Using /lib/modules/2.4.21-37.ELsmp/kernel/fs/fuse/fuse.o
> /lib/modules/2.4.21-37.ELsmp/kernel/fs/fuse/fuse.o: Possibly is module
> compiled without -mcmodel=kernel!
> /lib/modules/2.4.21-37.ELsmp/kernel/fs/fuse/fuse.o: Relocation overflow
> of type 10 for .rodata.str1.1
> [.... ad nauseum]
>
> Of course, kernel modules need '-mcmodel=kernel' flag to use the proper
> addressing on x86_64 architectures. This and other such options for x86_64 are
> enumerated in /usr/src/linux-2.4.21-37.EL/arch/x86_64/Makefile. To test it, I
> added those flags to fusedir/kernel/Makefile (the one generated by a standard
> ./configure on my system).
> The original line was:
> CPPFLAGS = -I/usr/src/linux-2.4.21-37.EL/include -I. -D__KERNEL__ -DMODULE
> -D_LOOSE_KERNEL_NAMES -DFUSE_VERSION=\"$(VERSION)\"
> and so I appended the following:
> -mno-red-zone -mcmodel=kernel -pipe -fno-reorder-blocks -finline-limit=2000
>
> It seems to work fine now.
Here's a patch. Can you check if it works for you?
Thanks,
Miklos
Index: kernel/configure.ac
===================================================================
RCS file: /cvsroot/fuse/fuse/kernel/configure.ac,v
retrieving revision 1.49
diff -u -r1.49 configure.ac
--- kernel/configure.ac 6 Jan 2006 18:29:39 -0000 1.49
+++ kernel/configure.ac 10 Jan 2006 10:05:01 -0000
@@ -110,6 +110,12 @@
KERNELCFLAGS="$CFLAGS"
fi
CFLAGS="$old_cflags"
+ AC_MSG_CHECKING([architecture])
+ arch=`/bin/ls -l ${kernelsrc}/include/asm | sed "s/.*-> asm-//"`
+ AC_MSG_RESULT([$arch])
+ if test "$arch" = x86_64; then
+ KERNELCFLAGS="$KERNELCFLAGS -mno-red-zone -mcmodel=kernel -fno-reorder-blocks -finline-limit=2000"
+ fi
else
fuse_configured=no
kernel_autoconf=$kernelbuild/include/linux/autoconf.h
|