Re: Building Kernels and Kernel modules

Jakub Jelinek <[email protected]>
Newsgroups gmane.linux.aurora.devel
Message-ID <[email protected]>
On Tue, Apr 29, 2003 at 10:06:33AM +0100, Kevin Curtis wrote:
> Hi,
> 	At last I have got a Kernel to build (2.4.21.-pre7).  Now when I try
> to build our X.25 module I get the following error:
> 
> cd ~/develop/ia64x25/src/kernel/
> make 
> gcc -m64 -Wall -Wstrict-prototypes -DMODULE -D__KERNEL__ -DLINUX -DFSK_HP2FS
> -DCONFIG_X25_MODULE -DFSC_DEBUG=0 -O2	  -I/lib/modules/`uname
> -r`/build/include -I/usr/src/linux/include -I../lib   -c -o fsx25main.o
> fsx25main.c
> In file included from
> /lib/modules/2.4.21-pre7/build/include/asm/processor.h:23,
>                  from
> /lib/modules/2.4.21-pre7/build/include/linux/prefetch.h:13,
>                  from /lib/modules/2.4.21-pre7/build/include/linux/list.h:6,
>                  from
> /lib/modules/2.4.21-pre7/build/include/linux/module.h:12,
>                  from fsx25main.c:70:
> /lib/modules/2.4.21-pre7/build/include/asm/page.h:111: global register
> variable follows a function definition
> /lib/modules/2.4.21-pre7/build/include/asm/page.h:111: warning:
> call-clobbered register used for global register variable
> make: *** [fsx25main.o] Error 1

You need to use the same kgcc (or gcc) options and the same compiler
as the kernel has been built with, particularly you should make sure all
-f* and -m* options which are used for building modules normally are on
your command line.
For kgcc, the important options include
-m64 -mno-fpu -mtune=ultrasparc -mmedlow -ffixed-g4 -fcall-used-g5 -fcall-used-g7
and for gcc
-m64 -mno-fpu -mcpu=ultrasparc -mcmodel=medlow -ffixed-g4 -fcall-used-g5 -fcall-used-g7

	Jakub
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.