"long long" division

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
paulbarker

Re:"long long" division

Post by paulbarker »

A bucket of paranoia?

I think osdevers should have a minimum of a metric tonne.

The only problem I can forsee is bugs caused by a user using a different version of the compiler to the developer. These problems crop up anyway without builtins, so I dont see anywhere that builtins add any difficulties that could be avoided by not using them.
NOTNULL

Re:"long long" division

Post by NOTNULL »

Pype.Clicker wrote: iirc, functions for long long division require some library code (that should be in the "language support library" libgcc.a or something. Asking "no builtin" just prevented the linker to use that library when generating your file. IIrc too, that specific library should be safe for inclusion even in a kernel, and you could still have the benefits of "avoid anything that is host-related" through "-ffreestanding", yet i have to toy with that in real programming condition before i could validate the stuff.
Thanks Pype. It works fine, if I link libgcc.a with my kernel. :) But, is it safe to do so? Also, I use "-ffreestanding -nostdlib -nodefaultlibs" flags in gcc.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:"long long" division

Post by Solar »

NOTNULL wrote: It works fine, if I link libgcc.a with my kernel. :) But, is it safe to do so?
libgcc is licensed as "GPL with runtime exception", the same way as glibc. In short: Yes it is safe to link with it.
Every good solution is obvious once you've found it.
Post Reply