This is the mail archive of the
mailing list for the glibc project.
Re: Gcc builtin functions used by glibc not available on mips
- From: Roger Sayle <roger at eyesopen dot com>
- To: Ulrich Drepper <drepper at redhat dot com>
- Cc: "H. J. Lu" <hjl at lucon dot org>, <gcc at gcc dot gnu dot org>, <libc-alpha at sources dot redhat dot com>
- Date: Thu, 7 Feb 2002 23:06:38 -0700 (MST)
- Subject: Re: Gcc builtin functions used by glibc not available on mips
> No. Just because for some architectures the handling of the builtin
> is different this does not mean it is acceptable to make other
> platforms suffer. The code in glibc does not have to be generic. You
> cannot compile glibc without optimization and if further restrictions
> are necessary they will be enforced.
It is possible to make __builtin_memset call the system library memset
on all platforms. So the current comment in the code is misleading and
misguided. Its just that you've been bitten by this logic more often on
some platforms than on others.
The real question might whether it is safe to call library functions from
_dl_start on all platforms? I believe this is the solution Jakub Jelinek
and Richard Henderson were proposing.
Another possibility, is for glibc to use its own memset macros from
bits/string.h and/or bits/string2.h, if it can be sure that the libcall
will never be made. But attempting to second guess the compiler's
internal decisions on inlining functions is risky on any platform.