Re: __ucmpdi2

From: Jeff V. Merkey (jmerkey@timpanogas.com)
Date: Tue Sep 19 2000 - 14:10:21 EST


Linus Torvalds wrote:
>
> I'd love to link against libgcc, but for the fact that
>
> - gcc developers have sometimes done horribly stupid things, and NOT
> linking against libgcc has been an excellent way of not getting
> bitten by it. Things like the exception handling etc, where not
> linking against libgcc caused the kernel to not link - where that was
> the RIGHT thing to do, because gcc had inserted completely bogus
> exception handling into the code.
>
> Proper fix: -fno-exceptions
>
> - Linux developers often do horribly stupid things, and use 64-bit
> division etc instead of using a simple shift. Again, not linking
> against libgcc finds those things early rather than late, because the
> horribly stupid things end up requireing libgcc support.
>
> In the case of __ucmpdi2, it appears to be a combination of kernel and
> compiler stupidity - there's no reason why __ucmpdi2 should not be done
> inline by the compiler, but at the same time there is probably also
> little reason to use a slow "long long" comparison in the kernel.
>
> So again, not linking libgcc showed a problem. Good for us.
>
> But yes, it is often much more convenient to not know about problems
> like this. And some people don't think they are a big deal. I'd rather
> nip them in the bud early than be "convenient", myself.
>
> Linus
> -

Linus,

You forgot to mention that some folks also code with C++ in these user
libs -- result, new and constructor/destructor operations will create
all kinds of hidden memory allocations all over the place that the C++
compiler hides from the coder and that impact performance.

NetWare uses a model close to yours with a pico-kernel-lib for the
kernel proper and all the other lib crap goes up in the user environment
-- the kernel does not link to any commercial libs either for the
reasons you stated, and the problems with C++ code in kernel. C++ let's
programmers get sloppy and lets them create convoluted code that is so
unreadable and unmaintainable it assures job security. I sometimes
believe this is why C++ was created to begin with.

Alot of the W2K kernel is C++, which explains why it's such a pig.
Structured exception handling is nice, but the hidden memory allocations
can really bite on performance.

:-)

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



This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 21:00:21 EST