On Tue, Jun 10, 2008 at 01:10:25PM +0300, Ian Brown wrote: > I want to build a module for different kernels on the same machine. > > My machine has Fedora release 9, with 2.6.25-14 kernel. (x86_64). > > I want to build my module for Fedora release 6 (2.6.18-1.2798 kernel), > but on the Fedora 9 machine. > > I had installed kernel-devel-2.6.18-1.2798.fc6.x86_64. > I had pointed my Makefile to build against this kernel-devel tree. > The build finished ok. I copied the module to the FC6 machine. > When trying "insmod myModule.ko" on the FC6 machine, I get: > insmod: error inserting 'myModule.ko': -1 Invalid module format > and in the kernel log, I see: > Jun 10 12:58:11 Aplaton kernel: myModule: version magic '2.6.18-1.2798.fc6 SMP > mod_unload gcc-4.3' should be '2.6.18-1.2798.fc6 SMP mod_unload gcc-4.1 > > I found out that the FC6 machine has gcc-4.1.1-30, whereas the FC9 machine > has gcc-4.3.0-8. > My question is: > is there a way to let gcc-4.3.0-8 "think" that it is gcc-4.1.1-30 , so that > I will be able to build and insmod the FC6 module on FC9? No. Even if you could trick gcc 4.3.0 to report it is gcc 4.1.1, there could still be the problem that 4.3 emits different code (mostly calling conventions, but also structure layouts) from 4.1.1. > Or should I install two version of gcc on the F9 machine (And I am not > sure it is possible).? You could try to do that. Another trick is to install fc6 with the correct compiler in a virtual machine (like qemu), or in a chroot. Erik -- Erik Mouw -- mouw@xxxxxxxxxxxx
Attachment:
signature.asc
Description: Digital signature