Re: which gcc version?

Bart Trojanowski (bart@jukie.net)
Thu, 5 Apr 2001 07:37:03 -0400 (EDT)


On Thu, 5 Apr 2001, Manoj Sontakke wrote:

> Addition and subtraction works fine. The problem is with multiplication
> and division. I am doing this to avoid floating point calculation and
> doing fixed point calculation. The rage is large enough to need "long
> long" Any other way to achieve this?

gcc requires a function call to do a mul/div on a long long. There is no
easy way to do a 64bit op of this type on a 32 bit CPU...

IFF you are making a module that will never be part of the kernel tree you
can get away with adding `gcc -print-libgcc-file-name` to your link line.
And by that I mean:

${LD} ${LDFLAGS} -o $@ $< `gcc -print-libgcc-file-name`

This is a hack that will link in the __div3 function from glibc into your
module. NOTE that this will never be done for you in the kernel... so if
you can don't use div or mul on long long.

Cheers,
Bart.

-- 
	WebSig: http://www.jukie.net/~bart/sig/

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/