| PLEX86 | ||
|
math functions in moduleOn Tue, 22 Feb 2005 15:52:53 GMT, Max staggered into the Black Sun and said: Why are printers such a hbuttle Why is it that every printer comes with a CD-Rom containing it's driver? Why doesn't ANSI just come up with some standards for ways printers are... What do you mean by "module" here? If your app uses functions defined so: gcc -c mymathprogram.c gcc -o mymathprogram mymathprogram.o -lm ...then the executable will link against libm.a and use libm.so at runtime. If libm.so will not be available at runtime, you will have to link the whole program statically (annoying) or link the math library statically. I don't remember how to link against one library statically, and other libraries dynamically, but there's got to be a way to do that. If you meant "How can I use floating-point math in a kernel module?" , then you can't with the Linux kernel. Linus says "no floating point math in kernel space", and gcc will not compile a kernel module that includes floating point math0. What happens if your kernel code throws an FPU exception? Bad things, and AFAICT the kernel developers haven't yet worked out a way to do the right thing in that case. 0 You can define floats and doubles in a kernel module, but if you do math with them, gcc complains. -- Matt GThere is no Darkness in Eternity-But only Light too dim for us to see Brainbench MVP for Linux Admin mail: TRAP + SPAN don't belong
|
||||