On Tue, Sep 14, 2021 at 12:12 PM Nick Desaulniers ndesaulniers@google.com wrote:
On Tue, Sep 14, 2021 at 11:55 AM Linus Torvalds torvalds@linux-foundation.org wrote:
Btw, these kinds of issues is exactly why I've been hardnosed about 64-bit divides for decades. 64-bit divides on 32-bit machines are *expensive*. It's why I don't like saying "just use '/' and we'll pick up the routines from libgcc".
I was going to ask about the history there; not to derail the thread further, but this is a question whose answer is important to me.
Are the helpers from libgcc insufficient? W
No. The helpers from libgcc are *overly* sufficient.
The reason we strive to avoid libgcc on any relevant architectures is not because it's not sufficient, it's because it hides problems.
libgcc has all these helpers for things that the kernel simply shouldn't do.
So _not_ linking against it is the thing that traditionally helps us find problems, because you get things like
undefined symbol '__udivdi3'
or whatever.
In other words, avoiding libgcc is what protects us from people doing (some) stupid things.
Linus