Re: Bug in page.h??? Asterisk/Zaptel
"Tom 'spot' Callaway" <[email protected]> Mon, 22 Nov 2004 14:27:42 -0600
| Newsgroups | gmane.linux.aurora.devel |
|---|---|
| Organization | Red Hat |
| Message-ID | <[email protected]> |
On Sun, 2004-11-21 at 23:42 -0500, Dean Anderson wrote:
> I was just trying to build asterisk on aurora 1.0, building the ztdummy
> module of zaptel as follows: The error seems to reveal a kernel bug in
> include/asm/page.h:111:
Not a bug, although I had to ask DaveM about this one. :)
Dave reminded me that "asm("g4")" is C syntax so
we can't use it in assembler core. __ASSEMBLY__ is defined
when the kernel is building a *.S file, and thus assembler.
Remember, sparc kernels us a lot of lovely voodoo. Lets look at your
compiler call:
> kgcc -I/lib/modules/2.4.20-2.3sparccustom/build//include -O6 -m64
> -DMODULE -D__KERNEL__ -DEXPORT_SYMTAB
> -I/lib/modules/2.4.20-2.3sparccustom/build//drivers/net -Wall -I.
> -Wstrict-prototypes -fomit-frame-pointer
> -I/lib/modules/2.4.20-2.3sparccustom/build//drivers/net/wan -I
> /lib/modules/2.4.20-2.3sparccustom/build//include
> -I/lib/modules/2.4.20-2.3sparccustom/build//include/net -DMODVERSIONS
> -include
> /lib/modules/2.4.20-2.3sparccustom/build/include/linux/modversions.h
> -DSTANDALONE_ZAPATA -c ztdummy.c
This might work for x86, but sparc kernels need a lot more love to build
properly. Quoting Ricky Beam:
...if this is on a sparc/sparc64, then a simple "gcc -foo" is NOT going
to work. The above register warning is a neon sign. Go build a kernel
and see what options are being used...
sparc64-linux-gcc -Wp,-MD,kernel/.acct.o.d -D__KERNEL__ -Iinclude -Wall
-Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common
-m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow -ffixed-g4 -fcall-used
-g5 -fcall-used-g7 -Wno-sign-compare -Wa,--undeclared-regs -pg -nostdinc
-iwithprefix include -DKBUILD_BASENAME=acct -DKBUILD_MODNAME=acct -c
-o kernel/.tmp_acct.o kernel/acct.c
Note the -ffixed-g4 and -fcall-used-g7 (among others.) Basically, to
get anything to work correctly, one needs to do exactly what the kernel
build process will do; and most of that magic is in the arch/.../Makefile.
hth,
~spot
---
Tom "spot" Callaway <tcallawa(a)redhat*com> LCA, RHCE
Red Hat Sales Engineer || Aurora Linux Project Leader
"If you are going through hell, keep going."
- Sir Winston Churchill
_______________________________________________
Aurora-sparc-devel mailing list
[email protected]
http://lists.auroralinux.org/mailman/listinfo/aurora-sparc-devel
Aurora FAQ: http://www.ecs.soton.ac.uk/~mas01r/aurorafaq.html