From: Sean Z. <sb...@ec...> - 2006-01-09 22:35:54
|
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 is where I'm a bit lost. I would think that fusedir/kernel/configure.ac needs to have KERNELCPPFLAGS set to '-mcmodel=kernel' whenever it detects x86_64. This may not be an issue for 2.6 kernels, so some checking may be in order there as well. However, I'm not sure of the best way to do all of that. Obviously, I don't want to break things if they are working for other kernels on x86_64. |